check label key/val format - #9414
Conversation
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9414 +/- ##
==========================================
+ Coverage 75.33% 75.36% +0.03%
==========================================
Files 252 253 +1
Lines 41471 41472 +1
==========================================
+ Hits 31243 31257 +14
+ Misses 8115 8105 -10
+ Partials 2113 2110 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdb5bb42aa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // | ||
| // +optional | ||
| Labels map[string]string `json:"labels,omitempty"` | ||
| Labels map[gwapiv1.LabelKey]gwapiv1.LabelValue `json:"labels,omitempty"` |
There was a problem hiding this comment.
Validate label keys, not just label values
For this field and the service labels field below, changing the map key to gwapiv1.LabelKey does not produce CRD validation for map keys: the generated EnvoyProxy schema only adds the additionalProperties value pattern/maxLength and has no x-kubernetes-validations for keys. An EnvoyProxy with a key such as bad/key/again is still admitted, then that key is copied into Pod/Service metadata labels during rendering and Kubernetes rejects the child resource, so the PR does not actually prevent the invalid-label failure it documents.
Useful? React with 👍 / 👎.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
PR Checklist
git commit -s). See DCO: Sign your work./api), the API was discussed and agreed before the implementation. The API change can be in a separate PR, or in the same PR, but the API must be agreed before implementation. N/A if this PR does not contain API changes.make generate gen-check,make lint, and the unit-test/coverage build pass. (Flaky e2e failures are not considered breakages, butgen-check,lint, and coverage MUST pass.)release-notes/current/<section>/<pr-number>-<slug>.md(seerelease-notes/current/README.mdfor sections and naming). N/A if this PR does not contain non-trivial changes.make gen-checkand committed the result if API/helm charts/modules changed.release-notes/current/breaking_changes/.