Skip to content

Commit

Permalink
replaced kwokctl output
Browse files Browse the repository at this point in the history
  • Loading branch information
NeerajNagure committed Jun 19, 2024
1 parent f857bd9 commit 261272e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/e2e/dryrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ func loadExpectedClusterDetails(filepath string, clusterName string, rootDir str
return "", err
}
out := string(data)
out = strings.ReplaceAll(out, "<CLUSTER_NAME>", clusterName)
out = strings.ReplaceAll(out, "<ROOT_DIR>", rootDir)
return out, nil
}

Expand All @@ -49,15 +47,15 @@ func CaseDryrun(clusterName string, kwokctlPath string, rootDir string) *feature
t.Fatal("Could not get expected cluster details:", err)
}
t.Log("EXPECTED CLUSTER:", expected)
os.Setenv("KWOK_RUNTIME","binary")
cmd := exec.Command(kwokctlPath, "create", "cluster", "--name="+clusterName, "--dry-run", "--runtime=binary", "--kube-authorization=false", "--disable-qps-limits", "--quiet-pull", "--timeout=30m", "--wait=30m")

Check failure on line 50 in test/e2e/dryrun.go

View workflow job for this annotation

GitHub Actions / lint

G204: Subprocess launched with a potential tainted input or cmd arguments (gosec)
os.Unsetenv("KWOK_RUNTIME")
var output []byte
output, err = cmd.Output()
if err != nil {
t.Fatal("Could not get the output of the command:", err)
}
got := string(output)
got = strings.ReplaceAll(got, clusterName, "<CLUSTER_NAME>")
got = strings.ReplaceAll(got, rootDir, "<ROOT_DIR>")
t.Log("GOT CLUSTER:", got)
if !strings.EqualFold(strings.TrimSpace(got), strings.TrimSpace(expected)) {
t.Fatalf("Expected %s but got %s", expected, got)
Expand Down

0 comments on commit 261272e

Please sign in to comment.