Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Version container based on provider, stop using containerbeta client #355

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
19 changes: 0 additions & 19 deletions converters/google/resources/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
composer "google.golang.org/api/composer/v1beta1"
"google.golang.org/api/compute/v1"
"google.golang.org/api/container/v1"
containerBeta "google.golang.org/api/container/v1beta1"
dataflow "google.golang.org/api/dataflow/v1b3"
"google.golang.org/api/dataproc/v1"
"google.golang.org/api/dns/v1"
Expand Down Expand Up @@ -148,7 +147,6 @@ type Config struct {
CloudBillingBasePath string
ComposerBasePath string
ContainerBasePath string
ContainerBetaBasePath string
DataprocBetaBasePath string
DataflowBasePath string
IamCredentialsBasePath string
Expand Down Expand Up @@ -240,7 +238,6 @@ const CloudBillingBasePathKey = "CloudBilling"
const ComposerBasePathKey = "Composer"
const ContainerBasePathKey = "Container"
const DataprocBetaBasePathKey = "DataprocBeta"
const ContainerBetaBasePathKey = "ContainerBeta"
const DataflowBasePathKey = "Dataflow"
const IAMBasePathKey = "IAM"
const IamCredentialsBasePathKey = "IamCredentials"
Expand Down Expand Up @@ -320,7 +317,6 @@ var DefaultBasePaths = map[string]string{
CloudBillingBasePathKey: "https://cloudbilling.googleapis.com/v1/",
ComposerBasePathKey: "https://composer.googleapis.com/v1/",
ContainerBasePathKey: "https://container.googleapis.com/v1/",
ContainerBetaBasePathKey: "https://container.googleapis.com/v1beta1/",
DataprocBetaBasePathKey: "https://dataproc.googleapis.com/v1beta2/",
DataflowBasePathKey: "https://dataflow.googleapis.com/v1b3/",
IAMBasePathKey: "https://iam.googleapis.com/v1/",
Expand Down Expand Up @@ -530,20 +526,6 @@ func (c *Config) NewContainerClient(userAgent string) *container.Service {
return clientContainer
}

func (c *Config) NewContainerBetaClient(userAgent string) *containerBeta.Service {
containerBetaClientBasePath := removeBasePathVersion(c.ContainerBetaBasePath)
log.Printf("[INFO] Instantiating GKE Beta client for path %s", containerBetaClientBasePath)
clientContainerBeta, err := containerBeta.NewService(c.context, option.WithHTTPClient(c.client))
if err != nil {
log.Printf("[WARN] Error creating client container beta: %s", err)
return nil
}
clientContainerBeta.UserAgent = userAgent
clientContainerBeta.BasePath = containerBetaClientBasePath

return clientContainerBeta
}

func (c *Config) NewDnsClient(userAgent string) *dns.Service {
dnsClientBasePath := removeBasePathVersion(c.DNSBasePath)
dnsClientBasePath = strings.ReplaceAll(dnsClientBasePath, "/dns/", "")
Expand Down Expand Up @@ -1159,7 +1141,6 @@ func ConfigureBasePaths(c *Config) {
c.CloudBillingBasePath = DefaultBasePaths[CloudBillingBasePathKey]
c.ComposerBasePath = DefaultBasePaths[ComposerBasePathKey]
c.ContainerBasePath = DefaultBasePaths[ContainerBasePathKey]
c.ContainerBetaBasePath = DefaultBasePaths[ContainerBetaBasePathKey]
c.DataprocBasePath = DefaultBasePaths[DataprocBasePathKey]
c.DataflowBasePath = DefaultBasePaths[DataflowBasePathKey]
c.IamCredentialsBasePath = DefaultBasePaths[IamCredentialsBasePathKey]
Expand Down
10 changes: 0 additions & 10 deletions converters/google/resources/provider_handwritten_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ var ContainerCustomEndpointEntry = &schema.Schema{
}, DefaultBasePaths[ContainerBasePathKey]),
}

var ContainerBetaCustomEndpointEntryKey = "container_beta_custom_endpoint"
var ContainerBetaCustomEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_CONTAINER_BETA_CUSTOM_ENDPOINT",
}, DefaultBasePaths[ContainerBetaBasePathKey]),
}

var DataprocBetaCustomEndpointEntryKey = "dataproc_beta_custom_endpoint"
var DataprocBetaCustomEndpointEntry = &schema.Schema{
Type: schema.TypeString,
Expand Down