Repository navigation
Add labels to secrets - #3537
thomaspeitz wants to merge 2 commits into
Conversation
Signed-off-by: Thomas Peitz <[email protected]>
|
Hi @thomaspeitz. Thanks for your PR. I'm waiting for a jetstack or cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
/retest |
|
@thomaspeitz Could you rebase your commit against |
|
Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits. 📝 Please follow instructions in the contributing guide to update your commits with the DCO Full details of the Developer Certificate of Origin can be found at developercertificate.org. The list of commits missing DCO signoff:
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: thomaspeitz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@thomaspeitz: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@thomaspeitz Could you also Sign-off the commits please? See https://github.com/jetstack/cert-manager/blob/master/CONTRIBUTING.md#dco-sign-off. And if you’re ready to get it reviewed and merged, please comment |
|
/milestone Next I'm adding this to the next milestone during our 2021-05-27 triage session, because it seems like it is close to being mergable and because it solves a much reported issue. |
|
@wallrj: The provided milestone is not valid for this repository. Milestones in this repository: [ Use DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
If I understand correctly, your PR aims at adding "just enough" information in the Secret's labels for Secrets created by cert-manager to be able to "link back" to the owner of that object, which lets you use tools like Velero. For example, with the following Certificate: apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-com
spec:
secretName: example-com-tlsThen you expect the Secret created by cert-manager to look like this: kind: Secret
metadata:
name: example-com-tls
labels:
cert-manager.io/certificate-name: example-com
cert-manager.io/issuer-name: letsencrypt
cert-manager.io/issuer-kind: Issuer
cert-manager.io/issuer-group: cert-manager.ioDo I understand correctly? Just FYI, #3828 (see associated documentation) will add a field on the Certificate resource that lets you add both labels and annotations to the Secrets generated by cert-manager. An example of Certificate: apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-com
spec:
secretName: example-com-tls
# Secret template is optional. If set, these annotations
# and labels will be copied to the secret named example-com-tls.
secretTemplate:
annotations:
my-secret-annotation-1: "foo"
my-secret-annotation-2: "bar"
labels:
my-secret-environment: example-label |
|
That would fix my problem completely. No need for my PR anymore. Closing it here :) |
Signed-off-by: Thomas Peitz [email protected]
What this PR does / why we need it:
Add labels from cert-manager and from certificate resource to created TLS secret.
In our example we want to be able to automatically backup TLS secrets via velero (which uses label selectors to backup resources automatically).
Used @meyskens approach and just copied code to fix #2992
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close that issue when PR gets merged): fixes ##2992
#566
Special notes for your reviewer:
Thanks a lot for your review :)