Merge pull request #29110 from bboreham/clarify-healthcheck

Automatic merge from submit-queue

Don't repeat the program name in healthCheckCommand.String()

The name is in both `Path` and `Args[0]`, so start printing args at 1.
Also refactor to avoid an extra space character in the output.

I pondered whether `healthCheckCommand.String()` should check if the slice is empty, to avoid a panic, but it didn't check for `Cmd==nil` before.

Fixes #29107
This commit is contained in:
k8s-merge-robot 2016-07-19 05:08:42 -07:00 committed by GitHub
commit dca70739af

View File

@ -397,5 +397,5 @@ func newHealthCheckCommand(healthCheckUrl string, cmd *exec.Cmd, filename string
}
func (hcc *healthCheckCommand) String() string {
return fmt.Sprintf("`%s %s` health-check: %s", hcc.Path, strings.Join(hcc.Args, " "), hcc.HealthCheckUrl)
return fmt.Sprintf("`%s` health-check: %s", strings.Join(append([]string{hcc.Path}, hcc.Args[1:]...), " "), hcc.HealthCheckUrl)
}