-
Notifications
You must be signed in to change notification settings - Fork 617
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 2 commits
6d5edf7
1fde3f0
b5a6dab
0935778
2c69bb1
091391a
a58bd90
2090d43
0e5ff48
97f9faf
a9dae67
6740a1b
afa3235
ea90be0
628b8ca
9bb1216
1bdeb2d
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. | ||
|
Leo6Leo marked this conversation as resolved.
Outdated
|
||
| // +optional | ||
| // +mapType=granular | ||
| // +kubebuilder:validation:MaxProperties=8 | ||
|
Leo6Leo marked this conversation as resolved.
coderabbitai[bot] marked this conversation as resolved.
|
||
| // +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)" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
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 (
Leo6Leo marked this conversation as resolved.
Outdated
|
||
| Labels map[string]string `json:"labels,omitempty"` | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
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