ComputeRoute: Fix network and next_hop_gateway diff discrepancies between tf and direct controllers - #13631
ComputeRoute: Fix network and next_hop_gateway diff discrepancies between tf and direct controllers#13631ada-coder-bot wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
Canonicalize network and next_hop_gateway URL prefixes, schemes, and short-name representations in compareComputeRoute to eliminate diff discrepancies between the Terraform and direct controllers. Issue: 13581
73ef20b to
e22a914
Compare
Investigating unit-tests-2-of-4 failureRun: 36949117538 Investigating tests-e2e-fixtures-compute failureRun: 36949117538 (This report was generated by overseer) |
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
2 similar comments
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
|
🤖 AI Factory started investigating CI check failures for this pull request. Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored. |
|
🤖 AI Factory has attempted to investigate/fix CI check failures for this pull request 3 times since the last commit or update without success. To prevent infinite loops, I am pausing automated investigation and attaching the To request another attempt or resume automated processing, please remove the |
Description
This PR fixes diff discrepancies between the
tf(Terraform) anddirectcontrollers forComputeRoute(compute.cnrm.cloud.google.com/v1beta1).Root Cause
During reconciliation and direct takeover,
compareComputeRoutedirectly compared proto fields without normalizing URL prefixes or canonicalizing relative vs. short-name gateway and network references:network: GCP API returns a full URL (https://www.googleapis.com/compute/v1/projects/...), whereas normalized KRM references use relative resource paths (projects/...).next_hop_gateway: GCP API returns a full URL (https://.../global/gateways/default-internet-gateway), whereas KRM spec may specifydefault-internet-gatewayorglobal/gateways/default-internet-gateway.Because
ComputeRouteis immutable in GCP, these field diffs caused false updates that failed reconciliation.Summary of Changes
canonicalizeComputeNetworkandcanonicalizeNextHopGatewayhelpers inpkg/controller/direct/compute/computeroute_controller.goto normalize URL prefixes and short names to canonical relative paths before comparison.canonicalizeComputeURLtoNextHopIlb,NextHopInstance, andNextHopVpnTunnel.ComputeRouteIdentityintocompareComputeRouteto resolve project ID context for short-name expansion.mockgcp/mockcompute/routesv1.goto normalizeNextHopGatewayto full selfLink on insert, matching real GCP API behavior.TestCompareComputeRouteinpkg/controller/direct/compute/computeroute_controller_test.gocovering full URLs, relative paths, short names, priority defaults, and true diff detection.computeroutegatewayE2E test fixture and recorded clean migration golden outputs with zero diffs in_migration_diffs.json.Fixes #13581
This PR was generated by the overseer,priority/high agent (powered by the gemini-3.7-flash model).