-
Notifications
You must be signed in to change notification settings - Fork 614
CONSOLE-5163: Add labels field to Ingress componentRoutes #2845
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -245,6 +245,20 @@ type ComponentRouteSpec struct { | |||||||||||||||||||||||||||||||||||||
| // the Secret specification for a serving certificate will not be needed. | ||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||
| ServingCertKeyPairSecret SecretNameReference `json:"servingCertKeyPairSecret"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // labels defines additional labels to be applied to the route created | ||||||||||||||||||||||||||||||||||||||
| // for the component. These labels are used by the IngressController to | ||||||||||||||||||||||||||||||||||||||
| // determine which routes it should manage. | ||||||||||||||||||||||||||||||||||||||
| // Label keys and values must conform to Kubernetes label conventions: | ||||||||||||||||||||||||||||||||||||||
| // keys must be 1-63 characters (with optional prefix up to 253 characters), | ||||||||||||||||||||||||||||||||||||||
| // and values must be 0-63 characters, consisting of alphanumeric characters, | ||||||||||||||||||||||||||||||||||||||
| // '-', '_', or '.', and must start and end with an alphanumeric character. | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+249
to
+255
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The godoc needs a few additions:
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||
| // +mapType=granular | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:MaxProperties=8 | ||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the rationale for limiting to 8 labels? Please document the reasoning. |
||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.all(key, key.matches('^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*[/])?([A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?)$'))",message="label keys must be valid Kubernetes label keys" | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.all(key, self[key].matches('^(([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9])?$'))",message="label values must be valid Kubernetes label values (at most 63 characters, alphanumeric, '-', '_', or '.', must start and end with alphanumeric)" | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+249
to
+260
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document omitted behavior and map-size constraint in the field comment. The As per coding guidelines, 🤖 Prompt for AI Agents
Comment on lines
+259
to
+260
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using CEL Kubernetes library functions ( Also consider whether keys with reserved prefixes ( |
||||||||||||||||||||||||||||||||||||||
| Labels map[string]string `json:"labels,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+249
to
+261
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gate the new stable
As per coding guidelines, 🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two issues here:
|
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // ComponentRouteStatus contains information allowing configuration of a route's hostname and serving certificate. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the FeatureGate is added, these tests should move to a gate-specific file (e.g.,
ComponentRouteLabels.yaml) instead ofAAA_ungated.yaml.Also, please add the following test cases:
example.com/my-label: value), since the prefix path is the most complex part of the key regex