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
// If the type is set to PersistentVolumeClaim, then the PersistentVolume must be defined.
78
+
// If the type is set to Ephemeral, then the PersistentVolume must not be defined.
77
79
// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolumeClaim' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolumeClaim, and forbidden otherwise"
78
80
typeStorageSpecstruct {
79
81
// type is a required field that specifies the type of storage that will be used to store the Insights data archive.
// If the type is set to PersistentVolumeClaim, then the PersistentVolume must be defined.
65
+
// If the type is set to Ephemeral, then the PersistentVolume must not be defined.
63
66
// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolumeClaim' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolumeClaim, and forbidden otherwise"
64
67
typeStorageSpecstruct {
65
68
// type is a required field that specifies the type of storage that will be used to store the Insights data archive.
@@ -138,8 +141,14 @@ type GathererState string
138
141
139
142
// gathererConfig allows to configure specific gatherers
140
143
typeGathererConfigstruct {
141
-
// name is the name of specific gatherer
144
+
// name is the required name of specific gatherer
145
+
// It must be at most 256 characters in length.
146
+
// The format for the gatherer name should be: {gatherer}/{function} where the function is optional.
147
+
// Gatherer consists of a lowercase string that may include underscores (_).
148
+
// Function consists of a lowercase string that may include underscores (_) and is separated from the gatherer by a forward slash (/).
149
+
// The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
142
150
// +kubebuilder:validation:MaxLength=256
151
+
// +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")`,message=`gatherer name must be in the format of {gatherer}/{function} where the gatherer and function are lowercase strings that may include underscores (_) and are separated by a forward slash (/) if the function is provided`
143
152
// +required
144
153
Namestring`json:"name"`
145
154
// state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted.
// advisorURI is required field that provides the URL link to the Insights Advisor.
282
+
// The link must be a valid HTTPS URL and the maximum length is 2048 characters.
283
+
// +kubebuilder:validation:XValidation:rule=`self.matches("^https://[^\\s]+")`,message=`advisorURI must be a valid HTTPS URL (e.g., https://example.com)`
273
284
// +kubebuilder:validation:MaxLength=2048
274
285
// +required
275
286
AdvisorURIstring`json:"advisorURI"`
@@ -296,26 +307,30 @@ const (
296
307
typeObjectReferencestruct {
297
308
// group is the API Group of the Resource.
298
309
// Enter empty string for the core group.
299
-
// This value should consist of only lowercase alphanumeric characters, hyphens and periods.
310
+
// This value is empty or should follow the DNS1123 subdomain format and it must be at most 253 characters in length.
300
311
// Example: "", "apps", "build.openshift.io", etc.
// +kubebuilder:validation:XValidation:rule="self.size() == 0 || !format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
313
+
// +kubebuilder:validation:MaxLength:=253
303
314
// +required
304
315
Groupstring`json:"group"`
305
-
// resource is the type that is being referenced.
316
+
// resource is required field of the type that is being referenced.
306
317
// It is normally the plural form of the resource kind in lowercase.
307
318
// This value should consist of only lowercase alphanumeric characters and hyphens.
308
319
// Example: "deployments", "deploymentconfigs", "pods", etc.
// +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")`,message=`resource must consist of only lowercase alphanumeric characters and hyphens`
310
321
// +kubebuilder:validation:MaxLength=512
311
322
// +required
312
323
Resourcestring`json:"resource"`
313
-
// name of the referent.
324
+
// name of the referent that follows the DNS1123 subdomain format.
325
+
// It must be at most 256 characters in length.
326
+
// +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
314
327
// +kubebuilder:validation:MaxLength=256
315
328
// +required
316
329
Namestring`json:"name"`
317
-
// namespace of the referent.
318
-
// +kubebuilder:validation:MaxLength=512
330
+
// namespace of the referent that follows the DNS1123 subdomain format.
331
+
// It must be at most 256 characters in length.
332
+
// +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
0 commit comments