Skip to content

Commit

Permalink
Merge pull request #16990 from spowelljr/fixImageMismatch
Browse files Browse the repository at this point in the history
Fix version mismatch error
  • Loading branch information
medyagh committed Aug 3, 2023
2 parents f79e7d1 + 04070a1 commit eda28fa
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,24 @@ func validateBuiltImageVersion(r command.Runner, driverName string) {
}

func imageMatchesBinaryVersion(imageVersion, binaryVersion string) bool {
if binaryVersion == imageVersion {
return true
}

// the map below is used to map the binary version to the version the image expects
// this is usually done when a patch version is released but a new ISO/Kicbase is not needed
// that way a version mismatch warning won't be thrown
//
// ex.
// the v1.31.0 and v1.31.1 minikube binaries both use v1.31.0 ISO & Kicbase
// to prevent the v1.31.1 binary from throwing a version mismatch warning we use the map to use change the binary version used in the comparison
// to prevent the v1.31.1 binary from throwing a version mismatch warning we use the map to change the binary version used in the comparison

mappedVersions := map[string]string{
"v1.31.1": "v1.31.0",
}
if v, ok := mappedVersions[binaryVersion]; ok {
binaryVersion = v
}
return binaryVersion == imageVersion
binaryVersion, ok := mappedVersions[binaryVersion]

return ok && binaryVersion == imageVersion
}

func startWithDriver(cmd *cobra.Command, starter node.Starter, existing *config.ClusterConfig) (*kubeconfig.Settings, error) {
Expand Down

0 comments on commit eda28fa

Please sign in to comment.