Skip to content

Commit

Permalink
fix: remove trailing ':' from tag description (#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez authored Feb 20, 2025
1 parent dbf0e0a commit a919d20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/source/vmware/vmware_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ func (vc *VmwareSource) syncTags(nbi *inventory.NetboxInventory) error {
objectNames2NBTags := make(map[string][]*objects.Tag)
for objectName, tags := range vc.Object2Tags {
for _, tag := range tags {
var description string
if tag.Description != "" {
description = fmt.Sprintf("Tag synced from vmware:%s", tag.Description)
} else {
description = "Tag synced from vmware"
}
nbTag, err := nbi.AddTag(vc.Ctx, &objects.Tag{
Name: tag.Name,
Slug: utils.Slugify(tag.Name),
Color: constants.ColorGreen,
Description: fmt.Sprintf("Tag synced from vmware:%s", tag.Description),
Description: description,
})
if err != nil {
return fmt.Errorf("add tag %+v: %s", tag, err)
Expand Down

0 comments on commit a919d20

Please sign in to comment.