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

remove bigquery-json.google-apis.com from renamed services as its no longer allowed #3751

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/5250.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
project: removed ability to specify `bigquery-json.googleapis.com`, the provider will no longer convert it as the upstream API migration is finished. Use `bigquery.googleapis.com` instead.
```
2 changes: 1 addition & 1 deletion google-beta/resource_gke_hub_feature_membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
Expand Down
4 changes: 1 addition & 3 deletions google-beta/resource_google_project_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ var bannedProjectServices = []string{"bigquery-json.googleapis.com"}
// "DEPRECATED FOR {{version}} next to entries slated for removal in {{version}}
// upon removal, we should disallow the old name from being used even if it's
// not gone from the underlying API yet
var renamedServices = map[string]string{
"bigquery-json.googleapis.com": "bigquery.googleapis.com", // DEPRECATED FOR 4.0.0. Originally for 3.0.0, but the migration did not happen server-side yet.
}
var renamedServices = map[string]string{}

// renamedServices in reverse (new -> old)
var renamedServicesByNewServiceNames = reverseStringMap(renamedServices)
Expand Down
11 changes: 10 additions & 1 deletion google-beta/resource_google_project_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,23 @@ func TestAccProjectService_handleNotFound(t *testing.T) {
func TestAccProjectService_renamedService(t *testing.T) {
t.Parallel()

if len(renamedServices) == 0 {
t.Skip()
}

var newName string
for _, new := range renamedServices {
newName = new
}

org := getTestOrgFromEnv(t)
pid := fmt.Sprintf("tf-test-%d", randInt(t))
vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccProjectService_single("bigquery.googleapis.com", pid, pname, org),
Config: testAccProjectService_single(newName, pid, pname, org),
},
{
ResourceName: "google_project_service.test",
Expand Down
10 changes: 10 additions & 0 deletions website/docs/guides/version_4_upgrade.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ description: |-
- [`node_config.workload_metadata_config.node_metadata` is now removed](#node_configworkload_metadata_confignode_metadata-is-now-removed)
- [`workload_identity_config.0.identity_namespace` is now removed](#workload_identity_config0identity_namespace-is-now-removed)
- [`pod_security_policy_config` is removed from the GA provider](#pod_security_policy_config-is-removed-from-the-ga-provider)
- [Resource: `google_project_service`](#resource-google_project_service)
- [`bigquery-json.googleapis.com` is no longer a valid service name](#bigquery-json.googleapis.com-is-no-longer-a-valid-service-name)

<!-- /TOC -->

Expand Down Expand Up @@ -233,3 +235,11 @@ This field was incorrectly included in the GA `google` provider in past releases
In order to continue to use the feature, add `provider = google-beta` to your
resource definition.

## Resource: `google_project_service`

### `bigquery-json.googleapis.com` is no longer a valid service name

`bigquery-json.googleapis.com` was deprecated in the `3.0.0` release, however, at that point the provider
converted it while the upstream API migration was in progress. Now that the API migration has finished,
the provider will no longer convert the service name. Use `bigquery.googleapis.com` instead.