diff --git a/pkg/minikube/bootstrapper/bsutil/binaries.go b/pkg/minikube/bootstrapper/bsutil/binaries.go index 5535305f085f..993838e05937 100644 --- a/pkg/minikube/bootstrapper/bsutil/binaries.go +++ b/pkg/minikube/bootstrapper/bsutil/binaries.go @@ -41,6 +41,10 @@ import ( func TransferCrictl(cfg config.KubernetesConfig, c command.Runner) error { src, err := download.CrictlBinary(cfg.KubernetesVersion) if err != nil { + if strings.Contains(err.Error(), "response code: 404") { + klog.Info("Failed to download crictl with matching version. Using whatever version is already on the image") + return nil + } return errors.Wrapf(err, "downloading crictl") } dst := "/usr/bin/crictl" diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index ede023301bb3..a6d069ff40a8 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -58,11 +58,11 @@ func CrictlVersion(c CommandRunner) (*semver.Version, error) { } stdout := rr.Stdout.String() reg := regexp.MustCompile(`crictl\s*version\s*(v\d*\.\d*.\d*)`) - subMatches := reg.FindSubmatch([]byte(stdout)) + subMatches := reg.FindStringSubmatch(stdout) if len(subMatches) < 2 { return nil, fmt.Errorf("failed to find the crictl version") } - version, err := util.ParseKubernetesVersion(string(subMatches[1])) + version, err := util.ParseKubernetesVersion(subMatches[1]) if err != nil { return nil, err }