From 6c5917fa98b669e74569ef73842dc8b562f111f1 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 6 Oct 2023 15:13:54 +0200 Subject: [PATCH] fix API server access profile diff --- azure/services/managedclusters/spec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure/services/managedclusters/spec.go b/azure/services/managedclusters/spec.go index 4cd3362dad7..39514f2d7ca 100644 --- a/azure/services/managedclusters/spec.go +++ b/azure/services/managedclusters/spec.go @@ -614,13 +614,13 @@ func computeDiffOfNormalizedClusters(managedCluster armcontainerservice.ManagedC } } - if managedCluster.Properties.APIServerAccessProfile != nil { + if managedCluster.Properties.APIServerAccessProfile != nil && managedCluster.Properties.APIServerAccessProfile.AuthorizedIPRanges != nil { propertiesNormalized.APIServerAccessProfile = &armcontainerservice.ManagedClusterAPIServerAccessProfile{ AuthorizedIPRanges: managedCluster.Properties.APIServerAccessProfile.AuthorizedIPRanges, } } - if existingMC.Properties.APIServerAccessProfile != nil { + if existingMC.Properties.APIServerAccessProfile != nil && existingMC.Properties.APIServerAccessProfile.AuthorizedIPRanges != nil { existingMCPropertiesNormalized.APIServerAccessProfile = &armcontainerservice.ManagedClusterAPIServerAccessProfile{ AuthorizedIPRanges: existingMC.Properties.APIServerAccessProfile.AuthorizedIPRanges, }