-
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
Zero out upload url before update #4292
Zero out upload url before update #4292
Conversation
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=161965" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceComposerEnvironment_basic|TestAccDataSourceSpannerInstance_basic|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccBigqueryDataTransferConfig|TestAccCloudSchedulerJob_schedulerJobHttpExample|TestAccComposerEnvironment_withUpdateOnCreate|TestAccFilestoreInstance_filestoreInstanceBasicExample|TestAccFilestoreInstance_update|TestAccOSLoginSSHPublicKey_osLoginSshKeyExpiry You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=162049" |
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.
Is there a use case we need to support that requires SourceUploadUrl?
i.e. it looks like source_archive_* and source_repository are both optional (though they conflict.) Could a user reasonably create a cloudfunctions function with neither one set and expect it to use the source they uploaded, instead?
Would it be at all possible to make sure there's a test that covers this use case? It's sort of a weird situation...
I believe that either of This is only enforced on create, but I believe it makes sense for Terraform to effectively require one of those. I think that the behavior on import for unsupported fields on resources is somewhat undefined. For fields that are marked as We could theoretically support SourceUploadUrl via https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions/generateUploadUrl but it looks like more trouble than it would be worth when the combination of bucket+object handles the .zip file use case. I don't believe it's possible to write a test for this use case using Terraform. It may be possible using a local exec provider that would call gcloud directly to create the resource to be imported, but shelling out to other tools is troublesome |
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 sorry for the delay on this review; this slipped through the cracks somehow. I generally try to respond within 24 hours - feel free to ping me any time but especially past that point!
LGTM
Fixes: hashicorp/terraform-provider-google#7921
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)