Skip to content

Commit f7e8a56

Browse files
abayertekton-robot
authored andcommitted
Fix TestYamls for change in ko create
With ko-build/ko#750, which we picked up when we bumped `ko` to `v0.12.0` in the test-runner image, `-n (namespace)` is no longer an argument for `ko create`. So we need to ensure that the namespace for the `TestYamls` CRDs is actually set properly, and get rid of the `-n (namespace)` from our invocation of `ko create`. Signed-off-by: Andrew Bayer <[email protected]>
1 parent 6a0575d commit f7e8a56

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/examples_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ func substituteEnv(input []byte, namespace string) ([]byte, error) {
7777
}
7878
output := defaultKoDockerRepoRE.ReplaceAll(input, []byte(val))
7979

80-
// Strip any "namespace: default"s, all resources will be created in
81-
// the test namespace using `ko create -n`
80+
// Replace any "namespace: default"s with the test namespace.
8281
output = defaultNamespaceRE.ReplaceAll(output, []byte("namespace: "+namespace))
8382

8483
// Replace image names to arch specific ones, where it's necessary
@@ -91,7 +90,7 @@ func substituteEnv(input []byte, namespace string) ([]byte, error) {
9190
// koCreate wraps the ko binary and invokes `ko create` for input within
9291
// namespace
9392
func koCreate(input []byte, namespace string) ([]byte, error) {
94-
cmd := exec.Command("ko", "create", "--platform", "linux/"+getTestArch(), "-n", namespace, "-f", "-")
93+
cmd := exec.Command("ko", "create", "--platform", "linux/"+getTestArch(), "-f", "-", "--", "--namespace", namespace)
9594
cmd.Stdin = bytes.NewReader(input)
9695
return cmd.CombinedOutput()
9796
}

0 commit comments

Comments
 (0)