Skip to content

Add ability to disable creation of dns zone for unmanaged installs #5666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/v1beta1/types_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ type NetworkClassSpec struct {
// +optional
PrivateDNSZoneName string `json:"privateDNSZoneName,omitempty"`

// PrivateDNSZone enables private dns zone creation modes for private cluster.
// +optional
PrivateDNSZone *string `json:"privateDNSZone,omitempty"`

// PrivateDNSZoneResourceGroup defines the resource group to be used for Azure Private DNS Zone.
// If not specified, the resource group of the cluster will be used to create the Azure Private DNS Zone.
// +optional
Expand Down
9 changes: 7 additions & 2 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion azure/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@

// PrivateDNSSpec returns the private dns zone spec.
func (s *ClusterScope) PrivateDNSSpec() (zoneSpec azure.ResourceSpecGetter, linkSpec, recordSpec []azure.ResourceSpecGetter) {
if s.IsAPIServerPrivate() {
if s.IsAPIServerPrivate() && s.AzureCluster.Spec.NetworkSpec.PrivateDNSZone != ptr.To(infrav1.PrivateDNSZoneModeNone) {

Check warning on line 562 in azure/scope/cluster.go

View check run for this annotation

Codecov / codecov/patch

azure/scope/cluster.go#L562

Added line #L562 was not covered by tests
resourceGroup := s.ResourceGroup()
if s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup != "" {
resourceGroup = s.AzureCluster.Spec.NetworkSpec.PrivateDNSZoneResourceGroup
Expand Down
Loading