Skip to content

Commit f6c334e

Browse files
sadasuopenshift-cherrypick-robot
authored andcommitted
Azure CAPI: Update determination of MachinePool SecurityType
Added additional null checks. EncryptionAtHost setting has no bearing with machinepool SecurityType settings. So, remove check for `EncryptionAtHost`.
1 parent dfd4c08 commit f6c334e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/infrastructure/azure/azure.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func (p *Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput
436436
// If Control Plane Security Type is provided, then pass that along
437437
// during Gen V2 Gallery Image creation. It will be added as a
438438
// supported feature of the image.
439-
securityType, err := getControlPlaneSecurityType(in)
439+
securityType, err := getMachinePoolSecurityType(in)
440440
if err != nil {
441441
return err
442442
}
@@ -893,17 +893,17 @@ func (p Provider) Ignition(ctx context.Context, in clusterapi.IgnitionInput) ([]
893893
return ignSecrets, nil
894894
}
895895

896-
func getControlPlaneSecurityType(in clusterapi.InfraReadyInput) (string, error) {
896+
func getMachinePoolSecurityType(in clusterapi.InfraReadyInput) (string, error) {
897897
var securityType aztypes.SecurityTypes
898-
if in.InstallConfig.Config.ControlPlane != nil {
898+
if in.InstallConfig.Config.ControlPlane != nil && in.InstallConfig.Config.ControlPlane.Platform.Azure != nil {
899899
pool := in.InstallConfig.Config.ControlPlane.Platform.Azure
900-
if pool.EncryptionAtHost && pool.Settings != nil {
900+
if pool.Settings != nil {
901901
securityType = pool.Settings.SecurityType
902902
}
903903
}
904904
if securityType == "" && in.InstallConfig.Config.Platform.Azure.DefaultMachinePlatform != nil {
905905
pool := in.InstallConfig.Config.Platform.Azure.DefaultMachinePlatform
906-
if pool.EncryptionAtHost && pool.Settings != nil {
906+
if pool.Settings != nil {
907907
securityType = pool.Settings.SecurityType
908908
}
909909
}

0 commit comments

Comments
 (0)