Skip to content

Commit 3735628

Browse files
committed
Skip privatedns zones on Azure Stack
Azure Stack Hub does not support private dns zones, so skip them.
1 parent 8abfb9f commit 3735628

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

azure/scope/cluster.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func (s *ClusterScope) VNetSpec() azure.ASOResourceSpecGetter[*asonetworkv1api20
558558

559559
// PrivateDNSSpec returns the private dns zone spec.
560560
func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, linkSpec, recordSpec []azure.ResourceSpecGetter) {
561-
if s.IsAPIServerPrivate() {
561+
if s.IsAPIServerPrivate() && !s.IsHybridEnvironment() {
562562
resourceGroup := s.ResourceGroup()
563563
if s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup != "" {
564564
resourceGroup = s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup
@@ -1234,3 +1234,8 @@ func (s *ClusterScope) getLastAppliedSecurityRules(nsgName string) map[string]in
12341234
}
12351235
return lastAppliedSecurityRules
12361236
}
1237+
1238+
// IsHybridEnvironment returns true if the cluster is running on Azure Stack.
1239+
func (s *ClusterScope) IsHybridEnvironment() bool {
1240+
return strings.EqualFold(s.Environment.Name, azure.StackCloudName)
1241+
}

0 commit comments

Comments
 (0)