1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Merge pull request #2866 from nanorobocop/system-images-panic

Fix panic at updating K8sVersionToRKESystemImages
This commit is contained in:
Jiaqi Luo
2022-05-27 16:38:05 -07:00
committed by GitHub

View File

@@ -106,7 +106,7 @@ func initDockerOptions(data kdm.Data) {
}
func initK8sRKESystemImages(data kdm.Data) {
K8sVersionToRKESystemImages = map[string]v3.RKESystemImages{}
K8sVersionToRKESystemImagesTmp := map[string]v3.RKESystemImages{}
rkeData := data
// non released versions
if RKEVersion == "" {
@@ -132,7 +132,7 @@ func initK8sRKESystemImages(data kdm.Data) {
}
}
// store all for upgrades
K8sVersionToRKESystemImages[k8sVersion] = interface{}(systemImages).(v3.RKESystemImages)
K8sVersionToRKESystemImagesTmp[k8sVersion] = interface{}(systemImages).(v3.RKESystemImages)
majorVersion := getTagMajorVersion(k8sVersion)
maxVersionInfo, ok := rkeData.K8sVersionInfo[majorVersion]
@@ -150,6 +150,8 @@ func initK8sRKESystemImages(data kdm.Data) {
for _, k8sVersion := range maxVersionForMajorK8sVersion {
K8sVersionsCurrent = append(K8sVersionsCurrent, k8sVersion)
}
K8sVersionToRKESystemImages = K8sVersionToRKESystemImagesTmp
}
func getTagMajorVersion(tag string) string {