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

fix: add default value for status-check flag when no value is specified #7278

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/skaffold/app/cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ var flagRegistry = []Flag{
FlagAddMethod: "Var",
DefinedOn: []string{"dev", "debug", "deploy", "run", "apply"},
IsEnum: true,
NoOptDefVal: "true",
},
{
Name: "iterative-status-check",
Expand Down
31 changes: 31 additions & 0 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,34 @@ func TestRunTest(t *testing.T) {
})
}
}

// TestRunNoOptFlags tests to ensure that flags that don't require a value to be passed work when no value is passed
func TestRunNoOptFlags(t *testing.T) {
test := struct {
description string
dir string
targetLog string
pods []string
args []string
}{
description: "getting-started",
dir: "testdata/getting-started",
pods: []string{"getting-started"},
targetLog: "Hello world!",
args: []string{
"--port-forward",
"--status-check",
},
}

MarkIntegrationTest(t, CanRunWithoutGcp)
t.Run(test.description, func(t *testing.T) {
ns, _ := SetupNamespace(t)

args := append(test.args, "--tail")
out := skaffold.Run(args...).InDir(test.dir).InNs(ns.Name).RunLive(t)
defer skaffold.Delete().InDir(test.dir).InNs(ns.Name).RunOrFail(t)

WaitForLogs(t, out, test.targetLog)
})
}