Skip to content

Commit

Permalink
Merge branch 'master' into migration-vpc-go-sdk49
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwal-ibm committed Mar 22, 2024
2 parents def4c19 + dc2f51a commit 796ab10
Show file tree
Hide file tree
Showing 18 changed files with 425 additions and 1,025 deletions.
2 changes: 0 additions & 2 deletions examples/ibm-catalog-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ resource "ibm_cm_catalog" "cm_catalog_instance" {
resource_group_id = var.cm_catalog_resource_group_id
owning_account = var.cm_catalog_owning_account
catalog_filters = var.cm_catalog_catalog_filters
syndication_settings = var.cm_catalog_syndication_settings
kind = var.cm_catalog_kind
metadata = var.cm_catalog_metadata
}
Expand Down Expand Up @@ -225,7 +224,6 @@ data "cm_offering_instance" "cm_offering_instance_instance" {
| resource_group_id | Resource group id the catalog is owned by. | `string` | false |
| owning_account | Account that owns catalog. | `string` | false |
| catalog_filters | Filters for account and catalog filters. | `` | false |
| syndication_settings | Feature information. | `` | false |
| kind | Kind of catalog. Supported kinds are offering and vpe. | `string` | false |
| metadata | Catalog specific metadata. | `map()` | false |
| catalog_id | Catalog identifier. | `string` | true |
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ require (
github.com/IBM/eventstreams-go-sdk v1.4.0
github.com/IBM/go-sdk-core/v3 v3.2.4
github.com/IBM/go-sdk-core/v5 v5.16.1
github.com/IBM/ibm-cos-sdk-go v1.10.0
github.com/IBM/ibm-cos-sdk-go-config v1.2.0
github.com/IBM/ibm-cos-sdk-go v1.10.1
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta
github.com/IBM/keyprotect-go-client v0.12.2
github.com/IBM/networking-go-sdk v0.45.0
github.com/IBM/platform-services-go-sdk v0.60.0
github.com/IBM/platform-services-go-sdk v0.61.2
github.com/IBM/project-go-sdk v0.2.1
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/scc-go-sdk/v5 v5.1.5
Expand Down Expand Up @@ -62,6 +62,7 @@ require (
)

require (
github.com/IBM/go-sdk-core v1.1.0
github.com/IBM/mqcloud-go-sdk v0.0.4
github.com/IBM/sarama v1.41.2
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749
Expand Down
17 changes: 8 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ github.com/IBM/event-notifications-go-admin-sdk v0.4.0 h1:7nqtybv8GNVjuB5QBfx/ke
github.com/IBM/event-notifications-go-admin-sdk v0.4.0/go.mod h1:m6WD+q9AHJhybK929vOK8Kfx4BsKO7AmROKRpR2uQP8=
github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM=
github.com/IBM/eventstreams-go-sdk v1.4.0/go.mod h1:2tuAxaYLctfqfr5jvyqSrxxEQGMwYPm3yJGWSj85YVQ=
github.com/IBM/go-sdk-core/v3 v3.0.0/go.mod h1:JI5NS2+iCoY/D8Oq3JNEZNA7qO42agu6fnaUmDsRcJA=
github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY=
github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY=
github.com/IBM/go-sdk-core/v3 v3.2.4 h1:WKYJYYKlZnw1y/gM+Qbf5EQVAL9xaoD54+ooJZz/iBQ=
github.com/IBM/go-sdk-core/v3 v3.2.4/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0=
github.com/IBM/go-sdk-core/v5 v5.0.0/go.mod h1:vyNdbFujJtdTj9HbihtvKwwS3k/GKSKpOx9ZIQ6MWDY=
Expand All @@ -142,11 +143,10 @@ github.com/IBM/go-sdk-core/v5 v5.9.5/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV
github.com/IBM/go-sdk-core/v5 v5.10.2/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI=
github.com/IBM/go-sdk-core/v5 v5.16.1 h1:vAgOxRvaXD5AmgwR7dlstjT1JFE4BA4lPcGsEFZOKGs=
github.com/IBM/go-sdk-core/v5 v5.16.1/go.mod h1:aojBkkq4HXkOYdn7YZ6ve8cjPWHdcB3tt8v0b9Cbac8=
github.com/IBM/ibm-cos-sdk-go v1.3.1/go.mod h1:YLBAYobEA8bD27P7xpMwSQeNQu6W3DNBtBComXrRzRY=
github.com/IBM/ibm-cos-sdk-go v1.10.0 h1:/2VIev2/jBei39OqU2+nSZQnoWJ+KtkiSAIDkqsd7uU=
github.com/IBM/ibm-cos-sdk-go v1.10.0/go.mod h1:C8KRTRaoD3CWPPBOa6FCOpdh0ZMlUjKAAA4i3F+Q/sc=
github.com/IBM/ibm-cos-sdk-go-config v1.2.0 h1:1E93234yZgVS0ntm7eUwVb3h0AAayPGcxEhhizEN1LE=
github.com/IBM/ibm-cos-sdk-go-config v1.2.0/go.mod h1:Wetfgv6m1xyuzpZLQTTLIBsWstxjYa15h+Utj7x53Dk=
github.com/IBM/ibm-cos-sdk-go v1.10.1 h1:vQCsu61OHRVF2lL6ah+m3AmUlhnYGkI1qogukCEFULs=
github.com/IBM/ibm-cos-sdk-go v1.10.1/go.mod h1:zhcgfL2YG5DVaI5R2F6oYO2DYnvwW14vpcpFq+ybhXU=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4 h1:fvy/cMKn/3BngdxaL5dXaSlUuzTANY42VuVQuW0NEYE=
github.com/IBM/ibm-cos-sdk-go-config/v2 v2.0.4/go.mod h1:Pam4aWm9Ve/pqAVrPW8nm2yCXq0h9LDeQ1Iacx5g9rU=
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1 h1:T5UwRKKd+BoaPZ7UIlpJrzXzVTUEs8HcxwQ3pCIbORs=
github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1/go.mod h1:M2JyuyeWHPtgGNeezr6YqVRuaav2MpY8Ha4QrEYvMoI=
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta h1:P1fdIfKsD9xvJQ5MHIEztPS9yfNf9x+VDTamaYcmqcs=
Expand All @@ -158,8 +158,8 @@ github.com/IBM/mqcloud-go-sdk v0.0.4 h1:gqMpoU5a0qJ0GETG4PQrkgeEEoaQLvbxRJnEe6yt
github.com/IBM/mqcloud-go-sdk v0.0.4/go.mod h1:gQptHC6D+rxfg0muRFFGvTDmvl4YfiDE0uXkaRRewRk=
github.com/IBM/networking-go-sdk v0.45.0 h1:tYgDhVDpgKvELNY7tcodbZ4ny9fatpEWM6PwtQcDe20=
github.com/IBM/networking-go-sdk v0.45.0/go.mod h1:NnJPA1e5GWr5opJe+5Hs6e1G6RcBIFz64TrkZsdnSp8=
github.com/IBM/platform-services-go-sdk v0.60.0 h1:DXCp5hAtFO6quUmb5qKeosQw0ln/fYE5nrKjgXbiSBU=
github.com/IBM/platform-services-go-sdk v0.60.0/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE=
github.com/IBM/platform-services-go-sdk v0.61.2 h1:yQ7sBmowpxlyKPRZChFBqlGn1nZO7ScPc6QqjUDdbYA=
github.com/IBM/platform-services-go-sdk v0.61.2/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE=
github.com/IBM/project-go-sdk v0.2.1 h1:Xo7ITrfyfVm0eCsaC2SADlhcEjqjx9rtU37fwnzGMCI=
github.com/IBM/project-go-sdk v0.2.1/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
Expand Down Expand Up @@ -1222,7 +1222,6 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
Expand Down
2 changes: 1 addition & 1 deletion ibm/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/IBM/cloud-databases-go-sdk/clouddatabasesv5"
"github.com/IBM/container-registry-go-sdk/containerregistryv1"
"github.com/IBM/go-sdk-core/v5/core"
cosconfig "github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1"
cosconfig "github.com/IBM/ibm-cos-sdk-go-config/v2/resourceconfigurationv1"
kp "github.com/IBM/keyprotect-go-client"
"github.com/IBM/mqcloud-go-sdk/mqcloudv1"
cisalertsv1 "github.com/IBM/networking-go-sdk/alertsv1"
Expand Down
2 changes: 1 addition & 1 deletion ibm/flex/structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM/cloud-databases-go-sdk/clouddatabasesv5"
"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/ibm-cos-sdk-go-config/resourceconfigurationv1"
"github.com/IBM/ibm-cos-sdk-go-config/v2/resourceconfigurationv1"
"github.com/IBM/ibm-cos-sdk-go/aws"
"github.com/IBM/ibm-cos-sdk-go/service/s3"
kp "github.com/IBM/keyprotect-go-client"
Expand Down
4 changes: 3 additions & 1 deletion ibm/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,8 @@ func Provider() *schema.Provider {
"ibm_satellite_cluster_worker_pool_zone_attachment": satellite.ResourceIbmSatelliteClusterWorkerPoolZoneAttachment(),

// Added for Resource Tag
"ibm_resource_tag": globaltagging.ResourceIBMResourceTag(),
"ibm_resource_tag": globaltagging.ResourceIBMResourceTag(),
"ibm_resource_access_tag": globaltagging.ResourceIBMResourceAccessTag(),

// Atracker
"ibm_atracker_target": atracker.ResourceIBMAtrackerTarget(),
Expand Down Expand Up @@ -1600,6 +1601,7 @@ func Validator() validate.ValidatorDict {
"ibm_resource_key": resourcecontroller.ResourceIBMResourceKeyValidator(),
"ibm_is_virtual_endpoint_gateway": vpc.ResourceIBMISEndpointGatewayValidator(),
"ibm_resource_tag": globaltagging.ResourceIBMResourceTagValidator(),
"ibm_resource_access_tag": globaltagging.ResourceIBMResourceAccessTagValidator(),
"ibm_satellite_location": satellite.ResourceIBMSatelliteLocationValidator(),
"ibm_satellite_cluster": satellite.ResourceIBMSatelliteClusterValidator(),
"ibm_pi_volume": power.ResourceIBMPIVolumeValidator(),
Expand Down
253 changes: 0 additions & 253 deletions ibm/service/catalogmanagement/data_source_ibm_cm_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,155 +220,6 @@ func DataSourceIBMCmCatalog() *schema.Resource {
},
},
},
"syndication_settings": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Feature information.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"remove_related_components": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "Remove related components.",
},
"clusters": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Syndication clusters.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"region": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster region.",
},
"id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster ID.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster name.",
},
"resource_group_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Resource group ID.",
},
"type": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Syndication type.",
},
"namespaces": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Syndicated namespaces.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"all_namespaces": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "Syndicated to all namespaces on cluster.",
},
},
},
},
"history": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Feature information.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"namespaces": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Array of syndicated namespaces.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"clusters": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Array of syndicated namespaces.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"region": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster region.",
},
"id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster ID.",
},
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Cluster name.",
},
"resource_group_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Resource group ID.",
},
"type": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Syndication type.",
},
"namespaces": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Syndicated namespaces.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"all_namespaces": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "Syndicated to all namespaces on cluster.",
},
},
},
},
"last_run": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Date and time last syndicated.",
},
},
},
},
"authorization": &schema.Schema{
Type: schema.TypeList,
Computed: true,
Description: "Feature information.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"token": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Array of syndicated namespaces.",
},
"last_run": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Date and time last updated.",
},
},
},
},
},
},
},
"kind": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -563,18 +414,6 @@ func dataSourceIBMCmCatalogRead(context context.Context, d *schema.ResourceData,
return diag.FromErr(fmt.Errorf("Error setting catalog_filters %s", err))
}

