Skip to content

Commit

Permalink
fix tag update
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hpe committed Jun 6, 2024
1 parent 08e3067 commit 6d014dc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/cmp/instance_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,13 @@ func instanceCompareTags(org, new map[string]interface{}) ([]models.CreateInstan
}

for k, v := range org {
removeTags = append(removeTags, models.CreateInstanceBodyTag{
Name: k,
Value: v.(string),
})
val, ok := new[k]
if !ok || (ok && val != org[k]) {
removeTags = append(removeTags, models.CreateInstanceBodyTag{
Name: k,
Value: v.(string),
})
}
}

return addTags, removeTags
Expand Down

0 comments on commit 6d014dc

Please sign in to comment.