Skip to content

Commit

Permalink
Fix DryRun flag inclusion
Browse files Browse the repository at this point in the history
Signed-off-by: rjsadow <richard.j.sadowski@gmail.com>
  • Loading branch information
rjsadow authored and dims committed Dec 26, 2023
1 parent d636b8f commit a099251
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ func RunE2E(clientset *kubernetes.Clientset, cfg *common.ArgConfig) {
Name: "E2E_USE_GO_RUNNER",
Value: "true",
},
{
Name: "E2E_DRYRUN",
Value: fmt.Sprintf("%t", cfg.DryRun),
},
},
VolumeMounts: []v1.VolumeMount{
{
Expand Down Expand Up @@ -207,6 +203,10 @@ func RunE2E(clientset *kubernetes.Clientset, cfg *common.ArgConfig) {
},
}

if cfg.DryRun {
conformancePod.Spec.Containers[0].Env = append(conformancePod.Spec.Containers[0].Env, DryRun())
}

ns, err := clientset.CoreV1().Namespaces().Create(ctx, &conformanceNS, metav1.CreateOptions{})
if err != nil {
if errors.IsAlreadyExists(err) {
Expand Down Expand Up @@ -309,3 +309,10 @@ func Cleanup(clientset *kubernetes.Clientset) {
}
log.Printf("namespace deleted %s\n", common.Namespace)
}

func DryRun() v1.EnvVar {
return v1.EnvVar{
Name: "E2E_DRYRUN",
Value: "true",
}
}

0 comments on commit a099251

Please sign in to comment.