Skip to content

Commit fd3f380

Browse files
authored
Merge pull request #16915 from spowelljr/release1311
Release v1.31.1
2 parents 55aa6b2 + 473bba4 commit fd3f380

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Release Notes
22

3+
## Version 1.31.1 - 2023-07-20
4+
5+
* cni: Fix regression in auto selection [#16912](https://github.com/kubernetes/minikube/pull/16912)
6+
7+
For a more detailed changelog, see [CHANGELOG.md](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md).
8+
9+
Thank you to our contributors for this release!
10+
11+
- Jeff MAURY
12+
- Medya Ghazizadeh
13+
- Steven Powell
14+
15+
Thank you to our triage members for this release!
16+
17+
- afbjorklund (5 comments)
18+
- torenware (5 comments)
19+
- mprimeaux (3 comments)
20+
- prezha (3 comments)
21+
- spowelljr (1 comments)
22+
23+
Check out our [contributions leaderboard](https://minikube.sigs.k8s.io/docs/contrib/leaderboard/v1.31.1/) for this release!
24+
325
## Version 1.31.0 - 2023-07-18
426

527
Features:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Bump these on release - and please check ISO_VERSION for correctness.
1616
VERSION_MAJOR ?= 1
1717
VERSION_MINOR ?= 31
18-
VERSION_BUILD ?= 0
18+
VERSION_BUILD ?= 1
1919
RAW_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)
2020
VERSION ?= v$(RAW_VERSION)
2121

cmd/minikube/cmd/start.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,29 @@ func validateBuiltImageVersion(r command.Runner, driverName string) {
426426
return
427427
}
428428

429-
if versionDetails.MinikubeVersion != version.GetVersion() {
429+
if !imageMatchesBinaryVersion(versionDetails.MinikubeVersion, version.GetVersion()) {
430430
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()})
431431
}
432432
}
433433

434+
func imageMatchesBinaryVersion(imageVersion, binaryVersion string) bool {
435+
// the map below is used to map the binary version to the version the image expects
436+
// this is usually done when a patch version is released but a new ISO/Kicbase is not needed
437+
// that way a version mismatch warning won't be thrown
438+
//
439+
// ex.
440+
// the v1.31.0 and v1.31.1 minikube binaries both use v1.31.0 ISO & Kicbase
441+
// 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
442+
443+
mappedVersions := map[string]string{
444+
"v1.31.1": "v1.31.0",
445+
}
446+
if v, ok := mappedVersions[binaryVersion]; ok {
447+
binaryVersion = v
448+
}
449+
return binaryVersion == imageVersion
450+
}
451+
434452
func startWithDriver(cmd *cobra.Command, starter node.Starter, existing *config.ClusterConfig) (*kubeconfig.Settings, error) {
435453
kubeconfig, err := node.Start(starter, true)
436454
if err != nil {

cmd/minikube/cmd/start_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,3 +840,23 @@ func TestValidateStaticIP(t *testing.T) {
840840
}
841841
}
842842
}
843+
844+
func TestImageMatchesBinaryVersion(t *testing.T) {
845+
tests := []struct {
846+
imageVersion string
847+
binaryVersion string
848+
versionMatch bool
849+
}{
850+
{"v1.17.0", "v1.17.0", true},
851+
{"v1.17.0", "v1.20.0", false},
852+
{"v1.31.0", "v1.31.1", true},
853+
{"v1.31.1", "v1.31.0", false},
854+
}
855+
856+
for _, tc := range tests {
857+
got := imageMatchesBinaryVersion(tc.imageVersion, tc.binaryVersion)
858+
if got != tc.versionMatch {
859+
t.Errorf("imageMatchesBinaryVersion(%s, %s) = %t; want = %t", tc.imageVersion, tc.binaryVersion, got, tc.versionMatch)
860+
}
861+
}
862+
}

0 commit comments

Comments
 (0)