You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides an API which allows custom probe definitions to determine readiness of the CER phases. Objects can be selected for in one of two ways: by GroupKind, or by Label (matchLabels and matchExpressions). They can then be tested via any of: Condition, FieldsEqual, and FieldValue. Condition checks that the object has a condition matching the type and status provided. FieldsEqual uses two provided field paths and checks for equality. FieldValue uses a provided field path and checks that the value is equal to the provided expected value.
Signed-off-by: Daniel Franz <dfranz@redhat.com>
// ProbeSelector is a discriminated union which defines the method by which we select objects to make assertions against.
160
+
// +union
161
+
// +kubebuilder:validation:XValidation:rule="self.type == 'GroupKind' ?has(self.groupKind) : !has(self.groupKind)",message="groupKind is required when type is GroupKind, and forbidden otherwise"
162
+
// +kubebuilder:validation:XValidation:rule="self.type == 'Label' ?has(self.label) : !has(self.label)",message="label is required when type is Label, and forbidden otherwise"
163
+
typeProbeSelectorstruct {
164
+
// type is a required field which specifies the type of selector to use.
165
+
//
166
+
// The allowed selector types are "GroupKind" and "Label".
167
+
//
168
+
// When set to "GroupKind", all objects which match the specified group and kind will be selected.
169
+
// When set to "Label", all objects which match the specified labels and/or expressions will be selected.
170
+
//
171
+
// +unionDiscriminator
172
+
// +kubebuilder:validation:Enum=GroupKind;Label
173
+
// +required
174
+
SelectorTypeSelectorType`json:"type,omitempty"`
175
+
176
+
// groupKind specifies the group and kind of objects to select.
// SelectorType defines the type of selector used for progressionProbes.
203
+
// +enum
204
+
typeSelectorTypestring
205
+
206
+
const (
207
+
SelectorTypeGroupKindSelectorType="GroupKind"
208
+
SelectorTypeLabelSelectorType="Label"
209
+
)
210
+
211
+
// ProbeType defines the type of probe used as an assertion.
212
+
// +enum
213
+
typeProbeTypestring
214
+
215
+
const (
216
+
ProbeTypeFieldConditionProbeType="Condition"
217
+
ProbeTypeFieldEqualProbeType="FieldsEqual"
218
+
ProbeTypeFieldValueProbeType="FieldValue"
219
+
)
220
+
221
+
// ProbeAssertion is a discriminated union which defines the probe type and definition used as an assertion.
222
+
// +union
223
+
// +kubebuilder:validation:XValidation:rule="self.type == 'Condition' ?has(self.condition) : !has(self.condition)",message="condition is required when type is Condition, and forbidden otherwise"
224
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldsEqual' ?has(self.fieldsEqual) : !has(self.fieldsEqual)",message="fieldsEqual is required when type is FieldsEqual, and forbidden otherwise"
225
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldValue' ?has(self.fieldValue) : !has(self.fieldValue)",message="fieldValue is required when type is FieldValue, and forbidden otherwise"
226
+
typeProbeAssertionstruct {
227
+
// type is a required field which specifies the type of probe to use.
228
+
//
229
+
// The allowed probe types are "Condition", "FieldsEqual", and "FieldValue".
230
+
//
231
+
// When set to "Condition", the probe checks objects that have reached a condition of specified type and status.
232
+
// When set to "FieldsEqual", the probe checks that the values found at two provided field paths are matching.
233
+
// When set to "FieldValue", the probe checks that the value found at the provided field path matches what was specified.
// ConditionProbe defines the condition type and status required for the probe to succeed.
260
+
typeConditionProbestruct {
261
+
// type sets the expected condition type, i.e. "Ready".
262
+
//
263
+
// +kubebuilder:validation:MinLength=1
264
+
// +kubebuilder:validation:MaxLength=200
265
+
// +required
266
+
Typestring`json:"type,omitempty,omitzero"`
267
+
268
+
// status sets the expected condition status.
269
+
//
270
+
// Allowed values are "True" and "False".
271
+
//
272
+
// +kubebuilder:validation:Enum=True;False
273
+
// +required
274
+
Statusstring`json:"status,omitempty,omitzero"`
275
+
}
276
+
277
+
// FieldsEqualProbe defines the paths of the two fields required to match for the probe to succeed.
278
+
typeFieldsEqualProbestruct {
279
+
// fieldA sets the field path for the first field, i.e. "spec.replicas". The probe will fail
280
+
// if the path does not exist.
281
+
//
282
+
// +kubebuilder:validation:MinLength=1
283
+
// +kubebuilder:validation:MaxLength=200
284
+
// +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9]+(?:\\\\.[a-zA-Z0-9]+)*$')",message="must contain a valid field path. valid fields contain upper or lower-case alphanumeric characters separated by the \".\" character."
285
+
// +required
286
+
FieldAstring`json:"fieldA,omitempty,omitzero"`
287
+
288
+
// fieldB sets the field path for the second field, i.e. "status.readyReplicas". The probe will fail
289
+
// if the path does not exist.
290
+
//
291
+
// +kubebuilder:validation:MinLength=1
292
+
// +kubebuilder:validation:MaxLength=200
293
+
// +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9]+(?:\\\\.[a-zA-Z0-9]+)*$')",message="must contain a valid field path. valid fields contain upper or lower-case alphanumeric characters separated by the \".\" character."
294
+
// +required
295
+
FieldBstring`json:"fieldB,omitempty,omitzero"`
296
+
}
297
+
298
+
// FieldValueProbe defines the path and value expected within for the probe to succeed.
299
+
typeFieldValueProbestruct {
300
+
// fieldPath sets the field path for the field to check, i.e. "status.phase". The probe will fail
301
+
// if the path does not exist.
302
+
//
303
+
// +kubebuilder:validation:MinLength=1
304
+
// +kubebuilder:validation:MaxLength=200
305
+
// +kubebuilder:validation:XValidation:rule="self.matches('^[a-zA-Z0-9]+(?:\\\\.[a-zA-Z0-9]+)*$')",message="must contain a valid field path. valid fields contain upper or lower-case alphanumeric characters separated by the \".\" character."
0 commit comments