Skip to content

Commit

Permalink
fix: allow special char in tag value
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Mar 29, 2024
1 parent 32262e9 commit 3e9f60a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/azuredisk/azure_managedDiskController.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *
newTags[consts.CreatedByTag] = &azureDDTag
if options.Tags != nil {
for k, v := range options.Tags {
// Azure won't allow / (forward slash) in tags
newKey := strings.Replace(k, "/", "-", -1)
newValue := strings.Replace(v, "/", "-", -1)
newTags[newKey] = &newValue
// <>%&?/. are not allowed in tag key, but allowed in tag value
newKey := strings.NewReplacer("<", "-", ">", "-", "%", "-", "&", "-", "?", "-", "/", "-").Replace(k)
value := v
newTags[newKey] = &value
}
}

Expand Down

0 comments on commit 3e9f60a

Please sign in to comment.