kubernetes-sigs / cli-utils

This repo contains binaries that built from libraries in cli-runtime.
Apache License 2.0
155 stars 77 forks source link

Bug: objects flagged by CurrentUIDFilter should be removed from the inventory #613

Closed manfredlift closed 1 year ago

manfredlift commented 1 year ago

During pruning the code is filtering objects with CurrentUIDFilter:

// CurrentUIDFilter implements ValidationFilter interface to determine // if an object should not be pruned (deleted) because it has recently // been applied.

This must mean that the object has ended up being tracked in the inventory by more than one reference and the one that was flagged by the filter should be removed from the inventory. Otherwise, it gets stuck in the inventory indefinitely and during every invocation of prune it'll be logged as skipped.

A good example of this is Ingress kind existing in both groups extensions and networking.k8s.io in k8s 1.19 & 1.20. This means when you rename the apiGroup in your local yaml to the new recommended group, then the reference with the old group name gets permastuck in the inventory.