Skip to content

Commit

Permalink
Added Corner Case
Browse files Browse the repository at this point in the history
  • Loading branch information
adiyaar24 committed May 11, 2023
1 parent 7b522e7 commit 231e221
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/service/platform/secret/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ func buildTag(no_of_tags int, tags *schema.Set) string {
tagMap := make(map[string]string)
for i := 0; i < tags.Len(); i++ {
tag := fmt.Sprintf("%v", tags.List()[i])
splitTag := strings.Split(tag, ",")
key := splitTag[0]
if len(splitTag) > 1 {
if strings.Contains(tag, ":") {
splitTag := strings.Split(tag, ":")
key := splitTag[0]
value := splitTag[1]
tagMap[key] = value
} else {
tagMap[key] = ""
tagMap[tag] = ""
}
}

Expand All @@ -141,13 +141,14 @@ func buildTag(no_of_tags int, tags *schema.Set) string {
} else {
first = false
}
result += fmt.Sprintf(`"%[1]s":"%[2]s"`, key, value)
result += fmt.Sprintf(`"%s":"%s"`, key, value)
}

result += "}"
return result
}


func readSecretFile(d *schema.ResourceData, secret *nextgen.Secret) error {
d.Set("secret_manager_identifier", secret.File.SecretManagerIdentifier)
d.SetId(secret.Identifier)
Expand Down

0 comments on commit 231e221

Please sign in to comment.