-
Notifications
You must be signed in to change notification settings - Fork 73
✨ Fieldvalue user probes #2550
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: main
Are you sure you want to change the base?
✨ Fieldvalue user probes #2550
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 | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -106,6 +106,10 @@ type ClusterExtensionRevisionSpec struct { | |||||||||||||||||||||||||||||||||||||
| // <opcon:experimental> | ||||||||||||||||||||||||||||||||||||||
| ProgressDeadlineMinutes int32 `json:"progressDeadlineMinutes,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:MaxItems=20 | ||||||||||||||||||||||||||||||||||||||
| ProgressionProbes []ProgressionProbe `json:"progressionProbes,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // collisionProtection specifies the default collision protection strategy for all objects | ||||||||||||||||||||||||||||||||||||||
| // in this revision. Individual phases or objects can override this value. | ||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -120,6 +124,95 @@ type ClusterExtensionRevisionSpec struct { | |||||||||||||||||||||||||||||||||||||
| CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"` | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| type ProgressionProbe struct { | ||||||||||||||||||||||||||||||||||||||
| // +required | ||||||||||||||||||||||||||||||||||||||
| Selector ProbeSelector `json:"selector,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // +required | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:MaxItems=20 | ||||||||||||||||||||||||||||||||||||||
| Assertions []ProbeAssertion `json:"assertions,omitempty"` | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // +union | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.type == 'GroupKind' ?has(self.groupKind) : !has(self.groupKind)",message="groupKind is required when type is GroupKind, and forbidden otherwise" | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.type == 'Label' ?has(self.label) : !has(self.label)",message="label is required when type is Label, and forbidden otherwise" | ||||||||||||||||||||||||||||||||||||||
| type ProbeSelector struct { | ||||||||||||||||||||||||||||||||||||||
| // +unionDiscriminator | ||||||||||||||||||||||||||||||||||||||
| // +kubebuilder:validation:Enum=GroupKind;Label | ||||||||||||||||||||||||||||||||||||||
| // +required | ||||||||||||||||||||||||||||||||||||||
| SelectorType SelectorType `json:"type,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||
| // +unionMember | ||||||||||||||||||||||||||||||||||||||
| GroupKind metav1.GroupKind `json:"groupKind,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // +optional | ||||||||||||||||||||||||||||||||||||||
| // +unionMember | ||||||||||||||||||||||||||||||||||||||
| Label metav1.LabelSelector `json:"label,omitempty"` | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+147
to
+151
|
||||||||||||||||||||||||||||||||||||||
| GroupKind metav1.GroupKind `json:"groupKind,omitempty"` | |
| // +optional | |
| // +unionMember | |
| Label metav1.LabelSelector `json:"label,omitempty"` | |
| GroupKind *metav1.GroupKind `json:"groupKind,omitempty"` | |
| // +optional | |
| // +unionMember | |
| Label *metav1.LabelSelector `json:"label,omitempty"` |
dtfranz marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Mar 11, 2026
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.
ProbeAssertion has the same union/omitempty issue as ProbeSelector: Condition, FieldsEqual, and FieldValue are non-pointer structs, so they will serialize as {} even when not set, which can break the CRD XValidation rules that require exactly one union member. Consider making these union members pointers (e.g., *ConditionProbe, *FieldsEqualProbe, *FieldValueProbe) so they can be omitted cleanly by Go clients / server-side apply.
| Condition ConditionProbe `json:"condition,omitempty"` | |
| // +unionMember | |
| // +optional | |
| FieldsEqual FieldsEqualProbe `json:"fieldsEqual,omitempty"` | |
| // +unionMember | |
| // +optional | |
| FieldValue FieldValueProbe `json:"fieldValue,omitempty"` | |
| Condition *ConditionProbe `json:"condition,omitempty"` | |
| // +unionMember | |
| // +optional | |
| FieldsEqual *FieldsEqualProbe `json:"fieldsEqual,omitempty"` | |
| // +unionMember | |
| // +optional | |
| FieldValue *FieldValueProbe `json:"fieldValue,omitempty"` |
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.
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.
Hi @dtfranz
See that the kube-lint-api is telling us about new issues introduced with the changes in the API.
Could we try to address those?