Skip to content

Commit

Permalink
Merge pull request #16915 from spowelljr/release1311
Browse files Browse the repository at this point in the history
Release v1.31.1
  • Loading branch information
spowelljr committed Jul 20, 2023
2 parents 55aa6b2 + 473bba4 commit fd3f380
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,27 @@
# Release Notes

## Version 1.31.1 - 2023-07-20

* cni: Fix regression in auto selection [#16912](https://github.com/kubernetes/minikube/pull/16912)

For a more detailed changelog, see [CHANGELOG.md](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md).

Thank you to our contributors for this release!

- Jeff MAURY
- Medya Ghazizadeh
- Steven Powell

Thank you to our triage members for this release!

- afbjorklund (5 comments)
- torenware (5 comments)
- mprimeaux (3 comments)
- prezha (3 comments)
- spowelljr (1 comments)

Check out our [contributions leaderboard](https://minikube.sigs.k8s.io/docs/contrib/leaderboard/v1.31.1/) for this release!

## Version 1.31.0 - 2023-07-18

Features:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -15,7 +15,7 @@
# Bump these on release - and please check ISO_VERSION for correctness.
VERSION_MAJOR ?= 1
VERSION_MINOR ?= 31
VERSION_BUILD ?= 0
VERSION_BUILD ?= 1
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
VERSION ?= v$(RAW_VERSION)

Expand Down
20 changes: 19 additions & 1 deletion cmd/minikube/cmd/start.go
Expand Up @@ -426,11 +426,29 @@ func validateBuiltImageVersion(r command.Runner, driverName string) {
return
}

if versionDetails.MinikubeVersion != version.GetVersion() {
if !imageMatchesBinaryVersion(versionDetails.MinikubeVersion, version.GetVersion()) {
out.WarningT("Image was not built for the current minikube version. To resolve this you can delete and recreate your minikube cluster using the latest images. Expected minikube version: {{.imageMinikubeVersion}} -> Actual minikube version: {{.minikubeVersion}}", out.V{"imageMinikubeVersion": versionDetails.MinikubeVersion, "minikubeVersion": version.GetVersion()})
}
}

func imageMatchesBinaryVersion(imageVersion, binaryVersion string) bool {
// 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

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

func startWithDriver(cmd *cobra.Command, starter node.Starter, existing *config.ClusterConfig) (*kubeconfig.Settings, error) {
kubeconfig, err := node.Start(starter, true)
if err != nil {
Expand Down
20 changes: 20 additions & 0 deletions cmd/minikube/cmd/start_test.go
Expand Up @@ -840,3 +840,23 @@ func TestValidateStaticIP(t *testing.T) {
}
}
}

func TestImageMatchesBinaryVersion(t *testing.T) {
tests := []struct {
imageVersion string
binaryVersion string
versionMatch bool
}{
{"v1.17.0", "v1.17.0", true},
{"v1.17.0", "v1.20.0", false},
{"v1.31.0", "v1.31.1", true},
{"v1.31.1", "v1.31.0", false},
}

for _, tc := range tests {
got := imageMatchesBinaryVersion(tc.imageVersion, tc.binaryVersion)
if got != tc.versionMatch {
t.Errorf("imageMatchesBinaryVersion(%s, %s) = %t; want = %t", tc.imageVersion, tc.binaryVersion, got, tc.versionMatch)
}
}
}

0 comments on commit fd3f380

Please sign in to comment.