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
This commit aligns the configuration options of the
DataGather CRD with those of InsightsDataGather,
making it easier to use both CRDs.
Signed-off-by: Ondrej Pokorny <[email protected]>
Copy file name to clipboardExpand all lines: insights/v1alpha2/types_insights.go
+93-43
Original file line number
Diff line number
Diff line change
@@ -37,28 +37,70 @@ type DataGather struct {
37
37
38
38
// DataGatherSpec contains the configuration for the DataGather.
39
39
typeDataGatherSpecstruct {
40
-
// dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
41
-
// in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking".
42
-
// When set to ClearText the data is not obfuscated.
40
+
// dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data.
41
+
// It may not exceed 2 items and must not contain duplicates.
42
+
// Valid values are ObfuscateNetworking and WorkloadNames.
43
43
// When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
44
-
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
45
-
// The current default is ClearText.
44
+
// 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.
45
+
// When omitted no obfuscation is applied.
46
+
// +kubebuilder:validation:MaxItems=2
47
+
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))",message="dataPolicy items must be unique"
48
+
// +listType=atomic
46
49
// +optional
47
-
DataPolicyDataPolicy`json:"dataPolicy"`
48
-
// gatherers is an optional list of gatherers configurations.
49
-
// The list must not exceed 100 items.
50
-
// The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
51
-
// Run the following command to get the names of last active gatherers:
52
-
// "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
53
-
// +kubebuilder:validation:MaxItems=100
50
+
DataPolicy []DataPolicyOption`json:"dataPolicy"`
51
+
// gatherers is an optional field that specifies the configuration of the gatherers.
// storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
57
55
// If omitted, the gathering job will use ephemeral storage.
58
56
// +optional
59
57
Storage*Storage`json:"storage,omitempty"`
60
58
}
61
59
60
+
// +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"
61
+
typeGatherersstruct {
62
+
// mode is a required field that specifies the mode for gatherers. Allowed values are All, None, and Custom.
63
+
// When set to All, all gatherers wil run and gather data.
64
+
// When set to None, all gatherers will be disabled and no data will be gathered.
65
+
// When set to Custom, the custom configuration from the custom field will be applied.
66
+
// +required
67
+
ModeGatheringMode`json:"mode"`
68
+
// custom provides gathering configuration.
69
+
// It is required when mode is Custom, and forbidden otherwise.
70
+
// Custom configuration allows user to disable only a subset of gatherers.
71
+
// Gatherers that are not explicitly disabled in custom configuration will run.
72
+
// +optional
73
+
Custom*Custom`json:"custom,omitempty"`
74
+
}
75
+
76
+
// custom provides the custom configuration of gatherers
77
+
typeCustomstruct {
78
+
// configs is a required list of gatherers configurations that can be used to enable or disable specific gatherers.
79
+
// It may not exceed 100 items and each gatherer can be present only once.
80
+
// It is possible to disable an entire set of gatherers while allowing a specific function within that set.
81
+
// The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
82
+
// Run the following command to get the names of last active gatherers:
83
+
// "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
84
+
// +kubebuilder:validation:MaxItems=100
85
+
// +listType=map
86
+
// +listMapKey=name
87
+
// +required
88
+
Configs []GathererConfig`json:"configs"`
89
+
}
90
+
91
+
// gatheringMode defines the valid gathering modes.
92
+
// +kubebuilder:validation:Enum=All;None;Custom
93
+
typeGatheringModestring
94
+
95
+
const (
96
+
// Enabled enables all gatherers
97
+
GatheringModeAllGatheringMode="All"
98
+
// Disabled disables all gatherers
99
+
GatheringModeNoneGatheringMode="None"
100
+
// Custom applies the configuration from GatheringConfig.
101
+
GatheringModeCustomGatheringMode="Custom"
102
+
)
103
+
62
104
// storage provides persistent storage configuration options for gathering jobs.
63
105
// If the type is set to PersistentVolume, then the PersistentVolume must be defined.
64
106
// If the type is set to Ephemeral, then the PersistentVolume must not be defined.
@@ -114,52 +156,49 @@ type PersistentVolumeClaimReference struct {
114
156
Namestring`json:"name"`
115
157
}
116
158
159
+
// dataPolicyOption declares valid data policy types
// gathererConfig allows to configure specific gatherers
145
171
typeGathererConfigstruct {
146
-
// name is the required name of specific gatherer
147
-
// It must be at most 256 characters in length.
148
-
// The format for the gatherer name should be: {gatherer}/{function} where the function is optional.
172
+
// name is the required name of a specific gatherer
173
+
// It may not exceed 256 characters.
174
+
// The format for a gatherer name is: {gatherer}/{function} where the function is optional.
149
175
// Gatherer consists of a lowercase letters only that may include underscores (_).
150
176
// Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/).
151
177
// The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
178
+
// Run the following command to get the names of last active gatherers:
179
+
// "oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
152
180
// +kubebuilder:validation:MaxLength=256
153
181
// +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`
154
182
// +required
155
183
Namestring`json:"name"`
156
-
// state allows you to configure specific gatherer. Valid values are "Enabled", "Disabled" and omitted.
157
-
// When omitted, this means no opinion and the platform is left to choose a reasonable default.
158
-
// The current default is Enabled.
159
-
// +optional
184
+
// state is a required field that allows you to configure specific gatherer. Valid values are "Enabled" and "Disabled".
185
+
// When set to Enabled the gatherer will run.
186
+
// When set to Disabled the gatherer will not run.
187
+
// +required
160
188
StateGathererState`json:"state"`
161
189
}
162
190
191
+
// state declares valid gatherer state types.
192
+
// +kubebuilder:validation:Enum=Enabled;Disabled
193
+
typeGathererStatestring
194
+
195
+
const (
196
+
// GathererStateEnabled gatherer state, which means that the gatherer will run.
197
+
GathererStateEnabledGathererState="Enabled"
198
+
// GathererStateDisabled gatherer state, which means that the gatherer will not run.
199
+
GathererStateDisabledGathererState="Disabled"
200
+
)
201
+
163
202
// dataGatherState declares valid gathering state types
Copy file name to clipboardExpand all lines: insights/v1alpha2/zz_generated.crd-manifests/0000_10_insights_01_datagathers-CustomNoUpgrade.crd.yaml
+95-49
Original file line number
Diff line number
Diff line change
@@ -60,58 +60,104 @@ spec:
60
60
properties:
61
61
dataPolicy:
62
62
description: |-
63
-
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
64
-
in the Insights archive data. Valid values are "ClearText" and "ObfuscateNetworking".
65
-
When set to ClearText the data is not obfuscated.
63
+
dataPolicy is an optional list of DataPolicyOptions that allows user to enable additional obfuscation of the Insights archive data.
64
+
It may not exceed 2 items and must not contain duplicates.
65
+
Valid values are ObfuscateNetworking and WorkloadNames.
66
66
When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
67
-
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
68
-
The current default is ClearText.
69
-
enum:
70
-
- ""
71
-
- ClearText
72
-
- ObfuscateNetworking
73
-
type: string
74
-
gatherers:
75
-
description: |-
76
-
gatherers is an optional list of gatherers configurations.
77
-
The list must not exceed 100 items.
78
-
The particular gatherers IDs can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
79
-
Run the following command to get the names of last active gatherers:
80
-
"oc get insightsoperators.operator.openshift.io cluster -o json | jq '.status.gatherStatus.gatherers[].name'"
67
+
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.
68
+
When omitted no obfuscation is applied.
81
69
items:
82
-
description: gathererConfig allows to configure specific gatherers
83
-
properties:
84
-
name:
85
-
description: |-
86
-
name is the required name of specific gatherer
87
-
It must be at most 256 characters in length.
88
-
The format for the gatherer name should be: {gatherer}/{function} where the function is optional.
89
-
Gatherer consists of a lowercase letters only that may include underscores (_).
90
-
Function consists of a lowercase letters only that may include underscores (_) and is separated from the gatherer by a forward slash (/).
91
-
The particular gatherers can be found at https://github.com/openshift/insights-operator/blob/master/docs/gathered-data.md.
92
-
maxLength: 256
93
-
type: string
94
-
x-kubernetes-validations:
95
-
- message: gatherer name must be in the format of {gatherer}/{function}
96
-
where the gatherer and function are lowercase letters only
97
-
that may include underscores (_) and are separated by a
0 commit comments