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: ConditionEqual, FieldsEqual, and FieldValue. ConditionEqual 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.
168
+
// +union
169
+
// +kubebuilder:validation:XValidation:rule="self.type == 'GroupKind' ?has(self.groupKind) : !has(self.groupKind)",message="groupKind is required when type is GroupKind, and forbidden otherwise"
170
+
// +kubebuilder:validation:XValidation:rule="self.type == 'Label' ?has(self.label) : !has(self.label)",message="label is required when type is Label, and forbidden otherwise"
171
+
typeObjectSelectorstruct {
172
+
// type is a required field which specifies the type of selector to use.
173
+
//
174
+
// The allowed selector types are "GroupKind" and "Label".
175
+
//
176
+
// When set to "GroupKind", all objects which match the specified group and kind will be selected.
177
+
// When set to "Label", all objects which match the specified labels and/or expressions will be selected.
178
+
//
179
+
// +unionDiscriminator
180
+
// +kubebuilder:validation:Enum=GroupKind;Label
181
+
// +required
182
+
// <opcon:experimental>
183
+
TypeSelectorType`json:"type,omitempty"`
184
+
185
+
// groupKind specifies the group and kind of objects to select.
// Requires exactly one of matchLabels or matchExpressions.
208
+
//
209
+
// +optional
210
+
// +unionMember
211
+
// +kubebuilder:validation:XValidation:rule="(has(self.matchExpressions) && !has(self.matchLabels)) || (!has(self.matchExpressions) && has(self.matchLabels))",message="exactly one of matchLabels or matchExpressions must be set"
// SelectorType defines the type of selector used for progressionProbes.
217
+
// +enum
218
+
typeSelectorTypestring
219
+
220
+
const (
221
+
SelectorTypeGroupKindSelectorType="GroupKind"
222
+
SelectorTypeLabelSelectorType="Label"
223
+
)
224
+
225
+
// ProbeType defines the type of probe used as an assertion.
226
+
// +enum
227
+
typeProbeTypestring
228
+
229
+
const (
230
+
ProbeTypeFieldConditionProbeType="ConditionEqual"
231
+
ProbeTypeFieldEqualProbeType="FieldsEqual"
232
+
ProbeTypeFieldValueProbeType="FieldValue"
233
+
)
234
+
235
+
// Assertion is a discriminated union which defines the probe type and definition used as an assertion.
236
+
// +union
237
+
// +kubebuilder:validation:XValidation:rule="self.type == 'ConditionEqual' ?has(self.conditionEqual) : !has(self.conditionEqual)",message="conditionEqual is required when type is ConditionEqual, and forbidden otherwise"
238
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldsEqual' ?has(self.fieldsEqual) : !has(self.fieldsEqual)",message="fieldsEqual is required when type is FieldsEqual, and forbidden otherwise"
239
+
// +kubebuilder:validation:XValidation:rule="self.type == 'FieldValue' ?has(self.fieldValue) : !has(self.fieldValue)",message="fieldValue is required when type is FieldValue, and forbidden otherwise"
240
+
typeAssertionstruct {
241
+
// type is a required field which specifies the type of probe to use.
242
+
//
243
+
// The allowed probe types are "ConditionEqual", "FieldsEqual", and "FieldValue".
244
+
//
245
+
// When set to "ConditionEqual", the probe checks objects that have reached a condition of specified type and status.
246
+
// When set to "FieldsEqual", the probe checks that the values found at two provided field paths are matching.
247
+
// When set to "FieldValue", the probe checks that the value found at the provided field path matches what was specified.
// ConditionEqualProbe defines the condition type and status required for the probe to succeed.
278
+
typeConditionEqualProbestruct {
279
+
// type sets the expected condition type, i.e. "Ready".
280
+
//
281
+
// +kubebuilder:validation:MinLength=1
282
+
// +kubebuilder:validation:MaxLength=200
283
+
// +required
284
+
// <opcon:experimental>
285
+
Typestring`json:"type,omitempty"`
286
+
287
+
// status sets the expected condition status.
288
+
//
289
+
// Allowed values are "True" and "False".
290
+
//
291
+
// +kubebuilder:validation:Enum=True;False
292
+
// +required
293
+
// <opcon:experimental>
294
+
Statusstring`json:"status,omitempty"`
295
+
}
296
+
297
+
// FieldsEqualProbe defines the paths of the two fields required to match for the probe to succeed.
298
+
typeFieldsEqualProbestruct {
299
+
// fieldA sets the field path for the first field, i.e. "spec.replicas". The probe will fail
300
+
// if the path does not exist.
301
+
//
302
+
// +kubebuilder:validation:MinLength=1
303
+
// +kubebuilder:validation:MaxLength=200
304
+
// +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."
305
+
// +required
306
+
// <opcon:experimental>
307
+
FieldAstring`json:"fieldA,omitempty"`
308
+
309
+
// fieldB sets the field path for the second field, i.e. "status.readyReplicas". The probe will fail
310
+
// if the path does not exist.
311
+
//
312
+
// +kubebuilder:validation:MinLength=1
313
+
// +kubebuilder:validation:MaxLength=200
314
+
// +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."
315
+
// +required
316
+
// <opcon:experimental>
317
+
FieldBstring`json:"fieldB,omitempty"`
318
+
}
319
+
320
+
// FieldValueProbe defines the path and value expected within for the probe to succeed.
321
+
typeFieldValueProbestruct {
322
+
// fieldPath sets the field path for the field to check, i.e. "status.phase". The probe will fail
323
+
// if the path does not exist.
324
+
//
325
+
// +kubebuilder:validation:MinLength=1
326
+
// +kubebuilder:validation:MaxLength=200
327
+
// +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."
328
+
// +required
329
+
// <opcon:experimental>
330
+
FieldPathstring`json:"fieldPath,omitempty"`
331
+
332
+
// value sets the expected value found at fieldPath, i.e. "Bound".
333
+
//
334
+
// +kubebuilder:validation:MinLength=1
335
+
// +kubebuilder:validation:MaxLength=200
336
+
// +required
337
+
// <opcon:experimental>
338
+
Valuestring`json:"value,omitempty"`
339
+
}
340
+
123
341
// ClusterExtensionRevisionLifecycleState specifies the lifecycle state of the ClusterExtensionRevision.
0 commit comments