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

refactor how we set and update the taints on worker pools #4419

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

z0za
Copy link
Contributor

@z0za z0za commented Mar 17, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

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

        resource "ibm_container_vpc_cluster" "cluster" {
                name              = "tf-vpc-cluster-69"
                vpc_id            = "<vpcid>"
                flavor            = "bx2.4x16"
                worker_count      = 1
                resource_group_id = "<rgid>"
                zones {
                        subnet_id = "<subnetid>"
                        name      = "us-south-1"
                }
                wait_till = "normal"
                kms_instance_id = ""
                crk = ""
                kms_account_id = ""
                secondary_storage = "900gb.5iops-tier"
                taints {
                        key    = "key1"
                        value  = "value1"
                        effect = "NoSchedule"
                  }
        }

--- PASS: TestAccIBMContainerVpcClusterEnvvar (1454.66s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes      1456.638s


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

        resource "ibm_container_vpc_cluster" "cluster" {
                name              = "tf-vpc-worker-28"
                vpc_id            = "<vpcid>"
                flavor            = "bx2.4x16"
                worker_count      = 1
                resource_group_id = "<rgid>"
                zones {
                        subnet_id = "<subnetid>"
                        name      = "us-south-1"
                }
                wait_till = "normal"
                kms_instance_id = ""
                crk = ""
                kms_account_id = ""
                secondary_storage = "900gb.5iops-tier"
                taints {
                        key    = "key1"
                        value  = "value1"
                        effect = "NoSchedule"
                  }
        }


--- PASS: TestAccIBMContainerVpcClusterWorkerPoolEnvvar (2343.59s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/kubernetes      2345.098s



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

@z0za z0za force-pushed the workercount_update branch from 037de76 to 0bde342 Compare March 17, 2023 14:17
if err != nil {
return err
}
ClusterClient, err := meta.(conns.ClientSession).VpcContainerAPI()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to assume VpcContainerAPI here?

It looks like the classic resource will also use this function, or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I get it right, it is not necessarily VPC. the VpcContainerAPI contains v2 api calls and most of them vpc related.
the UpdateWorkerPoolTaints() is not a vpc only one:
https://containers.cloud.ibm.com/global/swagger-global-api/#/v2/v2SetWorkerPoolTaints

@z0za z0za marked this pull request as ready for review March 20, 2023 13:50
@hkantare hkantare merged commit 6da07cf into IBM-Cloud:master Mar 23, 2023
@z0za z0za deleted the workercount_update branch March 23, 2023 09:48
omaraibrahim pushed a commit to omaraibrahim/terraform-provider-ibm that referenced this pull request Jul 20, 2023
…4419)

* refactor updateWorkerpoolTaints

* test taint on vpc cluster and workerpool

* test for taint removal

---------

Co-authored-by: Zoltan Illes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants