Skip to content
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

Fix TestAccStorageSignedUrl_accTest #5200

Merged

Conversation

upodroid
Copy link
Contributor

Fix: hashicorp/terraform-provider-google#9990

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)


@google-cla google-cla bot added the cla: yes label Sep 14, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@melinath, please review this PR or find an appropriate assignee.

@upodroid
Copy link
Contributor Author

I removed the header because:

  • generation is serverside value, metageneration isn't but it is designed for metadata instead of the object
  • not sure why this header is being tested.

https://cloud.google.com/storage/docs/json_api/v1/objects#resource
https://cloud.google.com/storage/docs/xml-api/reference-headers#xgoogifgenerationmatch

TestAccStorageSignedUrl_accTest Test Run
==> Checking source code against gofmt...
==> Checking that code complies with gofmt requirements...
go generate  ./...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google -v -run=TestAccStorageSignedUrl_accTest -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccStorageSignedUrl_accTest
=== PAUSE TestAccStorageSignedUrl_accTest
=== CONT  TestAccStorageSignedUrl_accTest
2021/09/14 21:17:40 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:40 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:40 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:40 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:40 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:17:41 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:17:44 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:44 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:44 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:44 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:44 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:17:44 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:17:48 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:48 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:48 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:48 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:48 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:17:48 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:17:48 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:17:48 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:17:48 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:17:48 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:17:48 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /storage/v1/b?alt=json&prettyPrint=false&project=REDACTED HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
Content-Length: 178
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip

{
 "iamConfiguration": {
  "uniformBucketLevelAccess": {
   "enabled": false
  }
 },
 "lifecycle": {
  "rule": []
 },
 "location": "US",
 "name": "tf-test-bucket-2027338368125175627",
 "storageClass": "STANDARD"
}

-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 557
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:17:50 GMT
Etag: CAE=
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdsxLg4rqOHMYaPCV6QkS1EYBgPgwv03fUsWjh6ZIB5uCaLNepZZzHCCFKDEM4AM1DmXnd5RJpCONdJ5MOPtv8FJZUo78g

{
 "kind": "storage#bucket",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627",
 "id": "tf-test-bucket-2027338368125175627",
 "name": "tf-test-bucket-2027338368125175627",
 "projectNumber": "550924169191",
 "metageneration": "1",
 "location": "US",
 "storageClass": "STANDARD",
 "etag": "CAE=",
 "timeCreated": "2021-09-14T20:17:50.191Z",
 "updated": "2021-09-14T20:17:50.191Z",
 "iamConfiguration": {
  "bucketPolicyOnly": {
   "enabled": false
  },
  "uniformBucketLevelAccess": {
   "enabled": false
  },
  "publicAccessPrevention": "unspecified"
 },
 "locationType": "multi-region"
}
-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:17:50 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:17:50 [DEBUG] Created bucket tf-test-bucket-2027338368125175627 at location https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627

2021/09/14 21:17:50 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:17:50 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:17:50 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:17:50 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /storage/v1/b/tf-test-bucket-2027338368125175627?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 557
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:17:50 GMT
Etag: CAE=
Expires: Tue, 14 Sep 2021 20:17:50 GMT
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdtC5dsYNlZjJcLOhnNQCLTOkZnVh4UTjgCt1BCO1AN0FPRn4G86T1NhwAsAYqGZbsKo0VGvcCJgpFw4BCMC_H8

{
 "kind": "storage#bucket",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627",
 "id": "tf-test-bucket-2027338368125175627",
 "name": "tf-test-bucket-2027338368125175627",
 "projectNumber": "550924169191",
 "metageneration": "1",
 "location": "US",
 "storageClass": "STANDARD",
 "etag": "CAE=",
 "timeCreated": "2021-09-14T20:17:50.191Z",
 "updated": "2021-09-14T20:17:50.191Z",
 "iamConfiguration": {
  "bucketPolicyOnly": {
   "enabled": false
  },
  "uniformBucketLevelAccess": {
   "enabled": false
  },
  "publicAccessPrevention": "unspecified"
 },
 "locationType": "multi-region"
}
-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:17:50 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:17:50 [DEBUG] Read bucket tf-test-bucket-2027338368125175627 at location https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627

2021/09/14 21:17:50 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:17:50 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:17:50 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:17:50 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /upload/storage/v1/b/tf-test-bucket-2027338368125175627/o?alt=json&name=path%2Fto%2Ffile&prettyPrint=false&uploadType=multipart HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
Transfer-Encoding: chunked
Content-Type: multipart/related; boundary=aae19ad2ca447b83095858921cbfddc2436c64f6c0a474a804b4297585bb
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip

156
--aae19ad2ca447b83095858921cbfddc2436c64f6c0a474a804b4297585bb
Content-Type: application/json

{
 "bucket": "tf-test-bucket-2027338368125175627"
}

--aae19ad2ca447b83095858921cbfddc2436c64f6c0a474a804b4297585bb
Content-Type: text/plain; charset=utf-8

once upon a time...
--aae19ad2ca447b83095858921cbfddc2436c64f6c0a474a804b4297585bb--

0


-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 778
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:17:50 GMT
Etag: CJ3W+7Sk//ICEAE=
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdubLwX77Q4ePR6v7Uu3adCzYj1Jd6q4j1LtjNdBzxqjNbm1fZX37fZqEUIxWsKDci-9PasIbAswUwz67UFF1kyi4F5uLQ

{
 "kind": "storage#object",
 "id": "tf-test-bucket-2027338368125175627/path/to/file/1631650670635805",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile",
 "mediaLink": "https://storage.googleapis.com/download/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?generation=1631650670635805&alt=media",
 "name": "path/to/file",
 "bucket": "tf-test-bucket-2027338368125175627",
 "generation": "1631650670635805",
 "metageneration": "1",
 "contentType": "text/plain; charset=utf-8",
 "storageClass": "STANDARD",
 "size": "19",
 "md5Hash": "pRviqwS4c4OTJRTe03FD1w==",
 "crc32c": "Jxqjbw==",
 "etag": "CJ3W+7Sk//ICEAE=",
 "timeCreated": "2021-09-14T20:17:50.664Z",
 "updated": "2021-09-14T20:17:50.664Z",
 "timeStorageClassUpdated": "2021-09-14T20:17:50.664Z"
}
-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:17:50 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:17:50 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:17:50 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:17:50 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:17:50 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 778
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:17:50 GMT
Etag: CJ3W+7Sk//ICEAE=
Expires: Tue, 14 Sep 2021 20:17:50 GMT
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdvBXWPU7pucQK-5DtKCm3hceu63s97b2tTQZ5kEY9Y5PEGmFAQnfMlf6Xcyhdtbr0pe3gIFPy16EYsWwu3I8DE

{
 "kind": "storage#object",
 "id": "tf-test-bucket-2027338368125175627/path/to/file/1631650670635805",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile",
 "mediaLink": "https://storage.googleapis.com/download/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?generation=1631650670635805&alt=media",
 "name": "path/to/file",
 "bucket": "tf-test-bucket-2027338368125175627",
 "generation": "1631650670635805",
 "metageneration": "1",
 "contentType": "text/plain; charset=utf-8",
 "storageClass": "STANDARD",
 "size": "19",
 "md5Hash": "pRviqwS4c4OTJRTe03FD1w==",
 "crc32c": "Jxqjbw==",
 "etag": "CJ3W+7Sk//ICEAE=",
 "timeCreated": "2021-09-14T20:17:50.664Z",
 "updated": "2021-09-14T20:17:50.664Z",
 "timeStorageClassUpdated": "2021-09-14T20:17:50.664Z"
}
-----------------------------------------------------
2021/09/14 21:17:50 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:17:50 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:17:50 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:50 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:50 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:50 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:57 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:57 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:57 [INFO] Authenticating using DefaultClient...
2021/09/14 21:17:57 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:17:57 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:17:57 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:17:57 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:57 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:57 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:17:57 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:01 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:01 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:01 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:01 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:01 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:18:01 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:18:01 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:18:01 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:18:01 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:18:01 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /storage/v1/b/tf-test-bucket-2027338368125175627?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:18:02 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 557
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:18:02 GMT
Etag: CAE=
Expires: Tue, 14 Sep 2021 20:18:02 GMT
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdtWUYS5miUYpBHjmJUsuCHemDSt6t1Dl8R3RlREZqoPPoqZ6Na5s0wpQKS0EKIzB4sgwPGVtneHfZCaNqwsob_ejXl1fQ

