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

Fix/tags not required #6055

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/ibm-partner-center-sell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ resource "ibm_onboarding_catalog_deployment" "onboarding_catalog_deployment_inst
| disabled | Determines the global visibility for the catalog entry, and its children. If it is not enabled, all plans are disabled. | `bool` | true |
| kind | The kind of the global catalog object. | `string` | true |
| overview_ui | The object that contains the service details from the Overview page in global catalog. | `` | false |
| tags | A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog. | `list(string)` | true |
| tags | A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog. | `list(string)` | false |
| object_provider | The provider or owner of the product. | `` | true |
| metadata | Global catalog deployment metadata. | `` | false |

Expand Down Expand Up @@ -158,7 +158,7 @@ resource "ibm_onboarding_catalog_plan" "onboarding_catalog_plan_instance" {
| disabled | Determines the global visibility for the catalog entry, and its children. If it is not enabled, all plans are disabled. | `bool` | true |
| kind | The kind of the global catalog object. | `string` | true |
| overview_ui | The object that contains the service details from the Overview page in global catalog. | `` | false |
| tags | A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog. | `list(string)` | true |
| tags | A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog. | `list(string)` | false |
| pricing_tags | A list of tags that carry information about the pricing information of your product. | `list(string)` | false |
| object_provider | The provider or owner of the product. | `` | true |
| metadata | Global catalog plan metadata. | `` | false |
Expand Down
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2135,4 +2135,4 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.99.1-daeb6e46-20250131-173156
* IBM OpenAPI Terraform Generator Version: 3.101.0-62624c1e-20250225-192301
*/

package partnercentersell
Expand Down Expand Up @@ -122,7 +122,7 @@ func ResourceIbmOnboardingCatalogDeployment() *schema.Resource {
},
"tags": &schema.Schema{
Type: schema.TypeList,
Required: true,
Optional: true,
Description: "A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.",
Elem: &schema.Schema{Type: schema.TypeString},
},
Expand Down Expand Up @@ -194,7 +194,6 @@ func ResourceIbmOnboardingCatalogDeployment() *schema.Resource {
"unique_api_key": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Sensitive: true,
Description: "Indicates whether the deployment uses a unique API key or not.",
},
"parameters": &schema.Schema{
Expand Down Expand Up @@ -978,9 +977,11 @@ func resourceIbmOnboardingCatalogDeploymentRead(context context.Context, d *sche
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_deployment", "read", "set-overview_ui").GetDiag()
}
}
if err = d.Set("tags", globalCatalogDeployment.Tags); err != nil {
err = fmt.Errorf("Error setting tags: %s", err)
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_deployment", "read", "set-tags").GetDiag()
if !core.IsNil(globalCatalogDeployment.Tags) {
if err = d.Set("tags", globalCatalogDeployment.Tags); err != nil {
err = fmt.Errorf("Error setting tags: %s", err)
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_deployment", "read", "set-tags").GetDiag()
}
}
objectProviderMap, err := ResourceIbmOnboardingCatalogDeploymentCatalogProductProviderToMap(globalCatalogDeployment.ObjectProvider)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func ResourceIbmOnboardingCatalogPlan() *schema.Resource {
},
"tags": &schema.Schema{
Type: schema.TypeList,
Required: true,
Optional: true,
Description: "A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.",
Elem: &schema.Schema{Type: schema.TypeString},
},
Expand Down Expand Up @@ -350,7 +350,6 @@ func ResourceIbmOnboardingCatalogPlan() *schema.Resource {
"unique_api_key": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Sensitive: true,
Description: "Indicates whether the deployment uses a unique API key or not.",
},
},
Expand Down Expand Up @@ -525,12 +524,6 @@ func resourceIbmOnboardingCatalogPlanCreate(context context.Context, d *schema.R
createCatalogPlanOptions.SetActive(d.Get("active").(bool))
createCatalogPlanOptions.SetDisabled(d.Get("disabled").(bool))
createCatalogPlanOptions.SetKind(d.Get("kind").(string))
var tags []string
for _, v := range d.Get("tags").([]interface{}) {
tagsItem := v.(string)
tags = append(tags, tagsItem)
}
createCatalogPlanOptions.SetTags(tags)
objectProviderModel, err := ResourceIbmOnboardingCatalogPlanMapToCatalogProductProvider(d.Get("object_provider.0").(map[string]interface{}))
if err != nil {
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_plan", "create", "parse-object_provider").GetDiag()
Expand All @@ -546,6 +539,14 @@ func resourceIbmOnboardingCatalogPlanCreate(context context.Context, d *schema.R
}
createCatalogPlanOptions.SetOverviewUi(overviewUiModel)
}
if _, ok := d.GetOk("tags"); ok {
var tags []string
for _, v := range d.Get("tags").([]interface{}) {
tagsItem := v.(string)
tags = append(tags, tagsItem)
}
createCatalogPlanOptions.SetTags(tags)
}
if _, ok := d.GetOk("pricing_tags"); ok {
var pricingTags []string
for _, v := range d.Get("pricing_tags").([]interface{}) {
Expand Down Expand Up @@ -642,9 +643,11 @@ func resourceIbmOnboardingCatalogPlanRead(context context.Context, d *schema.Res
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_plan", "read", "set-overview_ui").GetDiag()
}
}
if err = d.Set("tags", globalCatalogPlan.Tags); err != nil {
err = fmt.Errorf("Error setting tags: %s", err)
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_plan", "read", "set-tags").GetDiag()
if !core.IsNil(globalCatalogPlan.Tags) {
if err = d.Set("tags", globalCatalogPlan.Tags); err != nil {
err = fmt.Errorf("Error setting tags: %s", err)
return flex.DiscriminatedTerraformErrorf(err, err.Error(), "ibm_onboarding_catalog_plan", "read", "set-tags").GetDiag()
}
}
if !core.IsNil(globalCatalogPlan.PricingTags) {
if err = d.Set("pricing_tags", globalCatalogPlan.PricingTags); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ func ResourceIbmOnboardingCatalogProduct() *schema.Resource {
"unique_api_key": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Sensitive: true,
Description: "Indicates whether the deployment uses a unique API key or not.",
},
"async_provisioning_supported": &schema.Schema{
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/onboarding_catalog_deployment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Nested schema for **overview_ui**:
* `long_description` - (Optional, String) The detailed description of your product that is displayed at the beginning of your product page in the catalog. Markdown markup language is supported.
* `product_id` - (Required, Forces new resource, String) The unique ID of the product.
* Constraints: The maximum length is `71` characters. The minimum length is `71` characters. The value must match regular expression `/^[a-zA-Z0-9]{32}:o:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/`.
* `tags` - (Required, List) A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.
* `tags` - (Optional, List) A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.
* Constraints: The list items must match regular expression `/^[a-z0-9\\-._]+$/`. The maximum length is `100` items. The minimum length is `0` items.

## Attribute Reference
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/onboarding_catalog_plan.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Nested schema for **overview_ui**:
* Constraints: The list items must match regular expression `/^[a-z0-9\\-._]+$/`. The maximum length is `100` items. The minimum length is `0` items.
* `product_id` - (Required, Forces new resource, String) The unique ID of the product.
* Constraints: The maximum length is `71` characters. The minimum length is `71` characters. The value must match regular expression `/^[a-zA-Z0-9]{32}:o:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/`.
* `tags` - (Required, List) A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.
* `tags` - (Optional, List) A list of tags that carry information about your product. These tags can be used to find your product in the IBM Cloud catalog.
* Constraints: The list items must match regular expression `/^[a-z0-9\\-._]+$/`. The maximum length is `100` items. The minimum length is `0` items.

## Attribute Reference
Expand Down
Loading