Skip to content

fix: Router advertised-route-priority undefined behavior #11613

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

Conversation

harshithpatte-g
Copy link
Contributor

@harshithpatte-g harshithpatte-g commented Sep 3, 2024

Bug: b/356353797
Issue: advertised-route-priority is an optional field and if not present, the value in the GCP is considered to be 100.
However, TF would set advertised-route-priority to be 0 even if the user has not explicitly set the value to be 0 when there is an update to the resource.

Repro steps:

  1. Create a Router peer resource without advertised route priority value set.
    resource "google_compute_router_peer" "foobar" {
    name = "tf-my-router"
    router = google_compute_router.foobar.name
    region = google_compute_router.foobar.region
    peer_asn = 65515
    interface = google_compute_router_interface.foobar.name
    advertise_mode = "DEFAULT"
    }

Query gcloud to check the value of advertised_route_priority, it will be empty
gcloud compute routers describe {router-name}

  1. Update the router peer resource (ex: enableIpv6 = true) without advertised route priority. However, TF would add advertised route priority = 0 in the update api call.
    resource "google_compute_router_peer" "foobar" {
    name = "tf-my-router"
    router = google_compute_router.foobar.name
    region = google_compute_router.foobar.region
    peer_asn = 65515
    interface = google_compute_router_interface.foobar.name
    advertise_mode = "DEFAULT"
    enable_ipv6 = true
    }

Query gcloud to check the value of advertised_route_priority, it will be 0 even though it is not set by the user.
gcloud compute routers describe {router-name}

Release Note Template for Downstream PRs (will be copied)

compute: fixed a bug where `advertised_route_priority` was accidentally set to 0 during updates in 'google_compute_router_peer'

Copy link

github-actions bot commented Sep 3, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions github-actions bot requested a review from c2thorn September 3, 2024 05:52
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Sep 3, 2024
Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

Does this have an associated Github issue that this closes?

How did you test this change? Can it be written as a new testing or into an existing test?

Are we sure this won't be a breaking change for existing configurations?

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Sep 4, 2024
@harshithpatte-g
Copy link
Contributor Author

Does this have an associated Github issue that this closes?
No, this is a customer issue. I don't see any github issue. It happens only when there is an update to the existing terraform bgp peer resource.
How did you test this change? Can it be written as a new testing or into an existing test?
I tested it manually by doing a gcloud query for the repro steps. We can't write a test or add into an existing test.
Are we sure this won't be a breaking change for existing configurations?
Yes, I have tried different permutations like,
update the existing resources without advertised_route_priority with the fix.
update the existing resources with advertised_route_priority with the fix.
Create a new resource with a fix.
Create a new resource with advertised_route_priority with a fix.
Remove advertised_route_priority from an existing resource with advertised_route_priority
and so on.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 910
Passed tests: 832
Skipped tests: 76
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_withNamePrefix
  • TestAccComputeRouterPeer_advertiseMode

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
TestAccComputeRouterPeer_advertiseMode[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

Copy link
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

Confirming that the contributor has provided manual tests of the changes and walked through the logic. LGTM

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

Successfully merging this pull request may close these issues.

3 participants