cybozu-go / accurate

Kubernetes controller for multi-tenancy. It propagates resources between namespaces accurately and allows tenant users to create/delete sub-namespaces.
https://cybozu-go.github.io/accurate/
Apache License 2.0
38 stars 5 forks source link

Label/annotation deletion is not propagated to child namespaces #50

Closed Hsn723 closed 2 years ago

Hsn723 commented 2 years ago

Describe the bug When a propagated label/annotation is deleted from a parent namespace, the deletion is not propagated to its child namespaces.

Environments

To Reproduce Steps to reproduce the behavior:

  1. Configure Accurate to propagate the baz.glob/c label via config.yaml
  2. Deploy Accurate
  3. Create a root namespace with the baz.glob/c label and a child namespace
  4. Delete the baz.glob/c label from the root namespace
  5. Observe that the label is still present in the child namespace

Expected behavior From a developer somewhat familiar with the inner workings of the controller's perspective, it makes sense that propagating deletions of labels/annotations is non-trivial. Furthermore, the absence of a label/annotation on the parent (via deletion of omission) does not necessarily imply that it must be deleted on the child namespace, so user intent is also hard to grasp.

On the other hand, from a reader's perspective, propagation means to me that creation, update and deletion is reconciled.

This can be addressed either by:

As a predictable implementation of deletion propagation is non-trivial and may break user expectations, I am leaning towards the latter. Any opinions?

Additional context Add any other context about the problem here.

ymmt2005 commented 2 years ago

I side with the latter option. Thank you for reporting the issue.