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

Clarify worker_pool host_label usage and fix blank entry in array #4189

Merged
merged 5 commits into from
Nov 28, 2022
Merged

Clarify worker_pool host_label usage and fix blank entry in array #4189

merged 5 commits into from
Nov 28, 2022

Conversation

bhpratt
Copy link
Contributor

@bhpratt bhpratt commented Nov 18, 2022

Four main changes:

  • change worker pool host label to force new. It is not possible to update host labels on an existing worker pool after creation,
  • fix length of array that creates a blank entry on read. example:
  ~ resource "ibm_satellite_cluster_worker_pool" "create_wp" {
      ~ host_labels        = [
          - "",
            # (2 unchanged elements hidden)
        ]
        id                 = "cdqf4juw0bl3s7phl9vg/cdqf4juw0bl3s7phl9vg-bddb143"
        name               = "test"
  • update docs to clarify correct formatting of host labels
  • update test due to errors w/duplicate ibm provider. since now using the default provider, switching regions to us-south

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/satellite TESTARGS='-run=TestAccSatelliteClusterWorkerPool_Basic'
=== RUN   TestAccSatelliteClusterWorkerPool_Basic
--- PASS: TestAccSatelliteClusterWorkerPool_Basic (2176.31s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite       2177.473s
make testacc TEST=./ibm/service/satellite TESTARGS='-run=TestAccSatelliteCluster_Basic'

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./ibm/service/satellite -v -run=TestAccSatelliteCluster_Basic -timeout 700m
=== RUN   TestAccSatelliteCluster_Basic
--- PASS: TestAccSatelliteCluster_Basic (4162.49s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/satellite       4163.750s

@bhpratt bhpratt marked this pull request as ready for review November 21, 2022 19:42
@@ -3348,7 +3348,7 @@ func FlattenSatelliteHosts(hostList []kubernetesserviceapiv1.MultishiftQueueNode
}

func FlattenWorkerPoolHostLabels(hostLabels map[string]string) *schema.Set {
mapped := make([]string, len(hostLabels))
mapped := make([]string, len(hostLabels)-1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Even if user doesn't provide operating_system we always get "os" label ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. The service will automatically assign an OS label based on the operating system of the worker pool. Current options are RHEL7, RHEL8, and RHCOS.

@hkantare hkantare merged commit bf9ef14 into IBM-Cloud:master Nov 28, 2022
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.

2 participants