diff --git a/pkg/conformance/deploy.go b/pkg/conformance/deploy.go index f1b88e0..db03d9d 100644 --- a/pkg/conformance/deploy.go +++ b/pkg/conformance/deploy.go @@ -206,21 +206,22 @@ func (r *TestRunner) Deploy(ctx context.Context, focus string, skipPreflight str return fmt.Errorf("namespace %s already exists, please run with --cleanup first", conformanceNS.Name) } } else { - return err + return fmt.Errorf("failed to create namespace: %w", err) } } else { log.Printf("Created namespace %s.", ns.Name) } - sa, err := r.clientset.CoreV1().ServiceAccounts(ns.Name).Create(ctx, &conformanceSA, metav1.CreateOptions{}) + sa, err := r.clientset.CoreV1().ServiceAccounts(r.config.Namespace).Create(ctx, &conformanceSA, metav1.CreateOptions{}) if err != nil { if errors.IsAlreadyExists(err) { //nolint:stylecheck // error message references a Kubernetes resource type. - err = fmt.Errorf("ServiceAccount %s already exist, please run --cleanup first", conformanceSA.Name) + return fmt.Errorf("ServiceAccount %s already exist, please run --cleanup first", conformanceSA.Name) } - return err + return fmt.Errorf("failed to create ServiceAccount: %w", err) } + log.Println("here it is") log.Printf("Created ServiceAccount %s.", sa.Name) clusterRole, err := r.clientset.RbacV1().ClusterRoles().Create(ctx, &conformanceClusterRole, metav1.CreateOptions{})