Skip to content

Commit

Permalink
fixup! Implement skip preflight flag
Browse files Browse the repository at this point in the history
  • Loading branch information
aniruddha2000 committed Aug 16, 2024
1 parent 49ab69d commit 03d52ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/conformance/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down

0 comments on commit 03d52ff

Please sign in to comment.