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>
// ObjectSelector is a discriminated union which defines the method by which we select objects to make assertions against.
163
+
// +union
164
+
// +kubebuilder:validation:XValidation:rule="self.type == 'GroupKind' ?has(self.groupKind) : !has(self.groupKind)",message="groupKind is required when type is GroupKind, and forbidden otherwise"
165
+
// +kubebuilder:validation:XValidation:rule="self.type == 'Label' ?has(self.label) : !has(self.label)",message="label is required when type is Label, and forbidden otherwise"
166
+
typeObjectSelectorstruct {
167
+
// type is a required field which specifies the type of selector to use.
168
+
//
169
+
// The allowed selector types are "GroupKind" and "Label".
170
+
//
171
+
// When set to "GroupKind", all objects which match the specified group and kind will be selected.
172
+
// When set to "Label", all objects which match the specified labels and/or expressions will be selected.
173
+
//
174
+
// +unionDiscriminator
175
+
// +kubebuilder:validation:Enum=GroupKind;Label
176
+
// +required
177
+
// <opcon:experimental>
178
+
SelectorTypeSelectorType`json:"type,omitempty"`
179
+
180
+
// groupKind specifies the group and kind of objects to select.
// SelectorType defines the type of selector used for progressionProbes.
209
+
// +enum
210
+
typeSelectorTypestring
211
+
212
+
const (
213
+
SelectorTypeGroupKindSelectorType="GroupKind"
214
+
SelectorTypeLabelSelectorType="Label"
215
+
)
216
+
217
+
// ProbeType defines the type of probe used as an assertion.
218
+
// +enum
219
+
typeProbeTypestring
220
+
221
+
const (
222
+
ProbeTypeFieldConditionProbeType="Condition"
223
+
ProbeTypeFieldEqualProbeType="FieldsEqual"
224
+
ProbeTypeFieldValueProbeType="FieldValue"
225
+
)
226
+
227
+
// Assertion is a discriminated union which defines the probe type and definition used as an assertion.
228
+
// +union
229
+
// +kubebuilder:validation:XValidation:rule="self.type == 'Condition' ?has(self.condition) : !has(self.condition)",message="condition is required when type is Condition, and forbidden otherwise"
230
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldsEqual' ?has(self.fieldsEqual) : !has(self.fieldsEqual)",message="fieldsEqual is required when type is FieldsEqual, and forbidden otherwise"
231
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldValue' ?has(self.fieldValue) : !has(self.fieldValue)",message="fieldValue is required when type is FieldValue, and forbidden otherwise"
232
+
typeAssertionstruct {
233
+
// type is a required field which specifies the type of probe to use.
234
+
//
235
+
// The allowed probe types are "Condition", "FieldsEqual", and "FieldValue".
236
+
//
237
+
// When set to "Condition", the probe checks objects that have reached a condition of specified type and status.
238
+
// When set to "FieldsEqual", the probe checks that the values found at two provided field paths are matching.
239
+
// 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.
270
+
typeConditionProbestruct {
271
+
// type sets the expected condition type, i.e. "Ready".
272
+
//
273
+
// +kubebuilder:validation:MinLength=1
274
+
// +kubebuilder:validation:MaxLength=200
275
+
// +required
276
+
// <opcon:experimental>
277
+
Typestring`json:"type,omitempty,omitzero"`
278
+
279
+
// status sets the expected condition status.
280
+
//
281
+
// Allowed values are "True" and "False".
282
+
//
283
+
// +kubebuilder:validation:Enum=True;False
284
+
// +required
285
+
// <opcon:experimental>
286
+
Statusstring`json:"status,omitempty,omitzero"`
287
+
}
288
+
289
+
// FieldsEqualProbe defines the paths of the two fields required to match for the probe to succeed.
290
+
typeFieldsEqualProbestruct {
291
+
// fieldA sets the field path for the first field, i.e. "spec.replicas". The probe will fail
292
+
// if the path does not exist.
293
+
//
294
+
// +kubebuilder:validation:MinLength=1
295
+
// +kubebuilder:validation:MaxLength=200
296
+
// +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."
297
+
// +required
298
+
// <opcon:experimental>
299
+
FieldAstring`json:"fieldA,omitempty,omitzero"`
300
+
301
+
// fieldB sets the field path for the second field, i.e. "status.readyReplicas". The probe will fail
302
+
// if the path does not exist.
303
+
//
304
+
// +kubebuilder:validation:MinLength=1
305
+
// +kubebuilder:validation:MaxLength=200
306
+
// +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."
307
+
// +required
308
+
// <opcon:experimental>
309
+
FieldBstring`json:"fieldB,omitempty,omitzero"`
310
+
}
311
+
312
+
// FieldValueProbe defines the path and value expected within for the probe to succeed.
313
+
typeFieldValueProbestruct {
314
+
// fieldPath sets the field path for the field to check, i.e. "status.phase". The probe will fail
315
+
// if the path does not exist.
316
+
//
317
+
// +kubebuilder:validation:MinLength=1
318
+
// +kubebuilder:validation:MaxLength=200
319
+
// +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