mirror of https://github.com/fluxcd/cli-utils.git
Move inventory annotation addition
This commit is contained in:
parent
b146dfa233
commit
aa79285f4b
|
|
@ -75,6 +75,10 @@ func (a *Applier) prepareObjects(localInv inventory.InventoryInfo, localObjs []*
|
||||||
if err := inventory.ValidateNoInventory(localObjs); err != nil {
|
if err := inventory.ValidateNoInventory(localObjs); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
// Add the inventory annotation to the resources being applied.
|
||||||
|
for _, localObj := range localObjs {
|
||||||
|
inventory.AddInventoryIDAnnotation(localObj, localInv)
|
||||||
|
}
|
||||||
// If the inventory uses the Name strategy and an inventory ID is provided,
|
// If the inventory uses the Name strategy and an inventory ID is provided,
|
||||||
// verify that the existing inventory object (if there is one) has an ID
|
// verify that the existing inventory object (if there is one) has an ID
|
||||||
// label that matches.
|
// label that matches.
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,6 @@ func (a *ApplyTask) Start(taskContext *taskrunner.TaskContext) {
|
||||||
taskContext.CaptureResourceFailure(id)
|
taskContext.CaptureResourceFailure(id)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// add the inventory annotation to the resource being applied.
|
|
||||||
inventory.AddInventoryIDAnnotation(obj, a.InvInfo)
|
|
||||||
ao.SetObjects([]*resource.Info{info})
|
ao.SetObjects([]*resource.Info{info})
|
||||||
klog.V(5).Infof("applying %s/%s...", info.Namespace, info.Name)
|
klog.V(5).Infof("applying %s/%s...", info.Namespace, info.Name)
|
||||||
err = ao.Run()
|
err = ao.Run()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue