Skip to content

Commit

Permalink
Merge pull request #415 from vmware/fix-csp-default-url
Browse files Browse the repository at this point in the history
Change the default CSP url
  • Loading branch information
AkbaraliShaikh authored Oct 16, 2024
2 parents abab85a + 612b0fc commit 74e8faa
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Example:

```shell
$ export TMC_ENDPOINT = my-org.tmc.cloud.vmware.com
$ export VMW_CLOUD_ENDPOINT = console.cloud.vmware.com
$ export VMW_CLOUD_ENDPOINT = console.tanzu.broadcom.com
```

Environment variables specific to particular resources:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/provider_behind_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ provider "tanzu-mission-control" {
vmw_cloud_api_token = var.vmw_cloud_api_token # optionally use VMW_CLOUD_API_TOKEN env var
# if you are using dev or different csp endpoint, change the default value below
# for production environments the vmw_cloud_endpoint is console.cloud.vmware.com
# vmw_cloud_endpoint = "console.cloud.vmware.com" or optionally use VMW_CLOUD_ENDPOINT env var
# for production environments the vmw_cloud_endpoint is console.tanzu.broadcom.com
# vmw_cloud_endpoint = "console.tanzu.broadcom.com" or optionally use VMW_CLOUD_ENDPOINT env var
# the following values shall be only populated when the provider needs to be used behind a proxy.
# these values will only work if the user provides HTTP_PROXY or HTTPS_PROXY env var
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ provider "tanzu-mission-control" {
vmw_cloud_api_token = var.vmw_cloud_api_token # optionally use VMW_CLOUD_API_TOKEN env var
# if you are using dev or different csp endpoint, change the default value below
# for production environments the vmw_cloud_endpoint is console.cloud.vmware.com
# vmw_cloud_endpoint = "console.cloud.vmware.com" or optionally use VMW_CLOUD_ENDPOINT env var
# for production environments the vmw_cloud_endpoint is console.tanzu.broadcom.com
# vmw_cloud_endpoint = "console.tanzu.broadcom.com" or optionally use VMW_CLOUD_ENDPOINT env var
}
# Provider configuration for TMC Self-Managed
Expand Down
4 changes: 2 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ provider "tanzu-mission-control" {
vmw_cloud_api_token = var.vmw_cloud_api_token # optionally use VMW_CLOUD_API_TOKEN env var

# if you are using dev or different csp endpoint, change the default value below
# for production environments the vmw_cloud_endpoint is console.cloud.vmware.com
# vmw_cloud_endpoint = "console.cloud.vmware.com" or optionally use VMW_CLOUD_ENDPOINT env var
# for production environments the vmw_cloud_endpoint is console.tanzu.broadcom.com
# vmw_cloud_endpoint = "console.tanzu.broadcom.com" or optionally use VMW_CLOUD_ENDPOINT env var
}

# Provider configuration for TMC Self-Managed
Expand Down
3 changes: 2 additions & 1 deletion examples/provider/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ variable "endpoint" {
}

variable "vmw_cloud_api_token" {
default = "https://console.tanzu.broadcom.com"
}

variable "vmw_cloud_endpoint" {
default = "console.cloud.vmware.com"
default = "console.tanzu.broadcom.com"
}

variable "oidc_issuer" {
Expand Down
4 changes: 2 additions & 2 deletions examples/proxy/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ provider "tanzu-mission-control" {
vmw_cloud_api_token = var.vmw_cloud_api_token # optionally use VMW_CLOUD_API_TOKEN env var

# if you are using dev or different csp endpoint, change the default value below
# for production environments the vmw_cloud_endpoint is console.cloud.vmware.com
# vmw_cloud_endpoint = "console.cloud.vmware.com" or optionally use VMW_CLOUD_ENDPOINT env var
# for production environments the vmw_cloud_endpoint is console.tanzu.broadcom.com
# vmw_cloud_endpoint = "console.tanzu.broadcom.com" or optionally use VMW_CLOUD_ENDPOINT env var

# the following values shall be only populated when the provider needs to be used behind a proxy.
# these values will only work if the user provides HTTP_PROXY or HTTPS_PROXY env var
Expand Down
2 changes: 1 addition & 1 deletion examples/proxy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variable "client_auth_key" {}
variable "ca_cert" {}

variable "vmw_cloud_endpoint" {
default = "console.cloud.vmware.com"
default = "console.tanzu.broadcom.com"
}

variable "insecure_allow_unverified_ssl" {
Expand Down
2 changes: 1 addition & 1 deletion internal/authctx/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
projectID = "project_id"
vmwCloudEndpoint = "vmw_cloud_endpoint"
vmwCloudAPIToken = "vmw_cloud_api_token"
defaultCSPEndpoint = "console.cloud.vmware.com"
defaultCSPEndpoint = "console.tanzu.broadcom.com"
selfManaged = "self_managed"
oidcIssuer = "oidc_issuer"
smUsername = "username"
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/ekscluster/resource_ekscluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func TestAcceptanceForMkpClusterResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")
setupHTTPMocks(t, clusterName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAcceptanceForGitRepositoryResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")
testConfig.setupHTTPMocks(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAcceptanceForHelmChratsDataSource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestAcceptanceForHelmFeatureResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")
os.Setenv("ORG_ID", "bc27608b-4809-4cac-9e04-778803963da2")

log.Println("Setting up the mock endpoints...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestAcceptanceForHelmReleaseResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")
os.Setenv("ORG_ID", "bc27608b-4809-4cac-9e04-778803963da2")

log.Println("Setting up the mock endpoints...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestAcceptanceForHelmRepositoryDataSource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAcceptanceForSecretResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestAcceptanceForKustomizationResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestAcceptanceForManagementClusterRegistrationResource(t *testing.T) {

os.Setenv(authctx.ServerEndpointEnvVar, endpoint)
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

setupHTTPMocks(t)
setUpOrgPolicyEndPointMocks(t, endpoint, tkgsSimpleName, clustermodel.NewVmwareTanzuManageV1alpha1CommonClusterKubernetesProviderType("VMWARE_TANZU_KUBERNETES_GRID_SERVICE"))
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/package/data_source_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestAcceptanceForPackageDataSource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
2 changes: 1 addition & 1 deletion internal/resources/packages/data_source_packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestAcceptanceForPackagesDataSource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestAcceptanceForMutationPolicyResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "play.abc.def.ghi.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

testConfig.ScopeHelperResources.OrgID = "dummy_org"
testConfig.setupHTTPMocks(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestAcceptanceForNetworkPolicyResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "play.abc.def.ghi.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

testConfig.ScopeHelperResources.OrgID = "dummy_org"
testConfig.setupHTTPMocks(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAcceptanceForProvisionerResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv(authctx.ServerEndpointEnvVar, endpoint)
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

setupHTTPMocks(t)
setUpProvisionerEndPointMocks(t, endpoint, provisionerName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAcceptanceForSourceSecretResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")
testConfig.setupHTTPMocks(t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAcceptanceForPackageInstallResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestAcceptanceForPackageRepositoryDataSource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestAcceptanceForPackageRepositoryResource(t *testing.T) {
os.Setenv("TF_ACC", "true")
os.Setenv("TMC_ENDPOINT", "dummy.tmc.mock.vmware.com")
os.Setenv("VMW_CLOUD_API_TOKEN", "dummy")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.cloud.vmware.com")
os.Setenv("VMW_CLOUD_ENDPOINT", "console.tanzu.broadcom.com")

log.Println("Setting up the mock endpoints...")

Expand Down

0 comments on commit 74e8faa

Please sign in to comment.