Skip to content

Commit 65b7d99

Browse files
Remove beta fields from the google provider (#5262) (#10410)
Signed-off-by: Modular Magician <[email protected]>
1 parent f5b90ee commit 65b7d99

29 files changed

+48
-1614
lines changed

.changelog/5262.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```release-note:breaking-change
2+
compute: removed the `update_policy.min_ready_sec` field from `google_compute_instance_group_manager`, `google_compute_region_instance_group_manager` in the GA provider
3+
```
4+
```release-note:breaking-change
5+
compute: removed the `enable_display` field from `google_compute_instance_template` in the GA provider
6+
```
7+
```release-note:breaking-change
8+
container: removed the `pod_security_policy_config` field from `google_container_cluster` in the GA provider
9+
```
10+
```release-note:breaking-change
11+
container: removed the `workload_identity_config.0.identity_namespace` field from `google_container_cluster`, use `workload_identity_config.0.workload_pool` instead
12+
```
13+
```release-note:breaking-change
14+
runtimeconfig: removed the Runtime Configurator service from the `google` (GA) provider including `google_runtimeconfig_config`, `google_runtimeconfig_variable`, `google_runtimeconfig_config_iam_policy`, `google_runtimeconfig_config_iam_binding`, `google_runtimeconfig_config_iam_member`, `data.google_runtimeconfig_config`. They are only available in the `google-beta` provider, as the underlying service is in beta.
15+
```

google/config.go

-19
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
iamcredentials "google.golang.org/api/iamcredentials/v1"
4040
cloudlogging "google.golang.org/api/logging/v2"
4141
"google.golang.org/api/pubsub/v1"
42-
runtimeconfig "google.golang.org/api/runtimeconfig/v1beta1"
4342
"google.golang.org/api/servicemanagement/v1"
4443
"google.golang.org/api/servicenetworking/v1"
4544
"google.golang.org/api/serviceusage/v1"
@@ -133,7 +132,6 @@ type Config struct {
133132
PubsubLiteBasePath string
134133
RedisBasePath string
135134
ResourceManagerBasePath string
136-
RuntimeConfigBasePath string
137135
SecretManagerBasePath string
138136
SecurityCenterBasePath string
139137
ServiceManagementBasePath string
@@ -227,7 +225,6 @@ const PubsubBasePathKey = "Pubsub"
227225
const PubsubLiteBasePathKey = "PubsubLite"
228226
const RedisBasePathKey = "Redis"
229227
const ResourceManagerBasePathKey = "ResourceManager"
230-
const RuntimeConfigBasePathKey = "RuntimeConfig"
231228
const SecretManagerBasePathKey = "SecretManager"
232229
const SecurityCenterBasePathKey = "SecurityCenter"
233230
const ServiceManagementBasePathKey = "ServiceManagement"
@@ -310,7 +307,6 @@ var DefaultBasePaths = map[string]string{
310307
PubsubLiteBasePathKey: "https://{{region}}-pubsublite.googleapis.com/v1/admin/",
311308
RedisBasePathKey: "https://redis.googleapis.com/v1/",
312309
ResourceManagerBasePathKey: "https://cloudresourcemanager.googleapis.com/v1/",
313-
RuntimeConfigBasePathKey: "https://runtimeconfig.googleapis.com/v1beta1/",
314310
SecretManagerBasePathKey: "https://secretmanager.googleapis.com/v1/",
315311
SecurityCenterBasePathKey: "https://securitycenter.googleapis.com/v1/",
316312
ServiceManagementBasePathKey: "https://servicemanagement.googleapis.com/v1/",
@@ -721,20 +717,6 @@ func (c *Config) NewResourceManagerV2Client(userAgent string) *resourceManagerV2
721717
return clientResourceManagerV2
722718
}
723719

724-
func (c *Config) NewRuntimeconfigClient(userAgent string) *runtimeconfig.Service {
725-
runtimeConfigClientBasePath := removeBasePathVersion(c.RuntimeConfigBasePath)
726-
log.Printf("[INFO] Instantiating Google Cloud Runtimeconfig client for path %s", runtimeConfigClientBasePath)
727-
clientRuntimeconfig, err := runtimeconfig.NewService(c.context, option.WithHTTPClient(c.client))
728-
if err != nil {
729-
log.Printf("[WARN] Error creating client runtime config: %s", err)
730-
return nil
731-
}
732-
clientRuntimeconfig.UserAgent = userAgent
733-
clientRuntimeconfig.BasePath = runtimeConfigClientBasePath
734-
735-
return clientRuntimeconfig
736-
}
737-
738720
func (c *Config) NewIamClient(userAgent string) *iam.Service {
739721
iamClientBasePath := removeBasePathVersion(c.IAMBasePath)
740722
log.Printf("[INFO] Instantiating Google Cloud IAM client for path %s", iamClientBasePath)
@@ -1176,7 +1158,6 @@ func ConfigureBasePaths(c *Config) {
11761158
c.PubsubLiteBasePath = DefaultBasePaths[PubsubLiteBasePathKey]
11771159
c.RedisBasePath = DefaultBasePaths[RedisBasePathKey]
11781160
c.ResourceManagerBasePath = DefaultBasePaths[ResourceManagerBasePathKey]
1179-
c.RuntimeConfigBasePath = DefaultBasePaths[RuntimeConfigBasePathKey]
11801161
c.SecretManagerBasePath = DefaultBasePaths[SecretManagerBasePathKey]
11811162
c.SecurityCenterBasePath = DefaultBasePaths[SecurityCenterBasePathKey]
11821163
c.ServiceManagementBasePath = DefaultBasePaths[ServiceManagementBasePathKey]
-30
Original file line numberDiff line numberDiff line change
@@ -1,31 +1 @@
11
package google
2-
3-
import (
4-
"fmt"
5-
6-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
7-
)
8-
9-
func dataSourceGoogleRuntimeconfigConfig() *schema.Resource {
10-
11-
dsSchema := datasourceSchemaFromResourceSchema(resourceRuntimeconfigConfig().Schema)
12-
addRequiredFieldsToSchema(dsSchema, "name")
13-
addOptionalFieldsToSchema(dsSchema, "project")
14-
15-
return &schema.Resource{
16-
Read: dataSourceGoogleRuntimeconfigConfigRead,
17-
Schema: dsSchema,
18-
DeprecationMessage: "This datasource has been deprecated in the google (GA) provider, and will only be available in the google-beta provider in a future release.",
19-
}
20-
}
21-
22-
func dataSourceGoogleRuntimeconfigConfigRead(d *schema.ResourceData, meta interface{}) error {
23-
config := meta.(*Config)
24-
25-
id, err := replaceVars(d, config, "projects/{{project}}/configs/{{name}}")
26-
if err != nil {
27-
return fmt.Errorf("Error constructing id: %s", err)
28-
}
29-
d.SetId(id)
30-
return resourceRuntimeconfigConfigRead(d, meta)
31-
}
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
11
package google
2-
3-
import (
4-
"fmt"
5-
"testing"
6-
7-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
8-
)
9-
10-
func TestAccRuntimeconfigConfigDatasource_basic(t *testing.T) {
11-
t.Parallel()
12-
13-
vcrTest(t, resource.TestCase{
14-
PreCheck: func() { testAccPreCheck(t) },
15-
Providers: testAccProviders,
16-
Steps: []resource.TestStep{
17-
{
18-
Config: testAccRuntimeconfigDatasourceConfig(randString(t, 10)),
19-
Check: resource.ComposeTestCheckFunc(
20-
checkDataSourceStateMatchesResourceState("data.google_runtimeconfig_config.default", "google_runtimeconfig_config.default"),
21-
),
22-
},
23-
},
24-
})
25-
}
26-
27-
func testAccRuntimeconfigDatasourceConfig(suffix string) string {
28-
return fmt.Sprintf(`
29-
resource "google_runtimeconfig_config" "default" {
30-
name = "runtime-%s"
31-
description = "runtime-%s"
32-
}
33-
34-
data "google_runtimeconfig_config" "default" {
35-
name = google_runtimeconfig_config.default.name
36-
}
37-
`, suffix, suffix)
38-
}

google/iam_runtimeconfig_config.go

-198
This file was deleted.

0 commit comments

Comments
 (0)