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
// gatherConfig is an optional spec attribute that includes all the configuration options related to gathering of the Insights data and its uploading to the ingress.
// When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
45
45
// When set to WorkloadNames, the gathered data about cluster resources will not contain the workload names for your deployments. Resources UIDs will be used instead.
46
46
// When omitted no obfuscation is applied.
47
+
// +kubebuilder:validation:MinItems=0
47
48
// +kubebuilder:validation:MaxItems=2
48
49
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))",message="dataPolicy items must be unique"
// +kubebuilder:validation:XValidation:rule="has(self.mode) && self.mode == 'Custom' ? has(self.custom) : !has(self.custom)",message="custom is required when mode is Custom, and forbidden otherwise"
@@ -65,13 +66,13 @@ type Gatherers struct {
65
66
// When set to None, all gatherers will be disabled and no data will be gathered.
66
67
// When set to Custom, the custom configuration from the custom field will be applied.
67
68
// +required
68
-
ModeGatheringMode`json:"mode"`
69
+
ModeGatheringMode`json:"mode,omitempty"`
69
70
// custom provides gathering configuration.
70
71
// It is required when mode is Custom, and forbidden otherwise.
71
72
// Custom configuration allows user to disable only a subset of gatherers.
72
73
// Gatherers that are not explicitly disabled in custom configuration will run.
73
74
// +optional
74
-
Custom*Custom`json:"custom,omitempty"`
75
+
Custom*Custom`json:"custom,omitempty,omitzero"`
75
76
}
76
77
77
78
// custom provides the custom configuration of gatherers
@@ -82,11 +83,12 @@ type Custom struct {
82
83
// The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
83
84
// Run the following command to get the names of last active gatherers:
84
85
// "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
// mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
151
153
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
152
154
// The current default mount path is /var/lib/insights-operator
153
155
// The path may not exceed 1024 characters and must not contain a colon.
156
+
// +kubebuilder:validation:MinLength=0
154
157
// +kubebuilder:validation:MaxLength=1024
155
158
// +kubebuilder:validation:XValidation:rule="!self.contains(':')",message="mountPath must not contain a colon"
156
159
// +optional
157
-
MountPathstring`json:"mountPath,omitempty"`
160
+
MountPath*string`json:"mountPath,omitempty"`
158
161
}
159
162
160
163
// persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.
161
164
typePersistentVolumeClaimReferencestruct {
162
165
// name is a string that follows the DNS1123 subdomain format.
163
166
// It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.
164
167
// +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."
165
-
// +kubebuilder:validation:MaxLength:=253
168
+
// +kubebuilder:validation:MinLength=1
169
+
// +kubebuilder:validation:MaxLength=253
166
170
// +required
167
-
Namestring`json:"name"`
171
+
Namestring`json:"name,omitempty"`
168
172
}
169
173
170
174
// gathererConfig allows to configure specific gatherers
@@ -177,15 +181,16 @@ type GathererConfig struct {
177
181
// The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
178
182
// Run the following command to get the names of last active gatherers:
179
183
// "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
184
+
// +kubebuilder:validation:MinLength=1
180
185
// +kubebuilder:validation:MaxLength=256
181
186
// +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 letters only that may include underscores (_) and are separated by a forward slash (/) if the function is provided`
182
187
// +required
183
-
Namestring`json:"name"`
188
+
Namestring`json:"name,omitempty"`
184
189
// state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled".
185
190
// When set to Enabled the gatherer will run.
186
191
// When set to Disabled the gatherer will not run.
187
192
// +required
188
-
StateGathererState`json:"state"`
193
+
StateGathererState`json:"state,omitempty"`
189
194
}
190
195
191
196
// state declares valid gatherer state types.
@@ -209,10 +214,11 @@ type InsightsDataGatherList struct {
209
214
// metadata is the required standard list's metadata.
210
215
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
211
216
// +required
212
-
metav1.ListMeta`json:"metadata"`
217
+
metav1.ListMeta`json:"metadata,omitempty"`
213
218
// items is the required list of InsightsDataGather objects
0 commit comments