Merge pull request #15642 from afbjorklund/crictl-version-path

Use absolute path when calling crictl version
pull/15670/head
Medya Ghazizadeh 2023-01-19 08:44:58 -08:00 committed by GitHub
commit ae7cb58bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -471,8 +471,15 @@ func waitForCRIVersion(runner cruntime.CommandRunner, socket string, wait int, i
klog.Infof("Will wait %ds for crictl version", wait)
cmd := exec.Command("which", "crictl")
rr, err := runner.RunCmd(cmd)
if err != nil {
return err
}
crictl := strings.TrimSuffix(rr.Stdout.String(), "\n")
chkInfo := func() error {
args := []string{"crictl", "version"}
args := []string{crictl, "version"}
cmd := exec.Command("sudo", args...)
rr, err := runner.RunCmd(cmd)
if err != nil && !os.IsNotExist(err) {