diff --git a/go.mod b/go.mod index 3865bc3067..0917694f78 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/IBM-Cloud/bluemix-go v0.0.0-20220523145737-34645883de47 - github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 + github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220622142911-811d18c8c775 github.com/IBM-Cloud/power-go-client v1.1.10 github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca github.com/IBM/appconfiguration-go-admin-sdk v0.2.3 diff --git a/go.sum b/go.sum index b5394d0b23..cfba2908d4 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20220523145737-34645883de47 h1:lpClRYyGuS github.com/IBM-Cloud/bluemix-go v0.0.0-20220523145737-34645883de47/go.mod h1:tfNN3lCKuA2+SQvndt0+5CjPr2qn/wdNLjrue1GrOhY= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62 h1:MOkcr6qQGk4tY542ZJ1DggVh2WUP72EEyLB79llFVH8= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20210705152127-41ca00fc9a62/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= +github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220622142911-811d18c8c775 h1:hTj8cRqWv76Io/j+fUKq0Rrq1AjBA7uvRLs634ea/+8= +github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20220622142911-811d18c8c775/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= github.com/IBM-Cloud/power-go-client v1.1.10 h1:NUGZwF5V0j2lFurA5LaigsYyOKDKwz4M0sCpm+YIbig= github.com/IBM-Cloud/power-go-client v1.1.10/go.mod h1:Qfx0fNi+9hms+xu9Z6Euhu9088ByW6C/TCMLECTRWNE= diff --git a/ibm/service/satellite/data_source_ibm_satellite_location.go b/ibm/service/satellite/data_source_ibm_satellite_location.go index e281bd1b27..3c9ea7e58a 100644 --- a/ibm/service/satellite/data_source_ibm_satellite_location.go +++ b/ibm/service/satellite/data_source_ibm_satellite_location.go @@ -36,6 +36,11 @@ func DataSourceIBMSatelliteLocation() *schema.Resource { Computed: true, Description: "A description of the new Satellite location", }, + "coreos_enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "If Red Hat CoreOS features are enabled within the Satellite location", + }, "logging_account_id": { Type: schema.TypeString, Computed: true, @@ -172,6 +177,7 @@ func dataSourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{} d.SetId(*instance.ID) d.Set("location", location) d.Set("description", *instance.Description) + d.Set("coreos_enabled", *instance.CoreosEnabled) d.Set("zones", instance.WorkerZones) d.Set("managed_from", *instance.Datacenter) d.Set("crn", *instance.Crn) diff --git a/ibm/service/satellite/resource_ibm_satellite_location.go b/ibm/service/satellite/resource_ibm_satellite_location.go index a06d7a168a..e605de1243 100644 --- a/ibm/service/satellite/resource_ibm_satellite_location.go +++ b/ibm/service/satellite/resource_ibm_satellite_location.go @@ -98,6 +98,12 @@ func ResourceIBMSatelliteLocation() *schema.Resource { Optional: true, Description: "A description of the new Satellite location", }, + "coreos_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "Enable Red Hat CoreOS features within the Satellite location", + }, "logging_account_id": { Type: schema.TypeString, Optional: true, @@ -235,6 +241,10 @@ func resourceIBMSatelliteLocationCreate(d *schema.ResourceData, meta interface{} sateLocZone := d.Get(sateLocZone).(string) createSatLocOptions.Location = &sateLocZone + if v, ok := d.GetOk("coreos_enabled"); ok { + coreosEnabled := v.(bool) + createSatLocOptions.CoreosEnabled = coreosEnabled + } if v, ok := d.GetOk("cos_config"); ok { createSatLocOptions.CosConfig = flex.ExpandCosConfig(v.([]interface{})) } @@ -317,6 +327,10 @@ func resourceIBMSatelliteLocationRead(d *schema.ResourceData, meta interface{}) d.Set("description", *instance.Description) } + if instance.CoreosEnabled != nil { + d.Set("coreos_enabled", *instance.CoreosEnabled) + } + if instance.Datacenter != nil { d.Set(sateLocZone, *instance.Datacenter) } diff --git a/ibm/service/satellite/resource_ibm_satellite_location_test.go b/ibm/service/satellite/resource_ibm_satellite_location_test.go index 2015136190..19c534d910 100644 --- a/ibm/service/satellite/resource_ibm_satellite_location_test.go +++ b/ibm/service/satellite/resource_ibm_satellite_location_test.go @@ -20,6 +20,7 @@ func TestAccSatelliteLocation_Basic(t *testing.T) { var instance string name := fmt.Sprintf("tf-satellitelocation-%d", acctest.RandIntRange(10, 100)) managed_from := "wdc04" + coreos_enabled := "true" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -28,11 +29,12 @@ func TestAccSatelliteLocation_Basic(t *testing.T) { Steps: []resource.TestStep{ { - Config: testAccCheckSatelliteLocationCreate(name, managed_from), + Config: testAccCheckSatelliteLocationCreate(name, managed_from, coreos_enabled), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSatelliteLocationExists("ibm_satellite_location.location", instance), resource.TestCheckResourceAttr("ibm_satellite_location.location", "location", name), resource.TestCheckResourceAttr("ibm_satellite_location.location", "managed_from", managed_from), + resource.TestCheckResourceAttr("ibm_satellite_location.location", "coreos_enabled", coreos_enabled), ), }, }, @@ -43,6 +45,7 @@ func TestAccSatelliteLocation_Import(t *testing.T) { var instance string name := fmt.Sprintf("tf_location_%d", acctest.RandIntRange(10, 100)) managed_from := "wdc04" + coreos_enabled := "true" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -51,7 +54,7 @@ func TestAccSatelliteLocation_Import(t *testing.T) { Steps: []resource.TestStep{ { - Config: testAccCheckSatelliteLocationCreate(name, managed_from), + Config: testAccCheckSatelliteLocationCreate(name, managed_from, coreos_enabled), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSatelliteLocationExists("ibm_satellite_location.location", instance), resource.TestCheckResourceAttr("ibm_satellite_location.location", "location", name), @@ -123,7 +126,7 @@ func testAccCheckSatelliteLocationDestroy(s *terraform.State) error { return nil } -func testAccCheckSatelliteLocationCreate(name, managed_from string) string { +func testAccCheckSatelliteLocationCreate(name, managed_from string, coreos_enabled string) string { return fmt.Sprintf(` data "ibm_resource_group" "res_group" { @@ -133,11 +136,12 @@ func testAccCheckSatelliteLocationCreate(name, managed_from string) string { resource "ibm_satellite_location" "location" { location = "%s" managed_from = "%s" + coreos_enabled = "%s" description = "test" zones = ["us-east-1", "us-east-2", "us-east-3"] resource_group_id = data.ibm_resource_group.res_group.id tags = ["env:dev"] } -`, name, managed_from) +`, name, managed_from, coreos_enabled) } diff --git a/website/docs/d/satellite_location.html.markdown b/website/docs/d/satellite_location.html.markdown index 1c799a7a92..614d034919 100644 --- a/website/docs/d/satellite_location.html.markdown +++ b/website/docs/d/satellite_location.html.markdown @@ -26,6 +26,7 @@ Review the argument references that you can specify for your data source. ## Attribute reference In addition to all argument reference list, you can access the following attribute reference after your resource is created. +- `coreos_enabled` - (Bool) If Red Hat CoreOS features are enabled within the Satellite location. - `crn` - (String) The CRN for this satellite location. - `created_on` - (Timestamp) The created time of the satellite location. - `description` - (String) Description of the new Satellite location. diff --git a/website/docs/r/satellite_location.html.markdown b/website/docs/r/satellite_location.html.markdown index 8be4ad3225..e5241a334a 100644 --- a/website/docs/r/satellite_location.html.markdown +++ b/website/docs/r/satellite_location.html.markdown @@ -56,6 +56,7 @@ The `ibm_satellite_location` provides the following [Timeouts](https://www.terra ## Argument reference Review the argument references that you can specify for your resource. +- `coreos_enabled` - (Optional, Bool) Enable Red Hat CoreOS features within the Satellite location. - `cos_config` - (Optional, List) The IBM Cloud Object Storage bucket configuration details. Nested cos_config blocks have the following structure. Nested scheme for `cos_config`: