Skip to content
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

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

Conversation

modular-magician
Copy link
Collaborator

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'

Derived from GoogleCloudPlatform/magic-modules#11613

[upstream:293c3ca1b6f2de4ce5d731aa8f0c3a65969cc9ac]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 101885c into hashicorp:main Sep 4, 2024
4 checks passed
@modular-magician modular-magician deleted the downstream-pr-293c3ca1b6f2de4ce5d731aa8f0c3a65969cc9ac branch November 16, 2024 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant