Skip to content

Commit a5632e8

Browse files
Merge branch 'GoogleCloudPlatform:main' into rmv_read_retry
2 parents d2a35a7 + 24a8c2f commit a5632e8

File tree

35 files changed

+812
-158
lines changed

35 files changed

+812
-158
lines changed

.ci/infra/terraform/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ After applying this configuration:
4848
- Enroll in Cloud Armor Managed Protection Plus tier
4949
- Add Cloud Identity Premium Plan to the Google Workspace domain
5050
- Perform the Privileged Access Manager set-up https://pantheon.corp.google.com/iam-admin/pam/setup
51+
- (Org only) Enroll the org in the Premium tier of Security Control Center
5152
5253
Quotas that will need to be adjusted to support all tests:
5354
- Project quota for the new service account

.ci/magician/github/membership_data.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var (
1818
"hao-nan-li": {},
1919
"NickElliot": {},
2020
"BBBmau": {},
21+
"SirGitsalot": {},
2122
}
2223

2324
// This is for new team members who are onboarding

.github/PULL_REQUEST_TEMPLATE.md

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,16 @@
1-
<!-- Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to -->
2-
3-
41
<!--
5-
Please self-review your PR against the review checklist before creating it: https://googlecloudplatform.github.io/magic-modules/contribute/review-pr/
2+
Complete the self-review checklist to help speed up the review process: https://googlecloudplatform.github.io/magic-modules/contribute/review-pr/
63
7-
Completing the checklist will help speed up the review process, and we appreciate you spending time on them before sending
8-
your code to be reviewed.
4+
If your PR is still work in progress, please create it in draft mode.
95
10-
If your PR is still work in progress, please create it in draft mode
6+
Put a description of what this PR is for here, along with any references to issues that this resolves or contributes to.
7+
For example: Fixes https://github.com/hashicorp/terraform-provider-google/issues/ISSUE_ID
118
-->
129

13-
<!-- AUTOCHANGELOG for Downstream PRs.
14-
15-
Please select one of the following "release-note:" headings:
16-
- release-note:enhancement
17-
- release-note:bug
18-
- release-note:note
19-
- release-note:new-resource
20-
- release-note:new-datasource
21-
- release-note:deprecation
22-
- release-note:breaking-change
23-
- release-note:none
24-
25-
Unless you choose release-note:none, please add a release note.
26-
27-
See https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/ for writing good release notes.
28-
29-
You can add more release note blocks if you want more than one CHANGELOG
30-
entry for this PR.
31-
-->
3210
**Release Note Template for Downstream PRs (will be copied)**
3311

12+
See [Write release notes](https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/) for guidance.
13+
3414
```release-note:REPLACEME
3515
3616
```

mmv1/products/oracledatabase/product.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# limitations under the License.
1313
---
1414
name: 'OracleDatabase'
15-
display_name: 'OracleDatabase'
15+
display_name: 'Oracle Database'
1616
versions:
1717
- name: 'ga'
1818
base_url: 'https://oracledatabase.googleapis.com/v1/'

mmv1/templates/terraform/examples/container_attached_cluster_full.tf.tmpl

-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,4 @@ resource "google_container_attached_cluster" "primary" {
4646
namespace = "default"
4747
}
4848
}
49-
security_posture_config {
50-
vulnerability_mode = "VULNERABILITY_ENTERPRISE"
51-
}
5249
}

mmv1/third_party/terraform/fwprovider/data_source_provider_config_plugin_framework.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (d *GoogleProviderConfigPluginFrameworkDataSource) Read(ctx context.Context
215215
data.Scopes = d.providerConfig.Scopes
216216
data.UserProjectOverride = d.providerConfig.UserProjectOverride
217217
data.RequestReason = d.providerConfig.RequestReason
218-
// TODO(SarahFrench) - request_timeout
218+
data.RequestTimeout = d.providerConfig.RequestTimeout
219219
data.DefaultLabels = d.providerConfig.DefaultLabels
220220
data.AddTerraformAttributionLabel = d.providerConfig.AddTerraformAttributionLabel
221221
data.TerraformAttributionLabelAdditionStrategy = d.providerConfig.TerraformAttributionLabelAdditionStrategy

mmv1/third_party/terraform/fwprovider/framework_provider_access_token_test.go.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func testAccFwProvider_access_token_authInUse(t *testing.T) {
267267
{{- end }}
268268

269269
// testAccFwProvider_access_tokenInProviderBlock allows setting the access_token argument in a provider block.
270-
// This function uses data.google_provider_config_plugin_framework because it is implemented with the SDKv2
270+
// This function uses data.google_provider_config_plugin_framework because it is implemented with the PF
271271
func testAccFwProvider_access_tokenInProviderBlock(context map[string]interface{}) string {
272272
return acctest.Nprintf(`
273273
provider "google" {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
package fwprovider_test
2+
3+
import (
4+
"regexp"
5+
"testing"
6+
7+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
8+
"github.com/hashicorp/terraform-provider-google/google/acctest"
9+
)
10+
11+
// TestAccFwProvider_request_timeout is a series of acc tests asserting how the PF provider handles request_timeout arguments
12+
// It is PF specific because the HCL used provisions PF-implemented resources
13+
// It is a counterpart to TestAccSdkProvider_request_timeout
14+
func TestAccFwProvider_request_timeout(t *testing.T) {
15+
testCases := map[string]func(t *testing.T){
16+
// Configuring the provider using inputs
17+
"a default value of 120s is used when there are no user inputs": testAccFwProvider_request_timeout_providerDefault,
18+
"request_timeout can be set in config in different formats, are NOT normalized to full-length format": testAccFwProvider_request_timeout_setInConfig,
19+
//no ENVs to test
20+
21+
// Schema-level validation
22+
"when request_timeout is set to an empty string in the config the value fails validation, as it is not a duration": testAccFwProvider_request_timeout_emptyStringValidation,
23+
24+
// Usage
25+
// We cannot test the impact of this field in an acc test until more resources/data sources are implemented with the plugin-framework
26+
}
27+
28+
for name, tc := range testCases {
29+
// shadow the tc variable into scope so that when
30+
// the loop continues, if t.Run hasn't executed tc(t)
31+
// yet, we don't have a race condition
32+
// see https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
33+
tc := tc
34+
t.Run(name, func(t *testing.T) {
35+
tc(t)
36+
})
37+
}
38+
}
39+
40+
func testAccFwProvider_request_timeout_providerDefault(t *testing.T) {
41+
acctest.SkipIfVcr(t) // Test doesn't interact with API
42+
43+
defaultValue := "120s"
44+
45+
acctest.VcrTest(t, resource.TestCase{
46+
// No PreCheck for checking ENVs
47+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
48+
Steps: []resource.TestStep{
49+
{
50+
Config: testAccFwProvider_request_timeout_unset(),
51+
Check: resource.ComposeTestCheckFunc(
52+
resource.TestCheckResourceAttr("data.google_provider_config_plugin_framework.default", "request_timeout", defaultValue),
53+
),
54+
},
55+
},
56+
})
57+
}
58+
59+
func testAccFwProvider_request_timeout_setInConfig(t *testing.T) {
60+
acctest.SkipIfVcr(t) // Test doesn't interact with API
61+
62+
providerTimeout1 := "3m0s"
63+
providerTimeout2 := "3m"
64+
65+
// In the SDK version of the test expectedValue = "3m0s" only
66+
expectedValue1 := "3m0s"
67+
expectedValue2 := "3m"
68+
69+
context1 := map[string]interface{}{
70+
"request_timeout": providerTimeout1,
71+
}
72+
context2 := map[string]interface{}{
73+
"request_timeout": providerTimeout2,
74+
}
75+
76+
acctest.VcrTest(t, resource.TestCase{
77+
// No PreCheck for checking ENVs
78+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
79+
Steps: []resource.TestStep{
80+
{
81+
Config: testAccFwProvider_request_timeout_inProviderBlock(context1),
82+
Check: resource.ComposeTestCheckFunc(
83+
resource.TestCheckResourceAttr("data.google_provider_config_plugin_framework.default", "request_timeout", expectedValue1),
84+
),
85+
},
86+
{
87+
Config: testAccFwProvider_request_timeout_inProviderBlock(context2),
88+
Check: resource.ComposeTestCheckFunc(
89+
resource.TestCheckResourceAttr("data.google_provider_config_plugin_framework.default", "request_timeout", expectedValue2),
90+
),
91+
},
92+
},
93+
})
94+
}
95+
96+
func testAccFwProvider_request_timeout_emptyStringValidation(t *testing.T) {
97+
acctest.SkipIfVcr(t) // Test doesn't interact with API
98+
99+
context := map[string]interface{}{
100+
"request_timeout": "", // empty string used
101+
}
102+
103+
acctest.VcrTest(t, resource.TestCase{
104+
// No PreCheck for checking ENVs
105+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
106+
Steps: []resource.TestStep{
107+
{
108+
Config: testAccFwProvider_request_timeout_inProviderBlock(context),
109+
ExpectError: regexp.MustCompile("invalid duration"),
110+
},
111+
},
112+
})
113+
}
114+
115+
// testAccFwProvider_request_timeout_inProviderBlock allows setting the request_timeout argument in a provider block.
116+
// This function uses data.google_provider_config_plugin_framework because it is implemented with the PF
117+
func testAccFwProvider_request_timeout_inProviderBlock(context map[string]interface{}) string {
118+
return acctest.Nprintf(`
119+
provider "google" {
120+
request_timeout = "%{request_timeout}"
121+
}
122+
123+
data "google_provider_config_plugin_framework" "default" {}
124+
`, context)
125+
}
126+
127+
// testAccFwProvider_request_timeout_inEnvsOnly allows testing when the request_timeout argument is not set
128+
func testAccFwProvider_request_timeout_unset() string {
129+
return `
130+
data "google_provider_config_plugin_framework" "default" {}
131+
`
132+
}

mmv1/third_party/terraform/fwtransport/framework_config.go.tmpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ type FrameworkProviderConfig struct {
3838
AccessToken types.String
3939
ImpersonateServiceAccount types.String
4040
ImpersonateServiceAccountDelegates types.List
41-
RequestReason types.String
41+
RequestReason types.String
42+
RequestTimeout types.String
4243
AddTerraformAttributionLabel types.Bool
4344
TerraformAttributionLabelAdditionStrategy types.String
4445
// End temporary
@@ -113,6 +114,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
113114
p.ImpersonateServiceAccount = data.ImpersonateServiceAccount
114115
p.ImpersonateServiceAccountDelegates = data.ImpersonateServiceAccountDelegates
115116
p.RequestReason = data.RequestReason
117+
p.RequestTimeout = data.RequestTimeout
116118
p.AddTerraformAttributionLabel = data.AddTerraformAttributionLabel
117119
p.TerraformAttributionLabelAdditionStrategy = data.TerraformAttributionLabelAdditionStrategy
118120
// End temporary

mmv1/third_party/terraform/go.mod

+30-29
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-google
33
go 1.21
44

55
require (
6-
cloud.google.com/go/bigtable v1.30.0
6+
cloud.google.com/go/bigtable v1.31.0
77
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.74.0
88
github.com/apparentlymart/go-cidr v1.1.0
99
github.com/davecgh/go-spew v1.1.1
@@ -30,46 +30,46 @@ require (
3030
github.com/stretchr/testify v1.9.0
3131
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
3232
golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8
33-
golang.org/x/net v0.28.0
34-
golang.org/x/oauth2 v0.22.0
35-
google.golang.org/api v0.193.0
36-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142
37-
google.golang.org/grpc v1.65.0
33+
golang.org/x/net v0.29.0
34+
golang.org/x/oauth2 v0.23.0
35+
google.golang.org/api v0.199.0
36+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1
37+
google.golang.org/grpc v1.67.0
3838
google.golang.org/protobuf v1.34.2
3939
)
4040

4141
require (
4242
bitbucket.org/creachadair/stringset v0.0.8 // indirect
43-
cel.dev/expr v0.15.0 // indirect
43+
cel.dev/expr v0.16.0 // indirect
4444
cloud.google.com/go v0.115.1 // indirect
45-
cloud.google.com/go/auth v0.9.0 // indirect
45+
cloud.google.com/go/auth v0.9.5 // indirect
4646
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
47-
cloud.google.com/go/compute/metadata v0.5.0 // indirect
48-
cloud.google.com/go/iam v1.1.13 // indirect
49-
cloud.google.com/go/longrunning v0.5.12 // indirect
50-
cloud.google.com/go/monitoring v1.20.4 // indirect
47+
cloud.google.com/go/compute/metadata v0.5.2 // indirect
48+
cloud.google.com/go/iam v1.2.0 // indirect
49+
cloud.google.com/go/longrunning v0.6.0 // indirect
50+
cloud.google.com/go/monitoring v1.21.0 // indirect
5151
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
5252
github.com/agext/levenshtein v1.2.2 // indirect
5353
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
5454
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
5555
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
5656
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5757
github.com/cloudflare/circl v1.3.7 // indirect
58-
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b // indirect
59-
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
60-
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
58+
github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59 // indirect
59+
github.com/envoyproxy/go-control-plane v0.13.0 // indirect
60+
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
6161
github.com/fatih/color v1.16.0 // indirect
6262
github.com/felixge/httpsnoop v1.0.4 // indirect
6363
github.com/gammazero/deque v0.0.0-20180920172122-f6adf94963e4 // indirect
6464
github.com/go-logr/logr v1.4.2 // indirect
6565
github.com/go-logr/stdr v1.2.2 // indirect
66-
github.com/golang/glog v1.2.1 // indirect
66+
github.com/golang/glog v1.2.2 // indirect
6767
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
6868
github.com/golang/protobuf v1.5.4 // indirect
6969
github.com/google/go-cpy v0.0.0-20211218193943-a9c933c06932 // indirect
7070
github.com/google/s2a-go v0.1.8 // indirect
7171
github.com/google/uuid v1.6.0 // indirect
72-
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
72+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
7373
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
7474
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
7575
github.com/hashicorp/go-hclog v1.6.3 // indirect
@@ -91,30 +91,31 @@ require (
9191
github.com/mitchellh/mapstructure v1.5.0 // indirect
9292
github.com/mitchellh/reflectwalk v1.0.2 // indirect
9393
github.com/oklog/run v1.0.0 // indirect
94+
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
9495
github.com/pmezard/go-difflib v1.0.0 // indirect
9596
github.com/rogpeppe/go-internal v1.12.0 // indirect
9697
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
9798
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
9899
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
99100
github.com/zclconf/go-cty v1.14.4 // indirect
100101
go.opencensus.io v0.24.0 // indirect
101-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect
102-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
103-
go.opentelemetry.io/otel v1.28.0 // indirect
104-
go.opentelemetry.io/otel/metric v1.28.0 // indirect
105-
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
106-
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
107-
go.opentelemetry.io/otel/trace v1.28.0 // indirect
108-
golang.org/x/crypto v0.26.0 // indirect
102+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
103+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
104+
go.opentelemetry.io/otel v1.29.0 // indirect
105+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
106+
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
107+
go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
108+
go.opentelemetry.io/otel/trace v1.29.0 // indirect
109+
golang.org/x/crypto v0.27.0 // indirect
109110
golang.org/x/mod v0.17.0 // indirect
110111
golang.org/x/sync v0.8.0 // indirect
111-
golang.org/x/sys v0.24.0 // indirect
112-
golang.org/x/text v0.17.0 // indirect
112+
golang.org/x/sys v0.25.0 // indirect
113+
golang.org/x/text v0.18.0 // indirect
113114
golang.org/x/time v0.6.0 // indirect
114115
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
115116
google.golang.org/appengine v1.6.8 // indirect
116-
google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 // indirect
117-
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
117+
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
118+
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
118119
gopkg.in/yaml.v2 v2.4.0 // indirect
119120
gopkg.in/yaml.v3 v3.0.1 // indirect
120121
)

0 commit comments

Comments
 (0)