Skip to content

Commit

Permalink
🐛 only set annotations if asset is not nil. (#2354)
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev authored Oct 24, 2023
1 parent e609332 commit f3f0a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/inventoryloader/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func ParseOrUse(cliAsset *inventory.Asset, insecure bool, annotations map[string
var v1inventory *inventory.Inventory
var err error

cliAsset.AddAnnotations(annotations)
// parses optional inventory file if inventory was not piped already
v1inventory, err = Parse()
if err != nil {
Expand All @@ -149,6 +148,7 @@ func ParseOrUse(cliAsset *inventory.Asset, insecure bool, annotations map[string

// add asset from cli to inventory
if (len(v1inventory.Spec.GetAssets()) == 0) && cliAsset != nil {
cliAsset.AddAnnotations(annotations)
v1inventory.AddAssets(cliAsset)
}

Expand Down

0 comments on commit f3f0a2f

Please sign in to comment.