Skip to content

Commit

Permalink
Add labels to allowed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Feb 14, 2024
1 parent 0da6d97 commit 1ba831e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/resources/cloud/resource_cloud_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ func CreateStack(ctx context.Context, d *schema.ResourceData, meta interface{})
func UpdateStack(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(*common.Client).GrafanaCloudAPI

// The underlying API only allows to update the name, slug, url and description.
allowedChanges := []string{"name", "description", "slug", "url"}
allowedChanges := []string{"name", "description", "slug", "url", "labels"}
if d.HasChangesExcept(allowedChanges...) {
return diag.Errorf("Error: Only name, slug, url and description can be updated.")
return diag.Errorf("Error: Only %s and description can be updated.", strings.Join(allowedChanges, ", "))
}

if d.HasChange("name") || d.HasChange("description") || d.HasChanges("slug") || d.HasChanges("url") {
Expand Down

0 comments on commit 1ba831e

Please sign in to comment.