New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate additionalTags #3177
Validate additionalTags #3177
Conversation
@jonathanbeber: This issue is currently awaiting triage. If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @jonathanbeber. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. 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. |
/ok-to-test |
LGTM. One comment: is it enough to add just a single test as tags_test.go, given that same tag validation is used by all webhooks? |
Thanks @jonathanbeber We also use tags in a number of other resource kinds: Do you think it would be possible to add similar validation checks to the webhooks for these? This would be great as it would give us consistent tag validation across all our resource kinds 🎉 |
Thank you very much for your quick review and feedback.
Maybe I didn't follow completely this one, @sedefsavas. You mean like testing in just one of the webhooks? That would leave us in a situation where a line like this one is removed and the tests wouldn't break. @richardcase sure thing, I'm not sure how I missed those 🤦♂️ but for sure I will work in adding them too. |
As described in kubernetes-sigs#3102, tags keys currently can be empty or do not respect other AWS rules for tagging, resulting in errors during resources provisioning. This commit adds validation to the tags in the webhook, for all the resource where `additionalTags` is present, during creation and update. Validation is done in the webhook instead of OpenAPI schema due to limitations in the current `additionalTags` field type, as better described in kubernetes-sigs#3102.
62e5730
to
5a9346d
Compare
@richardcase I added the validation for other resources. I realised I ignored them because they were part of other packages, thanks for pointing it out. For some of the resources I had to add new test cases as the validation was not being tested. |
/lgtm /assign @richardcase |
Thanks for making those changes @jonathanbeber . /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: richardcase The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
As described in #3102, tags keys currently can be empty or do not
respect other AWS rules for tagging, resulting in errors during
resources provisioning.
This commit adds validation to the tags in the webhook, for all the
resource where
additionalTags
is present, during creation and update.Validation is done in the webhook instead of OpenAPI schema due to
limitations in the current
additionalTags
field type, as betterdescribed in #3102.
Which issue(s) this PR fixes:
Part of #3102
Special notes for your reviewer:
Checklist:
Release note: