[release-4.21] OCPBUGS-93927: fix(cpo): deduplicate VPC endpoint subnets by AZ to prevent DuplicateSubnetsInSameZone - #8862
Conversation
…SubnetsInSameZone When multiple NodePools reference subnets in the same AWS availability zone, the VPC endpoint reconciler now deduplicates them before calling CreateVpcEndpoint or ModifyVpcEndpoint. This prevents the AWS DuplicateSubnetsInSameZone error that blocks endpoint reconciliation. The fix uses an in-memory cache (sync.RWMutex + map) to avoid repeated DescribeSubnets calls. If DescribeSubnets fails (e.g., missing IAM permission), the original subnet list is used unchanged, preserving existing behavior. Also adds ec2:DescribeSubnets to the control-plane-operator and shared-vpc-endpoint IAM policies. Closes: OCPBUGS-93927 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@reedcort: This pull request references Jira Issue OCPBUGS-93927, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/jira refresh |
|
@reedcort: This pull request references Jira Issue OCPBUGS-93927, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
/jira refresh |
|
@reedcort: This pull request references Jira Issue OCPBUGS-93927, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
DetailsIn response to this:
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. |
|
/area control-plane-operator |
|
/test e2e-aws-upgrade-hypershift-operator |
1 similar comment
|
/test e2e-aws-upgrade-hypershift-operator |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: csrwng, reedcort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Test EvidenceTested on a ROSA HCP 4.21 staging cluster with two subnets in the same AZ ( CPO image overridden with CI build from this PR ( Before — graceful degradation without
|
|
@reedcort: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/lgtm |
|
Scheduling required tests: |
|
/test e2e-aks |
1 similar comment
|
/test e2e-aks |
|
/retest |
|
/test e2e-aks |
|
/test e2e-aks |
|
/test e2e-aws |
|
/override e2e-aks |
|
@reedcort: reedcort unauthorized: /override is restricted to Repo administrators, approvers in top level OWNERS file, and the following github teams:openshift: openshift-release-oversight openshift-staff-engineers openshift-sustaining-engineers. DetailsIn response to this:
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. |
|
/test e2e-aks |
|
/test e2e-aws |
|
/retest-required |
|
/hold Revision 7973b82 was retested 3 times: holding |
|
/retest-required |
2 similar comments
|
/retest-required |
|
/retest-required |
|
/test e2e-aks |
1 similar comment
|
/test e2e-aks |
|
@reedcort: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/hold cancel |
85ac58c
into
openshift:release-4.21
|
@reedcort: Jira Issue Verification Checks: Jira Issue OCPBUGS-93927 Jira Issue OCPBUGS-93927 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn response to this:
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. |
|
Fix included in release 4.21.0-0.nightly-2026-07-13-235512 |

What this PR does / why we need it:
Backport of #8651 to
release-4.21.When multiple NodePools reference subnets in the same AWS availability zone, the CPO's VPC endpoint reconciler now deduplicates them before calling
CreateVpcEndpointorModifyVpcEndpoint, preventing the AWSDuplicateSubnetsInSameZoneerror.sync.RWMutex+ map) to theAWSEndpointServiceReconcilerto avoid repeatedDescribeSubnetscallsDescribeSubnetsfails (e.g. missing IAM permission), the original subnet list passes through unchangedec2:DescribeSubnetsto the control-plane-operator and shared-vpc-endpoint IAM policiesWhich issue(s) this PR fixes:
Fixes https://issues.redhat.com/browse/OCPBUGS-93927
Special notes for your reviewer:
Adapted from the 4.22 backport (#8724) for AWS SDK v1 (
aws-sdk-go) used on release-4.21. The logic is identical; only the AWS API call patterns differ (DescribeSubnetsWithContext,aws.StringValue,ec2iface.EC2API).Checklist:
🤖 Generated with Claude Code