diff --git a/ibm/flex/structures.go b/ibm/flex/structures.go index 72b9f62116..a4c743ae2f 100644 --- a/ibm/flex/structures.go +++ b/ibm/flex/structures.go @@ -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) idx := 0 for k, v := range hostLabels { if strings.HasPrefix(k, "os") { diff --git a/ibm/service/satellite/resource_ibm_satellite_cluster_test.go b/ibm/service/satellite/resource_ibm_satellite_cluster_test.go index 4e52633bf0..43d31fd28c 100644 --- a/ibm/service/satellite/resource_ibm_satellite_cluster_test.go +++ b/ibm/service/satellite/resource_ibm_satellite_cluster_test.go @@ -23,9 +23,9 @@ func TestAccSatelliteCluster_Basic(t *testing.T) { locationName := fmt.Sprintf("tf-satellitelocation-%d", acctest.RandIntRange(10, 100)) managed_from := "wdc04" operatingSystem := "REDHAT_7_64" - zones := []string{"us-east-1", "us-east-2", "us-east-3"} + zones := []string{"us-south-1", "us-south-2", "us-south-3"} resource_group := "default" - region := "us-east" + region := "us-south" resource_prefix := "tf-satellite" host_provider := "ibm" publicKey := strings.TrimSpace(` @@ -55,9 +55,9 @@ func TestAccSatelliteCluster_Import(t *testing.T) { locationName := fmt.Sprintf("tf-satellitelocation-%d", acctest.RandIntRange(10, 100)) managed_from := "wdc04" operatingSystem := "REDHAT_7_64" - zones := []string{"us-east-1", "us-east-2", "us-east-3"} + zones := []string{"us-south-1", "us-south-2", "us-south-3"} resource_group := "default" - region := "us-east" + region := "us-south" resource_prefix := "tf-satellite" host_provider := "ibm" publicKey := strings.TrimSpace(` @@ -147,14 +147,10 @@ func testAccCheckSatelliteClusterDestroy(s *terraform.State) error { func testAccCheckSatelliteClusterCreate(clusterName, locationName, managed_from, operatingSystem, resource_group, resource_prefix, region, publicKey, host_provider string, zones []string) string { return fmt.Sprintf(` - provider "ibm" { - region = "us-east" - } - variable "location_zones" { description = "Allocate your hosts across these three zones" type = list(string) - default = ["us-east-1", "us-east-2", "us-east-3"] + default = ["us-south-1", "us-south-2", "us-south-3"] } data "ibm_is_image" "rhel7" { diff --git a/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go b/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go index e61b53c68c..e94f270b59 100644 --- a/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go +++ b/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool.go @@ -150,6 +150,7 @@ func ResourceIBMSatelliteClusterWorkerPool() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, + ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: flex.ResourceIBMVPCHash, Description: "Labels that describe a Satellite host", diff --git a/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_test.go b/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_test.go index 82d2612ad5..9b7d163091 100644 --- a/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_test.go +++ b/ibm/service/satellite/resource_ibm_satellite_cluster_worker_pool_test.go @@ -146,14 +146,10 @@ func testAccCheckSatelliteClusterWorkerPoolDestroy(s *terraform.State) error { func testAccCheckSatelliteClusterWorkerPoolCreate(clusterName, locationName, operatingSystem, workerPoolName, resource_prefix string) string { return fmt.Sprintf(` - provider "ibm" { - region = "us-east" - } - variable "location_zones" { description = "Allocate your hosts across these three zones" type = list(string) - default = ["us-east-1", "us-east-2", "us-east-3"] + default = ["us-south-1", "us-south-2", "us-south-3"] } resource "ibm_satellite_location" "location" { @@ -186,7 +182,7 @@ func testAccCheckSatelliteClusterWorkerPoolCreate(clusterName, locationName, ope name = "%s-subnet-${count.index}" vpc = ibm_is_vpc.satellite_vpc.id total_ipv4_address_count = 256 - zone = "us-east-${count.index + 1}" + zone = "us-south-${count.index + 1}" } resource "ibm_is_ssh_key" "satellite_ssh" { @@ -199,7 +195,7 @@ func testAccCheckSatelliteClusterWorkerPoolCreate(clusterName, locationName, ope name = "%s-instance-${count.index}" vpc = ibm_is_vpc.satellite_vpc.id - zone = "us-east-${count.index + 1}" + zone = "us-south-${count.index + 1}" image = data.ibm_is_image.rhel7.id profile = "mx2-8x64" keys = [ibm_is_ssh_key.satellite_ssh.id] diff --git a/website/docs/r/satellite_cluster.html.markdown b/website/docs/r/satellite_cluster.html.markdown index 25bce4ca6b..800b36fb55 100644 --- a/website/docs/r/satellite_cluster.html.markdown +++ b/website/docs/r/satellite_cluster.html.markdown @@ -53,7 +53,7 @@ Review the argument references that you can specify for your resource. - `zones` - (Optional, Array of Strings) The name of the zones to create the default worker pool. - `worker_count` - (Optional, String) The number of worker nodes to create per zone in the default worker pool. - `enable_config_admin` - (Optional, Bool) User provided value to indicate opt-in agreement to SatCon admin agent. -- `host_labels` - (Optional, Array of Strings) Key-value pairs to label the host, such as `cpu=4` to describe the host capabilities. +- `host_labels` - (Optional, Set(Strings)) Labels to add to the default worker pool, formatted as `cpu:4` key-value pairs. Satellite uses host labels to automatically assign hosts to worker pools with matching labels. - `default_worker_pool_labels` - (Optional, String) The labels on all the workers in the default worker pool. - `pull_secret` - (Optional, String) The Red Hat pull secret to create the OpenShift cluster. - `zone` - (Optional, List) The zone for the worker pool in a multi-zone cluster. diff --git a/website/docs/r/satellite_cluster_worker_pool.html.markdown b/website/docs/r/satellite_cluster_worker_pool.html.markdown index 8642361885..d9fb46339c 100644 --- a/website/docs/r/satellite_cluster_worker_pool.html.markdown +++ b/website/docs/r/satellite_cluster_worker_pool.html.markdown @@ -70,7 +70,7 @@ Review the argument references that you can specify for your resource. Nested scheme for `zones`: - `id` - (Required, String) The name of the zone. -- `host_labels` - (Optional, Array of Strings) Key-value pairs to label the host, such as cpu=4 to describe the host capabilities. +- `host_labels` - (Optional, Set(Strings)) Labels to add to the worker pool, formatted as `cpu:4` key-value pairs. Satellite uses host labels to automatically assign hosts to worker pools with matching labels. - `worker_pool_labels` - Labels on all the workers in the worker pool. - `resource_group_id` - (Optional, Forces new resource, String) The ID of the resource group. You can retrieve the value from data source - `entitlement` - (Optional, String) The openshift cluster entitlement avoids the OCP licence charges incurred. Use cloud paks with OCP Licence entitlement to add the Openshift cluster worker pool.