Skip to content

Commit

Permalink
update(partner center sell): env handeling fix
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Harasztia <[email protected]>
  • Loading branch information
HarasztiaPeter committed Oct 14, 2024
1 parent 55efd3b commit acdb2ec
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,10 +684,6 @@ func resourceIbmOnboardingCatalogDeploymentUpdate(context context.Context, d *sc
" The resource must be re-created to update this property.", "catalog_plan_id")
return flex.DiscriminatedTerraformErrorf(nil, errMsg, "ibm_onboarding_catalog_deployment", "update", "catalog_plan_id-forces-new").GetDiag()
}
if d.HasChange("env") {
updateCatalogDeploymentOptions.SetEnv(d.Get("env").(string))
hasChange = true
}
if d.HasChange("active") {
newActive := d.Get("active").(bool)
patchVals.Active = &newActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,6 @@ func resourceIbmOnboardingCatalogPlanUpdate(context context.Context, d *schema.R
" The resource must be re-created to update this property.", "catalog_product_id")
return flex.DiscriminatedTerraformErrorf(nil, errMsg, "ibm_onboarding_catalog_plan", "update", "catalog_product_id-forces-new").GetDiag()
}
if d.HasChange("env") {
updateCatalogPlanOptions.SetEnv(d.Get("env").(string))
hasChange = true
}
if d.HasChange("active") {
newActive := d.Get("active").(bool)
patchVals.Active = &newActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,6 @@ func resourceIbmOnboardingCatalogProductUpdate(context context.Context, d *schem
" The resource must be re-created to update this property.", "product_id")
return flex.DiscriminatedTerraformErrorf(nil, errMsg, "ibm_onboarding_catalog_product", "update", "product_id-forces-new").GetDiag()
}
if d.HasChange("env") {
updateCatalogProductOptions.SetEnv(d.Get("env").(string))
hasChange = true
}
if d.HasChange("active") {
newActive := d.Get("active").(bool)
patchVals.Active = &newActive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,10 +1380,6 @@ func resourceIbmOnboardingIamRegistrationUpdate(context context.Context, d *sche
" The resource must be re-created to update this property.", "product_id")
return flex.DiscriminatedTerraformErrorf(nil, errMsg, "ibm_onboarding_iam_registration", "update", "product_id-forces-new").GetDiag()
}
if d.HasChange("env") {
updateIamRegistrationOptions.SetEnv(d.Get("env").(string))
hasChange = true
}
if d.HasChange("enabled") {
newEnabled := d.Get("enabled").(bool)
patchVals.Enabled = &newEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,13 @@ func resourceIbmOnboardingResourceBrokerUpdate(context context.Context, d *schem
updateResourceBrokerOptions := &partnercentersellv1.UpdateResourceBrokerOptions{}

updateResourceBrokerOptions.SetBrokerID(d.Id())
if _, ok := d.GetOk("env"); ok {
updateResourceBrokerOptions.SetEnv(d.Get("env").(string))
}

hasChange := false

patchVals := &partnercentersellv1.BrokerPatch{}
if d.HasChange("env") {
updateResourceBrokerOptions.SetEnv(d.Get("env").(string))
hasChange = true
}
if d.HasChange("auth_username") {
newAuthUsername := d.Get("auth_username").(string)
patchVals.AuthUsername = &newAuthUsername
Expand Down

0 comments on commit acdb2ec

Please sign in to comment.