syndicationSettings := []map[string]interface{}{}
if catalog.SyndicationSettings != nil {
modelMap, err := dataSourceIBMCmCatalogSyndicationResourceToMap(catalog.SyndicationSettings)
if err != nil {
return diag.FromErr(err)
}
syndicationSettings = append(syndicationSettings, modelMap)
}
if err = d.Set("syndication_settings", syndicationSettings); err != nil {
return diag.FromErr(fmt.Errorf("Error setting syndication_settings %s", err))
}

if err = d.Set("kind", catalog.Kind); err != nil {
return diag.FromErr(fmt.Errorf("Error setting kind: %s", err))
}
Expand Down Expand Up @@ -695,95 +534,3 @@ func dataSourceIBMCmCatalogIDFilterToMap(model *catalogmanagementv1.IDFilter) (m
}
return modelMap, nil
}

func dataSourceIBMCmCatalogSyndicationResourceToMap(model *catalogmanagementv1.SyndicationResource) (map[string]interface{}, error) {
modelMap := make(map[string]interface{})
if model.RemoveRelatedComponents != nil {
modelMap["remove_related_components"] = *model.RemoveRelatedComponents
}
if model.Clusters != nil {
clusters := []map[string]interface{}{}
for _, clustersItem := range model.Clusters {
clustersItemMap, err := dataSourceIBMCmCatalogSyndicationClusterToMap(&clustersItem)
if err != nil {
return modelMap, err
}
clusters = append(clusters, clustersItemMap)
}
modelMap["clusters"] = clusters
}
if model.History != nil {
historyMap, err := dataSourceIBMCmCatalogSyndicationHistoryToMap(model.History)
if err != nil {
return modelMap, err
}
modelMap["history"] = []map[string]interface{}{historyMap}
}
if model.Authorization != nil {
authorizationMap, err := dataSourceIBMCmCatalogSyndicationAuthorizationToMap(model.Authorization)
if err != nil {
return modelMap, err
}
modelMap["authorization"] = []map[string]interface{}{authorizationMap}
}
return modelMap, nil
}

func dataSourceIBMCmCatalogSyndicationClusterToMap(model *catalogmanagementv1.SyndicationCluster) (map[string]interface{}, error) {
modelMap := make(map[string]interface{})
if model.Region != nil {
modelMap["region"] = *model.Region
}
if model.ID != nil {
modelMap["id"] = *model.ID
}
if model.Name != nil {
modelMap["name"] = *model.Name
}
if model.ResourceGroupName != nil {
modelMap["resource_group_name"] = *model.ResourceGroupName
}
if model.Type != nil {
modelMap["type"] = *model.Type
}
if model.Namespaces != nil {
modelMap["namespaces"] = model.Namespaces
}
if model.AllNamespaces != nil {
modelMap["all_namespaces"] = *model.AllNamespaces
}
return modelMap, nil
}

func dataSourceIBMCmCatalogSyndicationHistoryToMap(model *catalogmanagementv1.SyndicationHistory) (map[string]interface{}, error) {
modelMap := make(map[string]interface{})
if model.Namespaces != nil {
modelMap["namespaces"] = model.Namespaces
}
if model.Clusters != nil {
clusters := []map[string]interface{}{}
for _, clustersItem := range model.Clusters {
clustersItemMap, err := dataSourceIBMCmCatalogSyndicationClusterToMap(&clustersItem)
if err != nil {
return modelMap, err
}
clusters = append(clusters, clustersItemMap)
}
modelMap["clusters"] = clusters
}
if model.LastRun != nil {
modelMap["last_run"] = model.LastRun.String()
}
return modelMap, nil
}

func dataSourceIBMCmCatalogSyndicationAuthorizationToMap(model *catalogmanagementv1.SyndicationAuthorization) (map[string]interface{}, error) {
modelMap := make(map[string]interface{})
if model.Token != nil {
modelMap["token"] = *model.Token
}
if model.LastRun != nil {
modelMap["last_run"] = model.LastRun.String()
}
return modelMap, nil
}
Loading

0 comments on commit 796ab10

Please sign in to comment.