mirror of https://github.com/fluxcd/cli-utils.git
rename function
This commit is contained in:
parent
4432f51ac3
commit
a3f3792743
|
|
@ -837,7 +837,7 @@ 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()
|
||||
actualUids := taskContext.AppliedResourceUIDs()
|
||||
assert.Equal(t, len(actualUids), 1)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ func (p *PruneTask) Start(taskContext *taskrunner.TaskContext) {
|
|||
// Create filter to prevent deletion of currently applied
|
||||
// objects. Must be done here to wait for applied UIDs.
|
||||
uidFilter := filter.CurrentUIDFilter{
|
||||
CurrentUIDs: taskContext.AllResourceUIDs(),
|
||||
CurrentUIDs: taskContext.AppliedResourceUIDs(),
|
||||
}
|
||||
p.Filters = append(p.Filters, uidFilter)
|
||||
err := p.PruneOptions.Prune(p.Objects,
|
||||
|
|
|
|||
|
|
@ -76,9 +76,9 @@ func (tc *TaskContext) AppliedResources() []object.ObjMetadata {
|
|||
return all
|
||||
}
|
||||
|
||||
// AllResourceUIDs returns a set with the UIDs of all the resources in the
|
||||
// context.
|
||||
func (tc *TaskContext) AllResourceUIDs() sets.String {
|
||||
// AppliedResourceUIDs returns a set with the UIDs of all the
|
||||
// successfully applied resources.
|
||||
func (tc *TaskContext) AppliedResourceUIDs() sets.String {
|
||||
uids := sets.NewString()
|
||||
for _, ai := range tc.appliedResources {
|
||||
uid := strings.TrimSpace(string(ai.uid))
|
||||
|
|
|
|||
Loading…
Reference in New Issue