Skip to content

Commit

Permalink
Update pkg/minikube/cruntime/cri.go
Browse files Browse the repository at this point in the history
Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
  • Loading branch information
ComradeProgrammer and spowelljr committed Apr 1, 2024
1 parent 8f572a9 commit 9907803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkg/minikube/bootstrapper/bsutil/binaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/cruntime/cri.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9907803

Please sign in to comment.