Skip to content

fix: use snake_case in gateway update encoder for routing_mode - #18642

Open
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:fix-gateway-routing-mode-encoder
Open

fix: use snake_case in gateway update encoder for routing_mode#18642
vr-ibm wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:fix-gateway-routing-mode-encoder

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Fixes hashicorp/terraform-provider-google#27893

Fixes d.Get("routingMode")d.Get("routing_mode") in the Gateway update encoder template. The camelCase key returns nil from Terraform's schema, which overwrites the correctly-built value and silently drops routing_mode updates for SECURE_WEB_GATEWAY resources.

Details

  • Fixes snake_case typo in mmv1/templates/terraform/update_encoder/network_services_gateway.go.tmpl
  • d.Get("routingMode")d.Get("routing_mode") so the field value is correctly force-sent on update

Release Note Template for Downstream PRs (will be copied)

networkservices: fixed `google_network_services_gateway` `routing_mode` updates being silently dropped for SECURE_WEB_GATEWAY type

The update encoder was using d.Get("routingMode") (camelCase) which
returns nil from Terraform's schema. This overwrites the correctly-built
routingMode value with nil, so the API never receives routing_mode
updates for SECURE_WEB_GATEWAY resources.

Fixes hashicorp/terraform-provider-google#27893
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/networkservices-traffic-director and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 13, 2026
@modular-magician

modular-magician commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 1 insertion(+), 1 deletion(-)
google-beta provider View Diff 1 file changed, 1 insertion(+), 1 deletion(-)

Test report

Analytics

Total Tests Passed Skipped Affected
102 98 2 2
Affected Service Packages
  • networkservices

Learn how VCR tests work


Step 1: Replaying Mode

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
  • TestAccNetworkServicesGateway_swpListenAllPorts
  • TestAccNetworkServicesGateway_swpUpdate

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccNetworkServicesGateway_swpListenAllPorts
❌ Error · Log - TestAccNetworkServicesGateway_swpUpdate

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@vr-ibm VCR tests complete for c68121e!

d.Get("routing_mode") returns "" when unset, which the API rejects
as an invalid enum. Only force-send when the field has a value.
@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Aug 14, 2026
@modular-magician

modular-magician commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 1 file changed, 3 insertions(+), 1 deletion(-)
google-beta provider View Diff 1 file changed, 3 insertions(+), 1 deletion(-)

Test report

Analytics

Total Tests Passed Skipped Affected
102 99 2 1
Affected Service Packages
  • networkservices

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccNetworkServicesGateway_swpUpdate

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccNetworkServicesGateway_swpUpdate

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@vr-ibm VCR tests complete for c63f3eb!

@vr-ibm
vr-ibm marked this pull request as ready for review August 14, 2026 19:56
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.

google_network_services_gateway: routing_mode updates silently dropped for SECURE_WEB_GATEWAY due to snake_case typo in update encoder

2 participants