-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Secure Web Proxy fields gatewaySecurityPolicy and certificateUrls supports updates. #10549
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0ed869b
SWP fields not immutable
Samir-Cit 6920f0f
pre_update with mandatory fields. test working
Samir-Cit 551ec18
Merge remote-tracking branch 'origin' into fix/swp-fields
Samir-Cit ec3e1ec
Fix test
Samir-Cit 0c462d3
Fix end of line
Samir-Cit 7a42ea5
Merge remote-tracking branch 'origin/main' into fix/swp-fields
Samir-Cit 00cef59
Change back beta to v1
Samir-Cit 3be7686
Merge remote-tracking branch 'origin/main' into fix/swp-fields
Samir-Cit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
mmv1/templates/terraform/pre_update/network_services_gateway.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if d.Get("type") == "SECURE_WEB_GATEWAY" { | ||
obj["name"] = d.Get("name") | ||
obj["type"] = d.Get("type") | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what this is doing and why it was added? From what I can tell, it was previously possible for a user to have a
google_network_services_gateway
withtype = "SECURE_WEB_GATEWAY"
, and then change a field likeserver_tls_policy
ordescription
, which would trigger this condition, and presumably produce different results than before. Why do these 2 fields need to be set, and what happened before when they weren't set?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just double checking with a terraform code using the actual provider and when trying to update the description of
google_network_services_gateway
withtype = SECURE_WEB_GATEWAY
it throw the following error:Error: Error waiting for Updating Gateway: Error code 13, message: an internal error has occurred
The update send the name, the ID and the updated description fields only:
When updating through GCP console, the request sends all the fields that the Gateway contains:
Also, GCP Console uses API v1beta1
To update using the API Explorer first I used all fields and then I was removing one by one to check which fields are required and those 2 (
name
andtype
) were required to update the Gateway through API ExplorerConclusion: Since GCP Console sends all fields it's able to update the gateway. So this modification that I did will send the required fields (name and type) to be able to update as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok, that's interesting behavior, but seems to match your logic. I suppose it's safer to stick with the condition you've included, but I do wonder if it might be cleaner to always include name and type in the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I did that... But if the
type
is other thanSECURE_WEB_GATEWAY
the request fail.That broke some tests when I was starting the development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roaks3 regarding the fields description, it's still tracked on our radar but it was was deprioritized together with ngprabhu@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for those answers!