{
 "kind": "storage#bucket",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627",
 "id": "tf-test-bucket-2027338368125175627",
 "name": "tf-test-bucket-2027338368125175627",
 "projectNumber": "550924169191",
 "metageneration": "1",
 "location": "US",
 "storageClass": "STANDARD",
 "etag": "CAE=",
 "timeCreated": "2021-09-14T20:17:50.191Z",
 "updated": "2021-09-14T20:17:50.191Z",
 "iamConfiguration": {
  "bucketPolicyOnly": {
   "enabled": false
  },
  "uniformBucketLevelAccess": {
   "enabled": false
  },
  "publicAccessPrevention": "unspecified"
 },
 "locationType": "multi-region"
}
-----------------------------------------------------
2021/09/14 21:18:02 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:18:02 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:18:02 [DEBUG] Read bucket tf-test-bucket-2027338368125175627 at location https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627

2021/09/14 21:18:02 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:18:02 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:18:02 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:18:02 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:18:02 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 778
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:18:02 GMT
Etag: CJ3W+7Sk//ICEAE=
Expires: Tue, 14 Sep 2021 20:18:02 GMT
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdt1plsiGFt_CPmXvCZgA84_DupA5UFF95K_r3mT2UVrqEbkVjAxN-IWxJJn_k1zBpj_EgjZh9vJXqKTaf0vqAoA4-P5CQ

{
 "kind": "storage#object",
 "id": "tf-test-bucket-2027338368125175627/path/to/file/1631650670635805",
 "selfLink": "https://www.googleapis.com/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile",
 "mediaLink": "https://storage.googleapis.com/download/storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?generation=1631650670635805&alt=media",
 "name": "path/to/file",
 "bucket": "tf-test-bucket-2027338368125175627",
 "generation": "1631650670635805",
 "metageneration": "1",
 "contentType": "text/plain; charset=utf-8",
 "storageClass": "STANDARD",
 "size": "19",
 "md5Hash": "pRviqwS4c4OTJRTe03FD1w==",
 "crc32c": "Jxqjbw==",
 "etag": "CJ3W+7Sk//ICEAE=",
 "timeCreated": "2021-09-14T20:17:50.664Z",
 "updated": "2021-09-14T20:17:50.664Z",
 "timeStorageClassUpdated": "2021-09-14T20:17:50.664Z"
}
-----------------------------------------------------
2021/09/14 21:18:02 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:18:02 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:18:02 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:02 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:02 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:02 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:04 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:04 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:04 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:04 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:04 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:18:04 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:18:04 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:04 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:04 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:04 [DEBUG] using env GOOGLE_APPLICATION_CREDENTIALS credentials to sign URL
2021/09/14 21:18:12 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:12 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:12 [INFO] Authenticating using DefaultClient...
2021/09/14 21:18:12 [INFO]   -- Scopes: [https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-identity https://www.googleapis.com/auth/ndev.clouddns.readwrite https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email]
2021/09/14 21:18:12 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:18:12 [INFO] Terraform is using this identity: [email protected]
2021/09/14 21:18:12 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:18:12 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:18:12 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:18:12 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
DELETE /storage/v1/b/tf-test-bucket-2027338368125175627/o/path%2Fto%2Ffile?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 204 No Content
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Tue, 14 Sep 2021 20:18:13 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdsCjYUD-46IayY5Pmut6cUutb3LebX_T4i5qS-BhT245umv4Agr6R6zpKxyUr3KEcvKq-lu3oPYqUuZrlqrHA


-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:18:13 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:18:13 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:18:13 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:18:13 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:18:13 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /storage/v1/b/tf-test-bucket-2027338368125175627/o?alt=json&prettyPrint=false&versions=true HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 26
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0, must-revalidate, no-transform
Content-Type: application/json; charset=UTF-8
Date: Tue, 14 Sep 2021 20:18:13 GMT
Expires: Tue, 14 Sep 2021 20:18:13 GMT
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycduuK7oYGeeDoL5UDThDIFzR7l5zucNo653xeUjPl6MTuVf0tI8C-cQViHM0GjN2D2vD_7M3bBLKxyDBKiTgQg

{
 "kind": "storage#objects"
}
-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:18:13 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:18:13 [DEBUG] Waiting for state to become: [success]
2021/09/14 21:18:13 [INFO] Instantiating Google Storage client for path https://storage.googleapis.com/storage/v1/
2021/09/14 21:18:13 [DEBUG] Retry Transport: starting RoundTrip retry loop
2021/09/14 21:18:13 [DEBUG] Retry Transport: request attempt 0
2021/09/14 21:18:13 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
DELETE /storage/v1/b/tf-test-bucket-2027338368125175627?alt=json&prettyPrint=false HTTP/1.1
Host: storage.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/0.14.11 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/acc
X-Goog-Api-Client: gl-go/1.16.5 gdcl/20210606
Accept-Encoding: gzip


-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 204 No Content
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Tue, 14 Sep 2021 20:18:13 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: UploadServer
Vary: Origin
Vary: X-Origin
X-Guploader-Uploadid: ADPycdskKRUBIsidGzNi0sV0nnC9U1gkCFrGxP7QuNElETisyTamln1wZ1gh9hjJpa4ZSfD3_BOcvsjL1MbWnZjRWSU


-----------------------------------------------------
2021/09/14 21:18:13 [DEBUG] Retry Transport: Stopping retries, last request was successful
2021/09/14 21:18:13 [DEBUG] Retry Transport: Returning after 1 attempts
2021/09/14 21:18:13 [DEBUG] Deleted bucket tf-test-bucket-2027338368125175627

--- PASS: TestAccStorageSignedUrl_accTest (42.34s)
PASS
ok  	github.com/hashicorp/terraform-provider-google/google	(cached)

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 1 insertion(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 2 insertions(+), 5 deletions(-))

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this looks like it probably never should have been passing, since the generation is server-generated. Maybe the API finally started validating this? Or maybe x-goog-test used to cause the generation to be 1 and no longer does?

I think there is value to making sure that the datasource is correctly passing headers to the API... but I don't think this test ever did that. Even if we were able to get the correct generation, that wouldn't prove that we were passing headers in, since we would get a successful result regardless of whether the header was getting passed.

Really, we should probably be testing that if we pass a generation match header that is incorrect (like, say, 1) we get a precondition failed error. That would let us verify that we're actually passing the headers correctly. Would you be down to switch the test around to check that instead?

@upodroid
Copy link
Contributor Author

If the idea is to test headers being set, then x-goog-if-metageneration-match can replace the one I deleted. It is always one for each generation of an object and there is only generation in the entire test.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))
Terraform Beta: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that's fine too. You'll need to update the if-generation-match on line 128 to if-metageneration-match as well. (Currently if-generation-match)

@upodroid
Copy link
Contributor Author

my bad, fixed

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 2 files changed, 4 insertions(+), 4 deletions(-))

@melinath
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 1 file changed, 3 insertions(+), 3 deletions(-))

@melinath
Copy link
Member

It looks like this test is skipped in VCR - running a special build to check it: https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloudBeta_ProviderGoogleCloudBetaMmUpstream/205953

@melinath melinath merged commit 3abe7e7 into GoogleCloudPlatform:master Sep 15, 2021
khajduczenia pushed a commit to khajduczenia/magic-modules that referenced this pull request Oct 12, 2021
* allow disabling service accounts

Co-authored-by: upodroid <[email protected]>

* fix typos

* revert warning change

* remove dynamically generated header from test

Co-authored-by: upodroid <[email protected]>

* reinstance the test with a diff header

* fix typo

* fix fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing test(s): TestAccStorageSignedUrl_accTest
3 participants