Skip to content

Commit

Permalink
Fix TestYamls for change in ko create
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
abayer committed Aug 30, 2022
1 parent 9d9aa9d commit df12ce0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ func substituteEnv(input []byte, namespace string) ([]byte, error) {
}
output := defaultKoDockerRepoRE.ReplaceAll(input, []byte(val))

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

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

0 comments on commit df12ce0

Please sign in to comment.