From ba0a41cb550ad0ba3e62c339315bc8ca10eab7db Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 16 Jun 2023 16:46:02 +0200 Subject: [PATCH] Fix AuthorizedIPRanges diff --- azure/services/managedclusters/spec.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/azure/services/managedclusters/spec.go b/azure/services/managedclusters/spec.go index 11e77f37252..99f18d449f2 100644 --- a/azure/services/managedclusters/spec.go +++ b/azure/services/managedclusters/spec.go @@ -367,11 +367,14 @@ func (s *ManagedClusterSpec) Parameters(ctx context.Context, existing interface{ if s.APIServerAccessProfile != nil { managedCluster.APIServerAccessProfile = &containerservice.ManagedClusterAPIServerAccessProfile{ - AuthorizedIPRanges: &s.APIServerAccessProfile.AuthorizedIPRanges, EnablePrivateCluster: s.APIServerAccessProfile.EnablePrivateCluster, PrivateDNSZone: s.APIServerAccessProfile.PrivateDNSZone, EnablePrivateClusterPublicFQDN: s.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, } + + if len(s.APIServerAccessProfile.AuthorizedIPRanges) > 0 { + managedCluster.APIServerAccessProfile.AuthorizedIPRanges = &s.APIServerAccessProfile.AuthorizedIPRanges + } } if s.OutboundType != nil {