fix: Router advertised-route-priority undefined behavior #19366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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}
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)
Derived from GoogleCloudPlatform/magic-modules#11613