-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cross-regional Internal HTTPS Load Balancer Certificate Manager validation #8941
Cross-regional Internal HTTPS Load Balancer Certificate Manager validation #8941
Conversation
Hello! I am a robot. It looks like you are a: Community Contributor @rileykarson, 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. |
I do want to tag @shuyama1 here as the ticket got assigned to you and I am unsure if work has already been done on this. |
@DanielRieske Thanks for looking into the issue and making a fix for it. It does look like we have this field implemented as a @rileykarson Is this change considered as a change of field type (breaking change) and we need to get this into major release? |
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. Terraform GA: Diff ( 5 files changed, 205 insertions(+), 20 deletions(-)) |
This is probably a case where we want to maintain full compatibility with the current possible inputs (mainly shortname) & allow specifying the new target type through the resource name ( Rather than validation we're dropping diff suppression and value transformation with this change. |
Tests analyticsTotal tests: Action takenFound 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccComputeTargetHttpsProxy_update|TestAccComputeManagedSslCertificate_managedSslCertificateBasicExample|TestAccComputeTargetHttpsProxy_targetHttpsProxyHttpKeepAliveTimeoutExample|TestAccComputeTargetHttpsProxy_targetHttpsProxyGlobalCertificateManagerExample|TestAccComputeTargetHttpsProxy_targetHttpsProxyBasicExample|TestAccGKEHub2Scope_gkehubScopeBasicExample|TestAccGKEHub2ScopeIamBindingGenerated|TestAccGKEHub2ScopeIamMemberGenerated|TestAccGKEHub2ScopeIamPolicyGenerated |
Rerun these tests in REPLAYING mode to catch issues
|
With the given feedback, I removed the custom validator. With this change users can use this field as they have been but it won't force it to the resourceRef for the This should allow for full-compatibility and not introduce a breaking change, I believe to have covered all bases here if I missed something let me know. |
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. Terraform GA: Diff ( 5 files changed, 198 insertions(+), 5 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccComputeTargetHttpsProxy_update|TestAccDataSourceGoogleServiceAccountJwt |
Rerun these tests in REPLAYING mode to catch issues
|
I don't think the integration tests failing is related to this PR, could you share the logs if it is? |
@@ -115,7 +124,6 @@ properties: | |||
resource: 'SslCertificate' |
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.
ResourceRef
currently means that there's a single target type within the same service- we should revert this to a string. That will probably change the DiffSuppressFunc attached to the schema. We'll want to re-add that DSF by referencing it as a diff_suppress_func
.
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 am wondering whether this is neccesary, if I revert it to a string that will mean that our custom expander that depends on it being a ResourceRef
to pull the base_url
to create the full resource reference will have to change too.
resource_type = property.resource_ref.base_url.split('/').last
tpgresource.ParseGlobalFieldValue("<%= resource_type -%>", <%= var_name -%>, "project", d, config, true)
Hey @DanielRieske
That behaviour is consistent with the I would suggest we don't merge this change currently, until we check with Maybe also @rileykarson can suggest which solution is preferred in that case |
Sorry, I've been pretty delayed in reviews. Checking in with that team seems reasonable. I did not put two and two together that the internal question I answered and this PR were about the same field, good catch @Hamzawy63! |
Hey @rileykarson @DanielRieske I'm aware that the resource definition should be consistent with API rather than any other tools (e.g. gcloud).
That being said, If the other proposed solution might introduce long term issues or it's better (from TF perspective) to keep the API consistency, then we go with this solution. |
Oh, interesting, I'd assumed they could be mixed! I think the separate fields make enough sense to deviate from the API. That gets rid of the problem of identifying resource kinds when we've already allowed the short form (name) here, since the resource kind will be implied by the list you're adding the resource to.
I'd lean against doing that unless the API allows it (which is unlikely given that multiple kinds can be sent in the field). We generally support doing so because the GCE API did/does, and have maintained backwards compatibility. Newer resources generally require full ids. We made those values trivially available in Terraform through the |
I think that means we can close this PR to supersede it with #9144. That OK with you @DanielRieske? |
Absolutely, I also assumed they could be mixed. In this case it makes more sense to go with @Hamzawy63 solution. |
The resource
google_compute_target_https_proxy
can reference from thesslCertificates
attribute from two different sources.Primarly you reference compute SSL certifications but in certain edge cases the API also accepts a reference to a certificate in a certificate manager.
In it's current implementation we only accept a resource link from
sslCertificate
which should be removed to allow references to a certificate in a certificate manager.See: hashicorp/terraform-provider-google#15805 (comment)
Closes: hashicorp/terraform-provider-google#15805
Release Note Template for Downstream PRs (will be copied)