Repository navigation
Add support for target annotations and labels - #582
Conversation
|
Hi @terricain. Thanks for your PR. I'm waiting for a 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-sigs/prow repository. |
|
Yeah, naming is the hardest thing we do. 🤔 And this is mixed with API design. I am working on the next version of the bundle API: #486. It might be worth checking that this fits in there also. Another slightly modified suggestion from me: apiVersion: trust.cert-manager.io/v1alpha1
kind: Bundle
metadata:
name: test
spec:
sources:
...
target:
configMap:
key: "root-certs.pem"
metadata:
labels: {}
annotations: {}
secret:
key: "root-certs.pem"
metadata:
labels: {}
annotations: {}
````
I'll bring this up on today's stand-up. Would you like to join? It's at 10:30 UK time. 😺 |
|
@terricain, we discussed this PR in today's stand-up, and we think we prefer my suggestion in #582 (comment). Do you want to become a member of our organization? This will, among others, allow your PRs to be enabled for CI without approval from other members. How to become a member is described here: https://github.com/cert-manager/community/blob/main/GOVERNANCE.md#becoming-a-github-member. I would be happy to sponsor your membership! |
|
I'd have joined the standup if I had read this in time 😄 (also how does one join the standup? I've only found links to a biweekly zoom meeting) Yep I'll raise an issue to become an org member once I find a 2nd to sponsor it, I think you've got to all my PR's so far so haven't interacted with anyone else yet. #582 (comment) agreed, this looks much better than what I initially came up with, and should transfer nicely to the proposed API version in #486 (+1 for renaming it to ClusterBundle, makes the fact its not a namespaced resource much more obvious) Is it worth fixing up this PR and getting it merged or waiting till the new API is merged? |
I have done this only once, but I think you will get invites to all meetings by joining our mailing lists, ref. https://cert-manager.io/docs/contributing/#meetings.
I am pretty sure we should be able to find another sponsor. Didn't you talk with @maelvls at KubeCon ContribFest?
Please finish this PR! The new API is still far from finalized, and this PR will fix a requested feature. |
24b8a68 to
c318eec
Compare
|
Updated API to use: Tried adding some CEL expressions to validate that the annotations and labels didn't start with prefixes we care about but couldn't seem to get it to work without it looking ugly so have left the regular webhook validations in. The The changes might be easier to look at commit-by-commit Was getting some inconsistent connection refused errors with the ciphers test so added in a small loop there to wait for the webhook server to start. |
|
/ok-to-test |
Yeah, I was also struggling with those errors yesterday. I will see if I can reproduce it now and create an issue for it. It should probably be fixed in a separate PR. I will also try to review your PR tomorrow! Thanks! |
|
Thanks. Sure happy to pull it out and spin up another PR if you can reproduce it |
c318eec to
de52a32
Compare
erikgb
left a comment
There was a problem hiding this comment.
Thanks for working on this @terricain! ❤️ I did an initial review pass and added a few comments/suggestions.
The most delicate part remaining is probably the "needsUpdate" logic. trust-manager is using server-side apply (SSA), and I have suggested unconditional patching of resources many times to avoid this complex and error-prone logic. But it's still there, so we need to find a good way of determining if target labels/annotations are up-to-date or not.
de52a32 to
55a2ba3
Compare
|
Thanks for the review @erikgb, tons of good suggestions 🙂. I updated the v1alpha2 ClusterBundle with what I added to v1alpha1 Bundle as it looks like for now its just a copy that isn't really uesd? I think I've addressed all the comments, I resolved a few that were outdated/easy fixes. |
Yes, that's correct.
Cool, thanks! I will make another review pass soon. |
erikgb
left a comment
There was a problem hiding this comment.
Excellent work, @terricain! 🚀 This PR is pretty close to being mergeable. I have added a few comments/suggestions, but mostly nits.
|
Thanks again for the review 🙂, I've fixed the nits, also made the TrustTemplate getters nil-safe which makes things look cleaner. Whats the procedure for the diff conversations, does the author or reviewer resolve them? |
Nice, thanks!
Not sure if we have a practice around this. Either works. |
erikgb
left a comment
There was a problem hiding this comment.
Thanks for the stamina on this. A couple of tiny nits I missed the last time.
Could you also please rebase and squash commits to make the commit history a bit cleaner?
/lgtm
/approve
/hold
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: erikgb The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4062752 to
c1208b4
Compare
|
Have squashed the commits down to 2, mainly as one of the commits was authored by you, let me know if you want that squashed too. Fixed the nits 😄 |
Please squash everything into a single commit! I don't need credits for this work. You did most of the job! |
* Added target metadata to v1alpha2.ClusterBundle * Added metadata unit tests & integration test * Added validation rules to prevent target annotations/labels overwriting trust-manager ones Signed-off-by: Terri Cain <[email protected]>
c1208b4 to
ff268eb
Compare
|
Ah you helped a fair bit 😄. Done. |
erikgb
left a comment
There was a problem hiding this comment.
Great work! Thanks a lot for adding this new feature! 🚀
Hoping for more nice contributions from you, @terricain!
/lgtm
/unhold
|
Do you mind creating a PR to update the website docs, @terricain? 🙏 |
|
Yep, that is next on my todo list 😄 |
This adds template fields to specify labels and annotations for the target configmaps and secrets along with some extra validation logic to prevent clobbering
trust.cert-manager.iolabels and annotations.@erikgb before I go and write some tests, do we like these field names? or would the following look better? Naming things is the worst, if someone has any better ideas then I'm all for it 😆
Fixes #23