Description
The Applier and Destroyer each have WaitTasks used to wait until objects are Current (after apply) or NotFound (after prune/delete), but this behavior is a confusing "wait for some but not others" that is hard to describe and not relative to configuration, but rather the types of resources being applied together.
- ReconcileTimeout, PruneTimeout, and DeleteTimeout have no explicit default value, which means their implicit default is 0.
- But then the default of 0 is ignored by the Solver and 1 minute is used instead:
- But the default of 1 minutes is only used if numObjSets > 1, otherwise the WaitTask is skipped.
- This causes the WaitEvent to be skipped:
Then in addition to that inconsistency, WaitTasks use DeletePropagationBackground
by default, which doesn't wait until child objects are deleted before deleting the parent object. So things like ReplicaSets and Pods may still exist after a Deployment is confirmed to be NotFound.
As a user of cli-utils, I would rather that the applier/destroyer either waited for every resource to be reconciled/deleted or not wait at all.
In the context of kpt and Config Sync, I think the default behavior should be to wait forever until cancelled by the caller (they can implement their own global timeout using context.WithTimeout
or other cancellation using context.WithCancel
), now that both the applier and Destroyer accept context as input:
- https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/apply/applier_test.go#L550
- https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/apply/destroyer_test.go#L20
I also think the default should be changed to DeletePropagationForeground
so that the applier/destroyer don't exit until deletes are fully propagated.