Skip to content

CORS-3898: azure: Fix the dualstack errors#10656

Open
rna-afk wants to merge 1 commit into
openshift:mainfrom
rna-afk:azure_dualstack_missing_parts
Open

CORS-3898: azure: Fix the dualstack errors#10656
rna-afk wants to merge 1 commit into
openshift:mainfrom
rna-afk:azure_dualstack_missing_parts

Conversation

@rna-afk

@rna-afk rna-afk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixing a few errors like DNS conflict with ipv4 and ipv6 entry,
setting the right load balancer backend pools and adding a validation
check since serviceNetwork ips need to be ipv4 first irrespective
of ipfamily primary type.

Summary by CodeRabbit

  • New Features

    • Improved dual-stack networking on Azure, with IPv4/IPv6 public IPs provisioned using distinct infrastructure identifiers.
    • Enhanced Azure dual-stack bootstrap NIC configuration to attach IPv6 load balancer backend pools when enabled.
  • Bug Fixes

    • Streamlined dual-stack SSH inbound configuration on Azure by removing the unnecessary outbound IPv6 load balancer update step.
    • Tightened Azure dual-stack validation for networking section ordering, requiring IPv4-first for serviceNetwork on Azure.
  • Tests

    • Added coverage for valid and invalid Azure dual-stack networking scenarios in install configuration validation.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 25, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@rna-afk: This pull request explicitly references no jira issue.

Details

In response to this:

Fixing a few errors like DNS conflict with ipv4 and ipv6 entry, trying to force CCM to use ipv6 primary etc.

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.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Azure dual-stack provisioning now uses separate IPv4 and IPv6 infra IDs, updates the bootstrap NIC for IPv6 backend pools, removes outbound IPv6 load balancer handling, and adds Azure-specific dual-stack install-config ordering validation with new tests.

Changes

Azure dual-stack provisioning

Layer / File(s) Summary
Public IP infra IDs
pkg/infrastructure/azure/azure.go, pkg/infrastructure/azure/network.go
InfraReady now derives separate IPv4 and IPv6 infra IDs, and createPublicIP builds public IP properties before the create-or-update call.
Bootstrap NIC update
pkg/infrastructure/azure/azure.go, pkg/infrastructure/azure/network.go
PostProvision attaches -v6 backend pools to IPv6 private IP configurations on the bootstrap NIC and removes outbound IPv6 load balancer update handling.

Dual-stack validation

Layer / File(s) Summary
Validation rules
pkg/types/validation/installconfig.go, pkg/types/validation/installconfig_test.go
Network-order validation now receives the network section type, enforces IPv4-first Azure service networks, and adds Azure dual-stack test cases with experimental flag setup.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly matches the Azure dual-stack fixes in this change set.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PASS: The added tests use static t.Run names only; I found no Ginkgo titles or dynamic identifiers (IP/timestamp/UUID/etc.) in the changed test code.
Test Structure And Quality ✅ Passed The new Azure cases are small table-driven unit tests, use deferred env cleanup via restoreFnFactory, and don’t create cluster resources or waits; they match existing patterns.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only new test is a plain unit test, so MicroShift API compatibility isn’t implicated.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only modified test file is a standard testing.T unit test with no SNO-sensitive assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR only changes Azure provisioning and install-config validation; no deployment/controller/manifests or scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed No stdout writes appear in process-level code; the only fmt.Println is inside a normal test case setup, not main/init/TestMain/BeforeSuite.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the new test logic is table-driven testing.T unit tests, and I found no public-internet or IPv6-hostport assumptions in added e2e code.
No-Weak-Crypto ✅ Passed Touched Azure and validation code adds networking logic and tests only; scans found no weak ciphers, custom crypto, or non-constant-time secret comparisons.
Container-Privileges ✅ Passed No touched file is a container/K8s manifest, and the modified code adds no privileged, hostNetwork/hostPID/hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed No new logs expose secrets or PII; the Azure changes only log resource IDs/status, and the validation code adds no logging.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci openshift-ci Bot requested review from jhixson74 and sadasu June 25, 2026 03:28
@rna-afk

rna-afk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn-dualstack-ipv6-primary-techpreview

@jhixson74

Copy link
Copy Markdown
Member

/assign

@rna-afk rna-afk force-pushed the azure_dualstack_missing_parts branch from 7271f50 to 2836f66 Compare June 26, 2026 01:50
@rna-afk rna-afk changed the title WIP: no-jira: azure: Fix the dualstack errors CORS-3898: azure: Fix the dualstack errors Jul 6, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@rna-afk: This pull request references CORS-3898 which is a valid jira issue.

Details

In response to this:

Fixing a few errors like DNS conflict with ipv4 and ipv6 entry, trying to force CCM to use ipv6 primary etc.

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.

@rna-afk rna-afk changed the title CORS-3898: azure: Fix the dualstack errors WIP: CORS-3898: azure: Fix the dualstack errors Jul 6, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 6, 2026
@rna-afk rna-afk force-pushed the azure_dualstack_missing_parts branch from 2836f66 to 3fa6c43 Compare July 7, 2026 01:49
@rna-afk rna-afk changed the title WIP: CORS-3898: azure: Fix the dualstack errors CORS-3898: azure: Fix the dualstack errors Jul 7, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2026
@jhixson74

Copy link
Copy Markdown
Member

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhixson74

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2026
@rna-afk

rna-afk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Will wait for #10654 to test this and verify. Works locally.

@rna-afk

rna-afk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn-dualstack-ipv6-primary-techpreview
/test e2e-azure-ovn-dualstack-ipv4-primary-techpreview

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2026
@rna-afk rna-afk force-pushed the azure_dualstack_missing_parts branch from 3fa6c43 to 96877c1 Compare July 8, 2026 17:03
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2026
@rna-afk

rna-afk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn-dualstack-ipv6-primary-techpreview
/test e2e-azure-ovn-dualstack-ipv4-primary-techpreview

Fixing a few errors like DNS conflict with ipv4 and ipv6 entry,
setting the right load balancer backend pools and adding a validation
check since serviceNetwork ips need to be ipv4 first irrespective
of ipfamily primary type.
@rna-afk rna-afk force-pushed the azure_dualstack_missing_parts branch from 96877c1 to 4a196af Compare July 8, 2026 17:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/types/validation/installconfig_test.go (1)

1980-2057: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Missing test coverage for machineNetwork/clusterNetwork ordering under Azure.

These new cases thoroughly cover the serviceNetwork IPv4-first requirement, but none assert what happens to machineNetwork/clusterNetwork ordering when it conflicts with the declared ipFamily (e.g., DualStackIPv4Primary with IPv6-first machineNetwork). Given the behavior gap flagged in pkg/types/validation/installconfig.go (Lines 513-520), an explicit test locking in the current (possibly unintended) behavior would help avoid future regressions either way.

Want me to draft a test case exercising this scenario?

🤖 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 `@pkg/types/validation/installconfig_test.go` around lines 1980 - 2057, Add an
explicit Azure validation test that covers machineNetwork/clusterNetwork
ordering when it conflicts with the configured IP family, using the existing
installConfig validation cases in installconfig_test.go. Reuse the Azure
dual-stack setup from the nearby serviceNetwork tests, but set up a conflicting
IPv6-first machineNetwork or clusterNetwork with DualStackIPv4Primary (or the
reverse) and assert the current expected result. Keep the test alongside the
existing Azure dual-stack cases so the behavior tied to installConfig validation
is locked in by name and scenario.
🤖 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 `@pkg/infrastructure/azure/azure.go`:
- Around line 624-653: The bootstrap IPv6 backend pool association is
incorrectly tied to the PublicAPI-only path, so dual-stack private clusters
never attach the bootstrap NIC’s IPv6 IP configuration to the internal -v6
backend pool. Move the IPv6 NIC update logic around the
bootstrapNicName/nicClient/BeginCreateOrUpdate flow out of the PublicAPI() guard
in the Azure install path so it runs for all dual-stack installs, and keep the
existing IPv6 pool selection by suffix. Add a unit test for the private
dual-stack case to verify the bootstrap NIC is updated with the IPv6 backend
pool attachment.

---

Nitpick comments:
In `@pkg/types/validation/installconfig_test.go`:
- Around line 1980-2057: Add an explicit Azure validation test that covers
machineNetwork/clusterNetwork ordering when it conflicts with the configured IP
family, using the existing installConfig validation cases in
installconfig_test.go. Reuse the Azure dual-stack setup from the nearby
serviceNetwork tests, but set up a conflicting IPv6-first machineNetwork or
clusterNetwork with DualStackIPv4Primary (or the reverse) and assert the current
expected result. Keep the test alongside the existing Azure dual-stack cases so
the behavior tied to installConfig validation is locked in by name and scenario.
🪄 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: 67d62899-17eb-4346-923c-9f252a220f69

