-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix an issue which cause failure when updating a sub-CA #12495
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
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @ScottSuarez, 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. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 40 Click here to see the affected service packages
🔴 Tests were added that are skipped in VCR:
View the build log |
// directly by older version of providers. | ||
// For backward compatibility, delete `certificateAuthority` only if `pemIssuerChain` is presented. | ||
if _, ok := subConfig["pemIssuerChain"]; ok { | ||
delete(subConfig, "certificateAuthority") |
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'm worried about API state here.
We are explicitly removing certificateAuthority
from the API request then it is possible API state will no longer retain subordinateConfig.certificateAuthority
while the users config will. Resulting in a diff.
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.
certificateAuthority
was not be sent to API backend. It was only used to fetch pemIssuerChain
which is the value specified when calling backend.
With that, certificateAuthority
only stay locally.
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.
API does retain this value
https://cloud.google.com/certificate-authority-service/docs/reference/rest/v1/projects.locations.caPools.certificateAuthorities#SubordinateConfig
and we do read it from the API. https://github.com/modular-magician/terraform-provider-google-beta/blob/8205ebe14bc69d903151fea9c192ddfb56c6b43a/google-beta/services/privateca/resource_privateca_certificate_authority.go#L1091
Just because the API isn't using the value doesn't mean it doesn't retain a state for it. This call will cause a diff between API state and users config.
I also left a comment on the bug. I am not sure why API is not respecting updateMask here |
See b/382313978 for details
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.