Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-v0.36.x] Fix TestYamls for change in ko create #5441

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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