📥 Commits

Reviewing files that changed from the base of the PR and between 63f58ef and 4a196af.

📒 Files selected for processing (4)
  • pkg/infrastructure/azure/azure.go
  • pkg/infrastructure/azure/network.go
  • pkg/types/validation/installconfig.go
  • pkg/types/validation/installconfig_test.go

Comment on lines +624 to +653
if in.InstallConfig.Config.Azure.IPFamily.DualStackEnabled() {
bootstrapNicName := fmt.Sprintf("%s-bootstrap-nic", in.InfraID)
nicClient := p.NetworkClientFactory.NewInterfacesClient()
bootstrapNic, err := nicClient.Get(ctx, p.ResourceGroupName, bootstrapNicName, nil)
if err != nil {
return fmt.Errorf("failed to get bootstrap nic: %w", err)
}
for _, ipconfig := range bootstrapNic.Properties.IPConfigurations {
if ipconfig.Properties.PrivateIPAddressVersion != nil && *ipconfig.Properties.PrivateIPAddressVersion == armnetwork.IPVersionIPv6 {
for _, pool := range p.lbBackendAddressPools {
if pool.Name != nil && strings.HasSuffix(*pool.Name, "-v6") {
ipconfig.Properties.LoadBalancerBackendAddressPools = append(
ipconfig.Properties.LoadBalancerBackendAddressPools,
pool,
)
}
}
}
}
pollerResp, err := nicClient.BeginCreateOrUpdate(ctx, p.ResourceGroupName, bootstrapNicName, bootstrapNic.Interface, nil)
if err != nil {
return fmt.Errorf("failed to update bootstrap nic with IPv6 backend pools: %w", err)
}
_, err = pollerResp.PollUntilDone(ctx, nil)
if err != nil {
return fmt.Errorf("failed to update bootstrap nic with IPv6 backend pools: %w", err)
}
logrus.Debugf("associated bootstrap NIC with IPv6 backend pools")
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Don’t gate bootstrap IPv6 pool association on PublicAPI().

Line 624 is inside the Line 600 public-API branch, but the internal IPv6 load balancer frontend/rule is created for every Azure dual-stack install at Lines 570-579. Private dual-stack clusters will skip attaching the bootstrap IPv6 IP config to the internal -v6 backend pool. Move this block outside the PublicAPI() guard and cover the private dual-stack path with a unit test. As per coding guidelines, “All code under ./cmd/..., ./data/..., and ./pkg/... must have unit tests”.

🤖 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 `@pkg/infrastructure/azure/azure.go` around lines 624 - 653, The bootstrap IPv6
backend pool association is incorrectly tied to the PublicAPI-only path, so
dual-stack private clusters never attach the bootstrap NIC’s IPv6 IP
configuration to the internal -v6 backend pool. Move the IPv6 NIC update logic
around the bootstrapNicName/nicClient/BeginCreateOrUpdate flow out of the
PublicAPI() guard in the Azure install path so it runs for all dual-stack
installs, and keep the existing IPv6 pool selection by suffix. Add a unit test
for the private dual-stack case to verify the bootstrap NIC is updated with the
IPv6 backend pool attachment.

Source: Coding guidelines

@rna-afk

rna-afk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn-dualstack-ipv6-primary-techpreview

@rna-afk

rna-afk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-azure-ovn-dualstack-ipv4-primary-techpreview

@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@rna-afk: 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-ovn-shared-vpc 3fa6c43 link false /test e2e-azure-ovn-shared-vpc
ci/prow/e2e-azurestack 3fa6c43 link false /test e2e-azurestack
ci/prow/e2e-aws-ovn 3fa6c43 link true /test e2e-aws-ovn
ci/prow/e2e-azure-ovn-dualstack-ipv4-primary-techpreview 4a196af link false /test e2e-azure-ovn-dualstack-ipv4-primary-techpreview
ci/prow/azure-ovn-marketplace-images 4a196af link false /test azure-ovn-marketplace-images
ci/prow/e2e-azure-ovn-dualstack-ipv6-primary-techpreview 4a196af link false /test e2e-azure-ovn-dualstack-ipv6-primary-techpreview

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.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants