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:
@@ -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, "-", "_")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user