mirror of https://github.com/fluxcd/cli-utils.git
add ids in the apply task into taskContext
This commit is contained in:
parent
b9ff655ee7
commit
c6a79a0764
|
|
@ -137,6 +137,7 @@ func (a *ApplyTask) Start(taskContext *taskrunner.TaskContext) {
|
|||
continue
|
||||
}
|
||||
}
|
||||
infos = append(infos, info)
|
||||
canApply, err := inventory.CanApply(a.InvInfo, clusterObj, a.InventoryPolicy)
|
||||
if !canApply {
|
||||
taskContext.EventChannel() <- createApplyEvent(
|
||||
|
|
@ -147,7 +148,6 @@ func (a *ApplyTask) Start(taskContext *taskrunner.TaskContext) {
|
|||
}
|
||||
// add the inventory annotation to the resource being applied.
|
||||
inventory.AddInventoryIDAnnotation(obj, a.InvInfo)
|
||||
infos = append(infos, info)
|
||||
ao.SetObjects([]*resource.Info{info})
|
||||
err = ao.Run()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -611,6 +611,8 @@ func TestApplyTaskWithDifferentInventoryAnnotation(t *testing.T) {
|
|||
assert.Equal(t, tc.expectedEvents[i].Type, e.Type)
|
||||
assert.Equal(t, tc.expectedEvents[i].ApplyEvent.Error.Error(), e.ApplyEvent.Error.Error())
|
||||
}
|
||||
actualUids := taskContext.AllResourceUIDs()
|
||||
assert.Equal(t, len(actualUids), 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue