Skip to content

OCPBUGS-100054: Fix Azure Private clusters without external DNS - #9171

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
bryan-cox:fix-OCPBUGS-100054
Aug 6, 2026
Merged

OCPBUGS-100054: Fix Azure Private clusters without external DNS#9171
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
bryan-cox:fix-OCPBUGS-100054

Conversation

@bryan-cox

@bryan-cox bryan-cox commented Jul 29, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Azure Private clusters created without --external-dns-domain fail to complete. Several issues compound to prevent the hosted cluster from reaching Completed:

  1. PublicZoneID leaks into guest DNS config: The ingress operator tries to manage records in a public DNS zone it has no access to, causing AuthorizationFailed errors.

  2. KAS defaults to NodePort instead of Route: Without external DNS, the CLI doesn't set --api-server-address, so servicePublishingStrategy defaults to NodePort for KAS. Azure Private clusters need Route since there are no public load balancers.

  3. CPO fails reconciling external KAS route: When the cluster is Private with Route strategy but no external DNS hostname, reconcileExternalRoute requires a non-empty hostname and errors out.

  4. Private DNS zone name mismatch: create infra azure creates the private DNS zone as <name>-azurecluster.<baseDomain>. The ingress operator's getARecordName strips the zone suffix from the FQDN to produce a relative record name — but when the zone name doesn't match the cluster domain (due to -azurecluster), stripping is a no-op and the full FQDN becomes the record name. Azure then double-suffixes it, producing an unresolvable DNS entry.

Fixes

  • CLI guard: Omit PublicZoneID for Private clusters; default KAS to Route when Private and no --api-server-address is set.
  • GlobalConfig defense-in-depth: Refactor ReconcileDNSConfig to extract platform DNS overrides into applyPlatformDNSConfig. For Azure Private topology, clear the public zone even if set on the HCP spec.
  • CPO route handling: Skip external KAS route when Private with no hostname (matches existing Konnectivity pattern). Clean up stale external route if it exists.
  • DNS zone naming: Change infra CLI zone name from <name>-azurecluster.<baseDomain> to <name>.<baseDomain> so the zone matches the cluster domain. Update destroy path to match both current and legacy zone name patterns.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-100054

Special notes for your reviewer:

Validated end-to-end: Created a Private Azure self-managed cluster without --external-dns-domain. HC completed at 5.0.0-ec.5 with all cluster operators available and zero unhealthy pods — no manual DNS intervention required.

DNS zone naming context: The -azurecluster suffix was originally added to avoid shadowing *.apps when the PLS controller creates a baseDomain zone with only api/oauth records (see PR #8480). That concern doesn't apply here because the ingress operator populates the *.apps wildcard in the infra-created zone, so there's no shadowing. The old -azurecluster zone is vestigial — CAPZ marks AzureCluster as externally managed and never uses it.

Backward compatibility: PrivateZoneID is immutable on the HC API (CEL rule: oldSelf == "" || self == oldSelf), so existing clusters keep their -azurecluster zone. Only new clusters get the fixed zone name. The destroy path handles both patterns.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Azure private clusters omit PublicZoneID and retain private DNS configuration. DNS reconciliation centralizes platform-specific handling for IBM Cloud, Azure, and AWS SharedVPC. Service publishing strategy selection now receives private endpoint state and uses the Route strategy for private API server access. API server route reconciliation removes obsolete routes and supports private clusters without an API server hostname. All platform callers and tests pass the expanded helper arguments.

Sequence Diagram(s)

sequenceDiagram
  participant HostedControlPlane
  participant ClusterCreation
  participant ReconcileDNSConfig
  participant applyPlatformDNSConfig
  participant RouteReconciliation
  participant RouteAPI
  HostedControlPlane->>ClusterCreation: provide endpoint and DNS settings
  ClusterCreation->>ReconcileDNSConfig: reconcile DNS configuration
  ReconcileDNSConfig->>applyPlatformDNSConfig: apply platform overrides
  applyPlatformDNSConfig-->>ReconcileDNSConfig: return DNS configuration
  ClusterCreation->>RouteReconciliation: reconcile API server routes
  RouteReconciliation->>RouteAPI: delete obsolete routes
  RouteReconciliation->>RouteAPI: create internal route when required
  RouteAPI-->>RouteReconciliation: return route result
Loading

Suggested reviewers: devguyio, enxebre, muraee

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Changed tests use static literal or fixed case names; no Ginkgo It/Describe/Context calls or dynamic pod, namespace, node, IP, timestamp, or UUID values appear in test titles.
Test Structure And Quality ✅ Passed Changed tests use standard Go testing with isolated fake clients, no Ginkgo waits or cluster resources; subtests target one behavior and existing assertions provide fixture or strategy diagnostics.
Topology-Aware Scheduling Compatibility ✅ Passed Changed code only updates DNS, service publishing strategy, and route reconciliation; no scheduling constraints such as affinity, topology spread, PDBs, replica rules, selectors, or tolerations wer...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changed tests use Go testing.T/t.Run and fake clients, with no external connectivity or IPv4-only assumptions.
No-Weak-Crypto ✅ Passed The full PR diff adds only DNS, routing, and service-strategy logic; no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons were found.
Container-Privileges ✅ Passed The PR diff adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or root security settings; changed YAML fixtures contain no security fields.
No-Sensitive-Data-In-Logs ✅ Passed The full PR adds no logger, printf, klog, or event logging. New errors include only static route descriptions/names and wrapped client errors; no passwords, tokens, API keys, PII, or hostnames are...
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Azure Private cluster DNS fix, which matches the primary changes in the pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot added the area/cli Indicates the PR includes changes for CLI label Jul 29, 2026
@openshift-ci
openshift-ci Bot requested review from devguyio and enxebre July 29, 2026 17:59
@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added area/platform/azure PR/issue for Azure (AzurePlatform) platform approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@support/globalconfig/dns_test.go`:
- Around line 129-130: Rename the three added subtests in the DNS tests,
including the case around “Azure Private cluster omits publicZone even when
PublicZoneID is set” and the two corresponding cases at the other affected
locations, to use the repository-required “When ... it should ...” description
format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 6e2a6c8c-7dd2-4d39-ba27-ae0532089a5d

📥 Commits

Reviewing files that changed from the base of the PR and between 60a298a and 23c54b5.

⛔ Files ignored due to path filters (1)
  • cmd/cluster/azure/testdata/zz_fixture_TestCreateCluster_When_endpoint_access_is_Private_with_endpoint_access_private_flags_it_should_render_HostedCluster_with_Private_endpoint_access.yaml is excluded by !**/testdata/**
📒 Files selected for processing (3)
  • cmd/cluster/azure/create.go
  • support/globalconfig/dns.go
  • support/globalconfig/dns_test.go

Comment thread support/globalconfig/dns_test.go Outdated
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.41667% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.95%. Comparing base (deb9479) to head (30d61df).
⚠️ Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
...ator/controllers/hostedcontrolplane/infra/infra.go 43.75% 5 Missing and 4 partials ⚠️
...ator/controllers/hostedcontrolplane/kas/service.go 0.00% 7 Missing ⚠️
cmd/cluster/none/create.go 0.00% 1 Missing ⚠️
cmd/infra/azure/destroy.go 0.00% 1 Missing ⚠️
cmd/infra/azure/networking.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9171   +/-   ##
=======================================
  Coverage   44.94%   44.95%           
=======================================
  Files         778      778           
  Lines       97427    97430    +3     
=======================================
+ Hits        43790    43795    +5     
+ Misses      50616    50614    -2     
  Partials     3021     3021           
Files with missing lines Coverage Δ
cmd/cluster/aws/create.go 46.74% <100.00%> (ø)
cmd/cluster/azure/create.go 46.14% <100.00%> (+0.09%) ⬆️
cmd/cluster/core/create.go 62.96% <100.00%> (-0.04%) ⬇️
cmd/cluster/gcp/create.go 53.96% <100.00%> (ø)
cmd/cluster/kubevirt/create.go 54.20% <100.00%> (ø)
cmd/cluster/openstack/create.go 58.43% <100.00%> (ø)
cmd/cluster/powervs/create.go 57.83% <100.00%> (ø)
...controllers/hostedcluster/hostedcluster_webhook.go 56.89% <100.00%> (ø)
support/globalconfig/dns.go 100.00% <100.00%> (+16.21%) ⬆️
cmd/cluster/none/create.go 54.54% <0.00%> (ø)
... and 4 more

... and 2 files with indirect coverage changes

Flag Coverage Δ
cmd-support 38.64% <87.50%> (+0.02%) ⬆️
cpo-hostedcontrolplane 47.24% <30.43%> (-0.04%) ⬇️
cpo-other 45.67% <ø> (ø)
hypershift-operator 54.95% <100.00%> (+0.02%) ⬆️
other 34.30% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from 23c54b5 to fdbe328 Compare July 29, 2026 18:15
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jul 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: This pull request references Jira Issue OCPBUGS-100054, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

What this PR does / why we need it:

Azure Private clusters (--endpoint-access Private) have no public endpoints — their API server and *.apps routes are only reachable via Private Link. Despite this, the PublicZoneID flows through from create infra into dns.cluster on the guest, which is unnecessary and confusing.

This PR cleans this up with two layers:

  1. CLI guard (cmd/cluster/azure/create.go): When --endpoint-access is Private, omit PublicZoneID from the HostedCluster DNS spec. PublicAndPrivate clusters still include it.

  2. Defense-in-depth (support/globalconfig/dns.go): Refactors ReconcileDNSConfig to extract platform-specific DNS overrides into a new applyPlatformDNSConfig function with a clean switch statement covering IBMCloud, Azure, and AWS. For Azure Private topology, the public zone is cleared even if PublicZoneID was set on the HCP spec (e.g., from manually-created YAML).

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-100054

Special notes for your reviewer:

This is a cleanup, not a blocker fix. The ingress workload identity already gets permissions to the DNS zone resource group when --assign-identity-roles is used — see support/azureutil/azureutil.go:362-363 where the Ingress case scopes to dnsZoneRG.

The applyPlatformDNSConfig refactoring consolidates three previously scattered platform checks (IBMCloud BaseDomain override, Azure Private publicZone guard, AWS SharedVPC PrivateZoneIAMRole) into a single switch statement. All three behaviors are covered by unit tests.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin

Summary by CodeRabbit

  • Bug Fixes
  • Fixed DNS reconciliation for Azure private clusters to omit public DNS zones while still setting private DNS.
  • Ensured Azure public-and-private clusters populate both public and private DNS zones.
  • Standardized DNS base-domain assignment and restored IBM Cloud base-domain behavior.
  • Added AWS Shared VPC handling, including automatic private-zone IAM role population.
  • Tests
  • Expanded DNS reconciliation coverage with new platform/topology test cases.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bryan-cox

Copy link
Copy Markdown
Member Author

/test e2e-azure-v2-self-managed

@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from fdbe328 to 98271e5 Compare August 3, 2026 12:57
@openshift-ci openshift-ci Bot added area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform labels Aug 3, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: This pull request references Jira Issue OCPBUGS-100054, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

Details

In response to this:

What this PR does / why we need it:

Azure Private clusters (--endpoint-access Private) have no public endpoints — their API server and *.apps routes are only reachable via Private Link. Despite this, the PublicZoneID flows through from create infra into dns.cluster on the guest, which is unnecessary and confusing.

This PR cleans this up with two layers:

  1. CLI guard (cmd/cluster/azure/create.go): When --endpoint-access is Private, omit PublicZoneID from the HostedCluster DNS spec. PublicAndPrivate clusters still include it.

  2. Defense-in-depth (support/globalconfig/dns.go): Refactors ReconcileDNSConfig to extract platform-specific DNS overrides into a new applyPlatformDNSConfig function with a clean switch statement covering IBMCloud, Azure, and AWS. For Azure Private topology, the public zone is cleared even if PublicZoneID was set on the HCP spec (e.g., from manually-created YAML).

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-100054

Special notes for your reviewer:

This is a cleanup, not a blocker fix. The ingress workload identity already gets permissions to the DNS zone resource group when --assign-identity-roles is used — see support/azureutil/azureutil.go:362-363 where the Ingress case scopes to dnsZoneRG.

The applyPlatformDNSConfig refactoring consolidates three previously scattered platform checks (IBMCloud BaseDomain override, Azure Private publicZone guard, AWS SharedVPC PrivateZoneIAMRole) into a single switch statement. All three behaviors are covered by unit tests.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin

Summary by CodeRabbit

  • Bug Fixes
  • Fixed DNS reconciliation for Azure private clusters to omit public DNS zones while retaining private DNS.
  • Ensured Azure public-and-private clusters populate both public and private DNS zones.
  • Standardized DNS base-domain assignment and restored IBM Cloud behavior.
  • Added AWS Shared VPC handling, including automatic private-zone IAM role population.
  • Updated private ingress services to use route-based publishing.
  • Tests
  • Expanded coverage for DNS reconciliation and private ingress publishing behavior.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from 0e473ff to 43f7f5b Compare August 3, 2026 21:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go (2)

503-503: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the required When ... it should ... format for both new test cases.

  • control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go#L503-L503: rename Azure_Private_Route_NoHostname to a behavior-focused sentence.
  • control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go#L1522-L1522: rename Route strategy, private, no hostname to a behavior-focused sentence.

As per coding guidelines, test cases in *_test.go must use the When ... it should ... format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go` at
line 503, Rename both test cases in
control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go:503-503
and
control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go:1522-1522
to behavior-focused descriptions using the required “When ... it should ...”
format, preserving their existing test behavior.

Source: Coding guidelines


1521-1538: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise deletion of obsolete Routes.

This test uses an empty fake client. It verifies that no external Route is created, but it does not execute the successful Get/Delete path in deleteRouteIfExists.

Seed existing external public and private Routes, then assert that only kasInternalRoute remains.

As per coding guidelines, *_test.go files must unit test any code changes and additions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go`
around lines 1521 - 1538, Update the “Route strategy, private, no hostname” test
to seed the fake client with existing external public and private Routes,
exercising the successful Get/Delete path in deleteRouteIfExists. Assert the
resulting client state contains only kasInternalRoute, while preserving the
existing service expectations.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/infra/infra.go`:
- Around line 211-223: Update deleteRouteIfExists so a NotFound error returned
by r.Client.Delete is treated as successful completion, while preserving wrapped
errors for other delete failures and the existing Get handling.
- Around line 264-291: Update the API server route reconciliation around
serviceStrategy.Type so transitioning away from Route, including to
hyperv1.LoadBalancer, deletes the existing KubeAPIServerExternalPublicRoute,
KubeAPIServerExternalPrivateRoute, and KubeAPIServerInternalRoute resources.
Ensure normal Route reconciliation remains unchanged, and add a test covering
cleanup on the strategy transition.

---

Nitpick comments:
In `@control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go`:
- Line 503: Rename both test cases in
control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go:503-503
and
control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go:1522-1522
to behavior-focused descriptions using the required “When ... it should ...”
format, preserving their existing test behavior.
- Around line 1521-1538: Update the “Route strategy, private, no hostname” test
to seed the fake client with existing external public and private Routes,
exercising the successful Get/Delete path in deleteRouteIfExists. Assert the
resulting client state contains only kasInternalRoute, while preserving the
existing service expectations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7831f81f-e925-4c2c-bb8a-85e173a309d7

📥 Commits

Reviewing files that changed from the base of the PR and between 0e473ff and 43f7f5b.

⛔ Files ignored due to path filters (2)
  • cmd/cluster/azure/testdata/zz_fixture_TestCreateCluster_When_endpoint_access_is_Private_with_endpoint_access_private_flags_it_should_render_HostedCluster_with_Private_endpoint_access.yaml is excluded by !**/testdata/**
  • control-plane-operator/controllers/hostedcontrolplane/infra/testdata/zz_fixture_TestReconcileInfrastructure_Azure_Private_Route_NoHostname.yaml is excluded by !**/testdata/**
📒 Files selected for processing (13)
  • cmd/cluster/aws/create.go
  • cmd/cluster/azure/create.go
  • cmd/cluster/core/create.go
  • cmd/cluster/core/create_test.go
  • cmd/cluster/gcp/create.go
  • cmd/cluster/kubevirt/create.go
  • cmd/cluster/none/create.go
  • cmd/cluster/openstack/create.go
  • cmd/cluster/powervs/create.go
  • control-plane-operator/controllers/hostedcontrolplane/infra/infra.go
  • control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go
  • hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go
  • hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go
🚧 Files skipped from review as they are similar to previous changes (11)
  • hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go
  • hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go
  • cmd/cluster/kubevirt/create.go
  • cmd/cluster/none/create.go
  • cmd/cluster/powervs/create.go
  • cmd/cluster/aws/create.go
  • cmd/cluster/gcp/create.go
  • cmd/cluster/core/create_test.go
  • cmd/cluster/azure/create.go
  • cmd/cluster/core/create.go
  • cmd/cluster/openstack/create.go

Comment thread control-plane-operator/controllers/hostedcontrolplane/infra/infra.go Outdated
@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from 43f7f5b to 13c38b3 Compare August 3, 2026 22:00
@bryan-cox

Copy link
Copy Markdown
Member Author

/test e2e-aro-hcp

@bryan-cox bryan-cox changed the title OCPBUGS-100054: Skip publicZone for Azure Private clusters OCPBUGS-100054: Fix Azure Private clusters without external DNS Aug 4, 2026
return nil
}

func (r *Reconciler) deleteRouteIfExists(ctx context.Context, route *routev1.Route, routeDesc string) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the existing util function k8sutil.DeleteIfNeeded instead of this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed deleteRouteIfExists entirely and replaced all three callsites with k8sutil.DeleteIfNeeded, which already handles NotFound on both Get and Delete plus checks deletion timestamp. This matches the pattern already used in the OAuth route reconciliation in the same file.

@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from a805b3b to 2e0c4e6 Compare August 4, 2026 13:07
…ate clusters

- Add isPrivate parameter to GetIngressServicePublishingStrategyMapping
  so Azure Private clusters default KAS to Route strategy
- Update all callers (AWS, Azure, GCP, KubeVirt, None, OpenStack,
  PowerVS, webhook defaulter) to pass the new parameter
- Fix private DNS zone name from {name}-azurecluster.{baseDomain} to
  {name}.{baseDomain} to match the actual zone naming convention
- Update infra destroy to handle both current and legacy DNS zone name
  formats when cleaning up cluster resources
- Set PublicZoneID unconditionally for all Azure topologies, aligning
  with AWS behavior (Private only controls KAS endpoint visibility,
  not ingress DNS)
- Refactor globalconfig DNS to extract platform-specific overrides into
  applyPlatformDNSConfig and remove incorrect Azure Private PublicZone
  filtering

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
…ters without hostname

- When a Private cluster uses Route strategy without a hostname (no
  external DNS), skip creating the external private route and clean up
  any obsolete external routes using k8sutil.DeleteIfNeeded
- Handle KAS service status for Route strategy when no hostname is
  configured by falling back to load balancer ingress hostname or IP
- Add test cases for Private cluster without hostname and for route
  cleanup of obsolete external routes

Signed-off-by: Bryan Cox <brcox@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
@bryan-cox
bryan-cox force-pushed the fix-OCPBUGS-100054 branch from 2e0c4e6 to 30d61df Compare August 4, 2026 13:59
@csrwng

csrwng commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks-4-22
/test e2e-aws-4-22
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-azure-self-managed
/test e2e-v2-gke

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest-required

@bryan-cox

Copy link
Copy Markdown
Member Author

/retest

@bryan-cox

Copy link
Copy Markdown
Member Author

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 5, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: This PR has been marked as verified by @bryan-cox.

Details

In response to this:

/verified by @bryan-cox

Full test verification report here https://bryan-cox.github.io/architectural-artifact-sharing/test-verification-report-ocpbugs-100054/index.html

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azure-v2-self-managed fdbe328 link true /test e2e-azure-v2-self-managed
ci/prow/e2e-aro-hcp 13c38b3 link false /test e2e-aro-hcp

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8317d4c and 2 for PR HEAD 30d61df in total

@openshift-merge-bot
openshift-merge-bot Bot merged commit cb68973 into openshift:main Aug 6, 2026
45 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: Jira Issue Verification Checks: Jira Issue OCPBUGS-100054
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-100054 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

What this PR does / why we need it:

Azure Private clusters created without --external-dns-domain fail to complete. Several issues compound to prevent the hosted cluster from reaching Completed:

  1. PublicZoneID leaks into guest DNS config: The ingress operator tries to manage records in a public DNS zone it has no access to, causing AuthorizationFailed errors.

  2. KAS defaults to NodePort instead of Route: Without external DNS, the CLI doesn't set --api-server-address, so servicePublishingStrategy defaults to NodePort for KAS. Azure Private clusters need Route since there are no public load balancers.

  3. CPO fails reconciling external KAS route: When the cluster is Private with Route strategy but no external DNS hostname, reconcileExternalRoute requires a non-empty hostname and errors out.

  4. Private DNS zone name mismatch: create infra azure creates the private DNS zone as <name>-azurecluster.<baseDomain>. The ingress operator's getARecordName strips the zone suffix from the FQDN to produce a relative record name — but when the zone name doesn't match the cluster domain (due to -azurecluster), stripping is a no-op and the full FQDN becomes the record name. Azure then double-suffixes it, producing an unresolvable DNS entry.

Fixes

  • CLI guard: Omit PublicZoneID for Private clusters; default KAS to Route when Private and no --api-server-address is set.
  • GlobalConfig defense-in-depth: Refactor ReconcileDNSConfig to extract platform DNS overrides into applyPlatformDNSConfig. For Azure Private topology, clear the public zone even if set on the HCP spec.
  • CPO route handling: Skip external KAS route when Private with no hostname (matches existing Konnectivity pattern). Clean up stale external route if it exists.
  • DNS zone naming: Change infra CLI zone name from <name>-azurecluster.<baseDomain> to <name>.<baseDomain> so the zone matches the cluster domain. Update destroy path to match both current and legacy zone name patterns.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-100054

Special notes for your reviewer:

Validated end-to-end: Created a Private Azure self-managed cluster without --external-dns-domain. HC completed at 5.0.0-ec.5 with all cluster operators available and zero unhealthy pods — no manual DNS intervention required.

DNS zone naming context: The -azurecluster suffix was originally added to avoid shadowing *.apps when the PLS controller creates a baseDomain zone with only api/oauth records (see PR #8480). That concern doesn't apply here because the ingress operator populates the *.apps wildcard in the infra-created zone, so there's no shadowing. The old -azurecluster zone is vestigial — CAPZ marks AzureCluster as externally managed and never uses it.

Backward compatibility: PrivateZoneID is immutable on the HC API (CEL rule: oldSelf == "" || self == oldSelf), so existing clusters keep their -azurecluster zone. Only new clusters get the fixed zone name. The destroy path handles both patterns.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.0.0-0.nightly-2026-08-06-135032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform area/platform/kubevirt PR/issue for KubeVirt (KubevirtPlatform) platform area/platform/none PR/issue for None (NonePlatform) platform - user-supplied infrastructure area/platform/openstack PR/issue for OpenStack (OpenStackPlatform) platform area/platform/powervs PR/issue for PowerVS (PowerVSPlatform) platform jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants