Skip to content

Commit

Permalink
tag unncessary update if allowed list is empty (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-swinkler authored Mar 14, 2023
1 parent cda40ec commit d469aaf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/helpers/list_to_string_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func ListContentToString(listString string) string {
func SplitStringToSlice(s, sep string) []string {
var v []string
for _, elem := range strings.Split(s, sep) {
if elem != "" {
if strings.TrimSpace(elem) != "" {
v = append(v, strings.TrimSpace(elem))
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/resources/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ func ReadTag(d *schema.ResourceData, meta interface{}) error {
av := strings.ReplaceAll(t.AllowedValues.String, "\"", "")
av = strings.TrimPrefix(av, "[")
av = strings.TrimSuffix(av, "]")

if err := d.Set("allowed_values", helpers.SplitStringToSlice(av, ",")); err != nil {
return err
}
Expand Down

0 comments on commit d469aaf

Please sign in to comment.