Skip to content

Annotations and Labels must be removed from the Secret when removed from secretTemplate #4292

Closed

Description

@jonathansp

Is your feature request related to a problem? Please describe.

SecretTemplate defines annotations and labels to be propagated to the Kubernetes Secret when it is created or updated. Once created, labels and annotations are not yet removed from the Secret when they are removed from the template.

Describe the solution you'd like
When a Certificate is updated, we need to iterate over the labels and annotations and remove the items that no longer exists.

Describe alternatives you've considered
Instead of keep annotations and labels tracked, when a Certificate is updated, we could clean up all the current annotations and labels from the secret and recreate them. Any annotation from a third-party solution would have to annotate the secretTemplate instead.

Additional context
As the Secret created by cert-manager can be annotated or labelled externally, an extra field must be added containing all the labels and annotations previously created in order to identify which ones were created by cert-manager and remove them. The alternative cited above is simpler to implement but will limit the utilisation a bit.

See #3828

/kind feature

Activity

  1. added
    kind/feature
    on Aug 2, 2021
  2. jetstack-bot commented on Nov 1, 2021

    @jetstack-bot
    Contributor

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.
    If this issue is safe to close now please do so with /close.
    Send feedback to jetstack.
    /lifecycle stale

  3. added
    lifecycle/stale
    on Nov 1, 2021
  4. irbekrm commented on Nov 1, 2021

    @irbekrm
    Contributor

    This should still be done

    /remove-lifecycle stale

    /milestone v1.7

  5. removed
    lifecycle/stale
    on Nov 1, 2021
  6. added this to the v1.7 milestone on Nov 1, 2021
  7. JoshVanL commented on Nov 24, 2021

    @JoshVanL
    Contributor

    /assign

  8. jonathansp commented on Nov 30, 2021

    @jonathansp
    ContributorAuthor

    @JoshVanL please let me know if I can help with this issue as I have capacity in the following weeks.

  9. JoshVanL commented on Nov 30, 2021

    @JoshVanL
    Contributor

    Thanks @jonathansp, I am currently putting something together which makes use of managed fields and server side apply. It should be ready for review soon, then hopefully merged in an alpha state for v1.7 🤞.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/feature

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions