Skip to content

Commit 7c7a459

Browse files
Merge branch 'master' into release-3.88.0
2 parents 6f506e5 + 0c687a8 commit 7c7a459

File tree

46 files changed

+158
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+158
-11
lines changed

.changelog/5286.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
`storage`: `google_storage_bucket_object` now uses resource timeouts instead of global timeout for its operations.
3+
```

.changelog/5287.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
iam: Add projectOwner, projectEditor and projectViewer as possible values for members field in documentation.
3+
```

.changelog/5289.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
container: Added note about why node pools should be defined separately from the cluster
3+
```

GNUmakefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
5050
endif
5151
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
5252

53-
website-test:
54-
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
55-
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
56-
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
57-
endif
58-
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
59-
6053
docscheck:
6154
@sh -c "'$(CURDIR)/scripts/docscheck.sh'"
6255

google-beta/config.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,30 @@ func (c *Config) NewStorageClient(userAgent string) *storage.Service {
659659
return clientStorage
660660
}
661661

662+
// For object uploads, we need to override the specific timeout because they are long, synchronous operations.
663+
func (c *Config) NewStorageClientWithTimeoutOverride(userAgent string, timeout time.Duration) *storage.Service {
664+
storageClientBasePath := c.StorageBasePath
665+
log.Printf("[INFO] Instantiating Google Storage client for path %s", storageClientBasePath)
666+
// Copy the existing HTTP client (which has no unexported fields [as of Oct 2021 at least], so this is safe).
667+
// We have to do this because otherwise we will accidentally change the timeout for all other
668+
// synchronous operations, which would not be desirable.
669+
httpClient := &http.Client{
670+
Transport: c.client.Transport,
671+
CheckRedirect: c.client.CheckRedirect,
672+
Jar: c.client.Jar,
673+
Timeout: timeout,
674+
}
675+
clientStorage, err := storage.NewService(c.context, option.WithHTTPClient(httpClient))
676+
if err != nil {
677+
log.Printf("[WARN] Error creating client storage: %s", err)
678+
return nil
679+
}
680+
clientStorage.UserAgent = userAgent
681+
clientStorage.BasePath = storageClientBasePath
682+
683+
return clientStorage
684+
}
685+
662686
func (c *Config) NewSqlAdminClient(userAgent string) *sqladmin.Service {
663687
sqlClientBasePath := removeBasePathVersion(removeBasePathVersion(c.SQLBasePath))
664688
log.Printf("[INFO] Instantiating Google SqlAdmin client for path %s", sqlClientBasePath)

google-beta/resource_storage_bucket_object.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ func resourceStorageBucketObjectCreate(d *schema.ResourceData, meta interface{})
288288
return fmt.Errorf("Error, either \"content\" or \"source\" must be specified")
289289
}
290290

291-
objectsService := storage.NewObjectsService(config.NewStorageClient(userAgent))
291+
objectsService := storage.NewObjectsService(config.NewStorageClientWithTimeoutOverride(userAgent, d.Timeout(schema.TimeoutCreate)))
292292
object := &storage.Object{Bucket: bucket}
293293

294294
if v, ok := d.GetOk("cache_control"); ok {
@@ -360,7 +360,7 @@ func resourceStorageBucketObjectUpdate(d *schema.ResourceData, meta interface{})
360360
bucket := d.Get("bucket").(string)
361361
name := d.Get("name").(string)
362362

363-
objectsService := storage.NewObjectsService(config.NewStorageClient(userAgent))
363+
objectsService := storage.NewObjectsService(config.NewStorageClientWithTimeoutOverride(userAgent, d.Timeout(schema.TimeoutUpdate)))
364364
getCall := objectsService.Get(bucket, name)
365365

366366
res, err := getCall.Do()
@@ -398,7 +398,7 @@ func resourceStorageBucketObjectRead(d *schema.ResourceData, meta interface{}) e
398398
bucket := d.Get("bucket").(string)
399399
name := d.Get("name").(string)
400400

401-
objectsService := storage.NewObjectsService(config.NewStorageClient(userAgent))
401+
objectsService := storage.NewObjectsService(config.NewStorageClientWithTimeoutOverride(userAgent, d.Timeout(schema.TimeoutRead)))
402402
getCall := objectsService.Get(bucket, name)
403403

404404
if v, ok := d.GetOk("customer_encryption"); ok {
@@ -476,7 +476,7 @@ func resourceStorageBucketObjectDelete(d *schema.ResourceData, meta interface{})
476476
bucket := d.Get("bucket").(string)
477477
name := d.Get("name").(string)
478478

479-
objectsService := storage.NewObjectsService(config.NewStorageClient(userAgent))
479+
objectsService := storage.NewObjectsService(config.NewStorageClientWithTimeoutOverride(userAgent, d.Timeout(schema.TimeoutDelete)))
480480

481481
DeleteCall := objectsService.Delete(bucket, name)
482482
err = DeleteCall.Do()

website/docs/r/api_gateway_api_config_iam.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ The following arguments are supported:
9797
* **serviceAccount:{emailid}**: An email address that represents a service account. For example, [email protected].
9898
* **group:{emailid}**: An email address that represents a Google group. For example, [email protected].
9999
* **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
100+
* **projectOwner:projectid**: Owners of the given project. For example, "projectOwner:my-example-project"
101+
* **projectEditor:projectid**: Editors of the given project. For example, "projectEditor:my-example-project"
102+
* **projectViewer:projectid**: Viewers of the given project. For example, "projectViewer:my-example-project"
100103

101104
* `role` - (Required) The role that should be applied. Only one
102105
`google_api_gateway_api_config_iam_binding` can be used per role. Note that custom roles must be of the format

website/docs/r/api_gateway_api_iam.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ The following arguments are supported:
9595
* **serviceAccount:{emailid}**: An email address that represents a service account. For example, [email protected].
9696
* **group:{emailid}**: An email address that represents a Google group. For example, [email protected].
9797
* **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
98+
* **projectOwner:projectid**: Owners of the given project. For example, "projectOwner:my-example-project"
99+
* **projectEditor:projectid**: Editors of the given project. For example, "projectEditor:my-example-project"
100+
* **projectViewer:projectid**: Viewers of the given project. For example, "projectViewer:my-example-project"
98101

99102
* `role` - (Required) The role that should be applied. Only one
100103
`google_api_gateway_api_iam_binding` can be used per role. Note that custom roles must be of the format

website/docs/r/api_gateway_gateway_iam.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ The following arguments are supported:
102102
* **serviceAccount:{emailid}**: An email address that represents a service account. For example, [email protected].
103103
* **group:{emailid}**: An email address that represents a Google group. For example, [email protected].
104104
* **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
105+
* **projectOwner:projectid**: Owners of the given project. For example, "projectOwner:my-example-project"
106+
* **projectEditor:projectid**: Editors of the given project. For example, "projectEditor:my-example-project"
107+
* **projectViewer:projectid**: Viewers of the given project. For example, "projectViewer:my-example-project"
105108

106109
* `role` - (Required) The role that should be applied. Only one
107110
`google_api_gateway_gateway_iam_binding` can be used per role. Note that custom roles must be of the format

website/docs/r/artifact_registry_repository_iam.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ The following arguments are supported:
101101
* **serviceAccount:{emailid}**: An email address that represents a service account. For example, [email protected].
102102
* **group:{emailid}**: An email address that represents a Google group. For example, [email protected].
103103
* **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
104+
* **projectOwner:projectid**: Owners of the given project. For example, "projectOwner:my-example-project"
105+
* **projectEditor:projectid**: Editors of the given project. For example, "projectEditor:my-example-project"
106+
* **projectViewer:projectid**: Viewers of the given project. For example, "projectViewer:my-example-project"
104107

105108
* `role` - (Required) The role that should be applied. Only one
106109
`google_artifact_registry_repository_iam_binding` can be used per role. Note that custom roles must be of the format

0 commit comments

Comments
 (0)