1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

Merge pull request #10201 from openshift-cherrypick-robot/cherry-pick-10200-to-release-4.21

[release-4.21] OCPBUGS-72521: Fix nil pointer exception in azure mapiImage
This commit is contained in:
openshift-merge-bot[bot]
2026-01-12 23:04:56 +00:00
committed by GitHub
2 changed files with 1 additions and 6 deletions

View File

@@ -390,7 +390,7 @@ func capzImage(osImage aztypes.OSImage, azEnv aztypes.CloudEnvironment, confiden
case rhcosImg == "" && !confidentialVM:
// hive calls the machines function, but may pass an empty
// string for rhcos. In which case, allow MAO to choose default.
return nil
return &capz.Image{} // can't be nil or mapiImage will panic
default: // Installer-created image gallery, for OKD && confidential VMs.
// image gallery names cannot have dashes
galleryName := strings.ReplaceAll(infraID, "-", "_")

View File

@@ -433,11 +433,6 @@ func generateSecurityProfile(mpool *azure.MachinePool) *machineapi.SecurityProfi
func mapiImage(osImage azure.OSImage, azEnv azure.CloudEnvironment, confidentialVM bool, gen, rg, sub, infraID, rhcosImg string) machineapi.Image {
mImg := machineapi.Image{}
// hive uses this package, but may pass an empty string for rhcosImg,
// in which case we want to depend on MAO default, so return empty.
if rhcosImg == "" {
return mImg
}
cImg := capzImage(osImage, azEnv, confidentialVM, gen, rg, sub, infraID, rhcosImg)
if cImg.ID != nil {