From 107c3df8aa13e27f4e7da21fd763dd96202d8661 Mon Sep 17 00:00:00 2001 From: Dylan-Christopherson Date: Thu, 9 Jan 2025 09:00:29 -0600 Subject: [PATCH] Updates --- examples/ibm-sdsaas/README.md | 6 +---- ibm/conns/config.go | 21 ++++++---------- .../sdsaas/resource_ibm_sds_volume_test.go | 25 +++---------------- 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/examples/ibm-sdsaas/README.md b/examples/ibm-sdsaas/README.md index f5ad02f95e..70fc61895e 100644 --- a/examples/ibm-sdsaas/README.md +++ b/examples/ibm-sdsaas/README.md @@ -79,11 +79,7 @@ resource "ibm_sds_host" "sds_host_instance" { ## Assumptions -1. TODO - -## Notes - -1. TODO +The `IBMCLOUD_SDS_ENDPOINT` is required to be set by the user before running the terraform commands. This is the endpoint provided to customers to perform operations against their service. ## Requirements diff --git a/ibm/conns/config.go b/ibm/conns/config.go index ee876025a9..e1cd2ee356 100644 --- a/ibm/conns/config.go +++ b/ibm/conns/config.go @@ -8,7 +8,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/IBM/cloud-db2-go-sdk/db2saasv1" "io" "io/ioutil" "log" @@ -18,6 +17,8 @@ import ( "strings" "time" + "github.com/IBM/cloud-db2-go-sdk/db2saasv1" + // Added code for the Power Colo Offering "github.com/IBM-Cloud/container-services-go-sdk/kubernetesserviceapiv1" @@ -679,15 +680,13 @@ type clientSession struct { ibmCloudLogsRoutingClient *ibmcloudlogsroutingv0.IBMCloudLogsRoutingV0 ibmCloudLogsRoutingClientErr error -<<<<<<< HEAD // db2 saas db2saasClient *db2saasv1.Db2saasV1 db2saasClientErr error -======= + // Software Defined Storage sdsaasClient *sdsaasv1.SdsaasV1 sdsaasClientErr error ->>>>>>> f12d12b17 (Add SDSaaS to terraform provider) } // Usage Reports @@ -1292,16 +1291,7 @@ func (session clientSession) ProjectV1() (*project.ProjectV1, error) { return session.projectClient, session.projectClientErr } -<<<<<<< HEAD // MQaaS -======= -// sdsaas -func (session clientSession) SdsaasV1() (*sdsaasv1.SdsaasV1, error) { - return session.sdsaasClient, session.sdsaasClientErr -} - -// MQ on Cloud ->>>>>>> f12d12b17 (Add SDSaaS to terraform provider) func (session clientSession) MqcloudV1() (*mqcloudv1.MqcloudV1, error) { if session.mqcloudClientErr != nil { sessionMqcloudClient := session.mqcloudClient @@ -1311,6 +1301,11 @@ func (session clientSession) MqcloudV1() (*mqcloudv1.MqcloudV1, error) { return session.mqcloudClient.Clone(), nil } +// sdsaas +func (session clientSession) SdsaasV1() (*sdsaasv1.SdsaasV1, error) { + return session.sdsaasClient, session.sdsaasClientErr +} + // VMware as a Service API func (session clientSession) VmwareV1() (*vmwarev1.VmwareV1, error) { return session.vmwareClient, session.vmwareClientErr diff --git a/ibm/service/sdsaas/resource_ibm_sds_volume_test.go b/ibm/service/sdsaas/resource_ibm_sds_volume_test.go index b3603ab70c..5e847877b9 100644 --- a/ibm/service/sdsaas/resource_ibm_sds_volume_test.go +++ b/ibm/service/sdsaas/resource_ibm_sds_volume_test.go @@ -24,7 +24,6 @@ func TestAccIBMSdsVolumeBasic(t *testing.T) { var conf sdsaasv1.Volume capacity := fmt.Sprintf("%d", acctest.RandIntRange(1, 5)) name := "terraform-test-1" - capacityUpdate := fmt.Sprintf("%d", acctest.RandIntRange(6, 10)) nameUpdate := "terraform-test-name-updated" resource.Test(t, resource.TestCase{ @@ -41,16 +40,9 @@ func TestAccIBMSdsVolumeBasic(t *testing.T) { ), }, resource.TestStep{ - Config: testAccCheckIBMSdsVolumeConfigBasic(capacityUpdate, name), + Config: testAccCheckIBMSdsVolumeConfigBasic(capacity, nameUpdate), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacityUpdate), - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "name", name), - ), - }, - resource.TestStep{ - Config: testAccCheckIBMSdsVolumeConfigBasic(capacityUpdate, nameUpdate), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacityUpdate), + resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacity), resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "name", nameUpdate), ), }, @@ -63,7 +55,6 @@ func TestAccIBMSdsVolumeAllArgs(t *testing.T) { hostnqnstring := "nqn.2014-06.org:9345" capacity := fmt.Sprintf("%d", acctest.RandIntRange(1, 5)) name := "terraform-test-name-1" - capacityUpdate := fmt.Sprintf("%d", acctest.RandIntRange(6, 10)) nameUpdate := "terraform-test-name-updated" resource.Test(t, resource.TestCase{ @@ -81,18 +72,10 @@ func TestAccIBMSdsVolumeAllArgs(t *testing.T) { ), }, resource.TestStep{ - Config: testAccCheckIBMSdsVolumeConfig(hostnqnstring, capacityUpdate, name), + Config: testAccCheckIBMSdsVolumeConfig(hostnqnstring, capacity, nameUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "hostnqnstring", hostnqnstring), - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacityUpdate), - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "name", name), - ), - }, - resource.TestStep{ - Config: testAccCheckIBMSdsVolumeConfig(hostnqnstring, capacityUpdate, nameUpdate), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "hostnqnstring", hostnqnstring), - resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacityUpdate), + resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "capacity", capacity), resource.TestCheckResourceAttr("ibm_sds_volume.sds_volume_instance", "name", nameUpdate), ), },