You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfmt.Errorf("failed to retrieve the rhcos image with uuid %s: %w", *imgUUID, err)
148
+
}
149
+
imgSource:=*imgResp.Status.Resources.SourceURI
150
+
151
+
si:=strings.LastIndex(imgSource, "/rhcos-")
152
+
ifsi<0 {
153
+
returnfmt.Errorf("failed to get the rhcos image version from the preloaded image %s object's source_uri %s", p.PreloadedOSImageName, imgSource)
154
+
}
155
+
verStr:=strings.Split(imgSource[si+7:], ".")[0]
156
+
imgVerNum, err:=strconv.Atoi(verStr)
157
+
iferr!=nil {
158
+
returnfmt.Errorf("failed to get the rhcos image version number from the version string %s: %w", verStr, err)
159
+
}
160
+
161
+
// verify that the image version numbers are compactible
162
+
versionDiff:=rhcosVerNum-imgVerNum
163
+
switch {
164
+
caseversionDiff<0:
165
+
returnfmt.Errorf("the preloaded image's rhcos version: %v is too many revisions ahead the installer bundled rhcos version: %v", imgVerNum, rhcosVerNum)
166
+
caseversionDiff>=2:
167
+
returnfmt.Errorf("the preloaded image's rhcos version: %v is too many revisions behind the installer bundled rhcos version: %v", imgVerNum, rhcosVerNum)
168
+
caseversionDiff==1:
169
+
logrus.Warnf("the preloaded image's rhcos version: %v is behind the installer bundled rhcos version: %v, installation may fail", imgVerNum, rhcosVerNum)
0 commit comments