diff --git a/Makefile b/Makefile index d669cc3..7aa0b36 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io NAMESPACE=robwafle NAME=tsm BINARY=terraform-provider-${NAME} -VERSION=0.0.83 +VERSION=0.0.84 OS_ARCH=linux_amd64 default: install diff --git a/client/cluster.go b/client/cluster.go index bab061d..bac431e 100644 --- a/client/cluster.go +++ b/client/cluster.go @@ -146,16 +146,16 @@ func (c *Client) DeleteCluster(ctx context.Context, id string, authToken *string return nil, err } - body, err := c.doRequest(req, authToken) - if err != nil { + _, err = c.doRequest(req, authToken) + if err != nil && err.Error() != "404" { return nil, err } - newCluster := Cluster{} - err = json.Unmarshal(body, &newCluster) - if err != nil { - return nil, err - } + // newCluster := Cluster{} + // err = json.Unmarshal(body, &newCluster) + // if err != nil { + // return nil, err + // } - return &newCluster, nil + return nil, nil } diff --git a/client/globalnamespace.go b/client/globalnamespace.go index 38c039a..27e6ede 100644 --- a/client/globalnamespace.go +++ b/client/globalnamespace.go @@ -124,7 +124,7 @@ func (c *Client) DeleteGlobalNamespace(ctx context.Context, id string, authToken } _, err = c.doRequest(req, authToken) - if err != nil { + if err != nil && err.Error() != "404" { return nil, err } diff --git a/examples/aks_cluster/README.md b/examples/aks_cluster/README.md index 39c33fc..a8085e2 100644 --- a/examples/aks_cluster/README.md +++ b/examples/aks_cluster/README.md @@ -6,20 +6,9 @@ TSM_APIKEY: # command to rebuild, install and test ``` -pushd ../../terraform-provider-tsm ; make install && popd; rm .terraform.lock.hcl ; terraform init -upgrade ; terraform plan +pushd ../.. ; if make build; then echo "built!"; else popd; fi && popd && rm tflog.json ; terraform plan -out=tfplan ``` -# clean up if it all goes wrong -``` -rm terraform.tfstate.backup; rm terraform.tfstate; rm tfplan; rm tfplan.txt ; export TF_LOG=TRACE; rm .terraform.lock.hcl ; -``` - -# plan, if you get a checksum error you didn't update the version in Makefile. -``` -rm terraform.tfstate.backup; rm terraform.tfstate; rm tfplan ; export TF_LOG=TRACE; rm .terraform.lock.hcl ; terraform init -upgrade ; terraform plan -out=tfplan; terraform show tfplan | tee tfplan.txt; -``` - - # apply ``` terraform apply -input=false tfplan diff --git a/examples/aks_cluster/tsm-globalnamespace.tf b/examples/aks_cluster/tsm-globalnamespace.tf index d042e7a..0b755c0 100644 --- a/examples/aks_cluster/tsm-globalnamespace.tf +++ b/examples/aks_cluster/tsm-globalnamespace.tf @@ -1,9 +1,9 @@ resource "tsm_globalnamespace" "default" { depends_on = [tsm_cluster.aks] - name = "global-default" - display_name = "global-default" - domain_name = "global-default.gns" + name = "global-default-aks" + display_name = "global-default-aks" + domain_name = "global-default-aks.gns" use_shared_gateway = true mtls_enforced = true api_discovery_enabled = true @@ -27,7 +27,6 @@ data "tsm_globalnamespace" "default" { } output "tsm_globalnamespace" { - value = data.tsm_globalnamespace.default }