IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
336 stars 645 forks source link

move wait_till logic into function, integrate it into vpc_cluster datasource, remove unused parameters #5476

Open z0za opened 2 days ago

z0za commented 2 days ago

Community Note

Relates OR Closes #0000

Output from acceptance testing:

% make testacc TEST=./ibm/service/kubernetes TESTARGS='-run=TestAccIBMContainerVpcClusterBasic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./ibm/service/kubernetes -v -run=TestAccIBMContainerVpcClusterBasic -timeout 700m
....
=== RUN   TestAccIBMContainerVpcClusterBasic
--- PASS: TestAccIBMContainerVpcClusterBasic (3292.49s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes      3295.446s

% make testacc TEST=./ibm/service/kubernetes TESTARGS='-run=TestAccIBMContainerVPCClusterDataSource_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./ibm/service/kubernetes -v -run=TestAccIBMContainerVPCClusterDataSource_basic -timeout 700m
....
=== RUN   TestAccIBMContainerVPCClusterDataSource_basic

--- PASS: TestAccIBMContainerVPCClusterDataSource_basic (3361.55s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes      3364.789s

...

tested it manually too:
without wait:
% terraform apply -var cluster_name=<clustername>
data.ibm_container_vpc_cluster.testacc_ds_cluster: Reading...
data.ibm_container_vpc_cluster.testacc_ds_cluster: Read complete after 7s [id=<clusterid>]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are
needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

and with the wait:
% terraform apply -var cluster_name=<clustername>
data.ibm_container_vpc_cluster.testacc_ds_cluster: Reading...
data.ibm_container_vpc_cluster.testacc_ds_cluster: Still reading... [10s elapsed]
.....
data.ibm_container_vpc_cluster.testacc_ds_cluster: Still reading... [15m40s elapsed]
data.ibm_container_vpc_cluster.testacc_ds_cluster: Read complete after 15m46s [id=<clusterid>]
data.ibm_container_cluster_config.cluster_config: Reading...
data.ibm_container_cluster_config.cluster_config: Read complete after 2s [id=<clusterid>]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are
needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.