Skip to content

Commit 8316b1e

Browse files
committed
feat: address review
Signed-off-by: Ondrej Pokorny <[email protected]>
1 parent f71dc44 commit 8316b1e

16 files changed

+131
-157
lines changed

config/v1alpha1/types_insights.go

+13-17
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ type InsightsDataGather struct {
3232
}
3333

3434
type InsightsDataGatherSpec struct {
35-
// gatherConfig spec attribute includes all the configuration options related to
36-
// gathering of the Insights data and its uploading to the ingress.
35+
// gatherConfig spec attribute includes all the configuration options related to gathering of the Insights data and its uploading to the ingress.
3736
// +optional
3837
GatherConfig GatherConfig `json:"gatherConfig,omitempty"`
3938
}
@@ -42,8 +41,8 @@ type InsightsDataGatherStatus struct{}
4241

4342
// gatherConfig provides data gathering configuration options.
4443
type GatherConfig struct {
45-
// dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
46-
// in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
44+
// dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
45+
// Valid values are "None" and "ObfuscateNetworking".
4746
// When set to None the data is not obfuscated.
4847
// When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
4948
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -61,8 +60,7 @@ type GatherConfig struct {
6160
// +kubebuilder:validation:MaxItems=100
6261
// +optional
6362
DisabledGatherers []DisabledGatherer `json:"disabledGatherers"`
64-
// storage is an optional field that allows user to define persistent storage for on-demand gathering
65-
// jobs to store the Insights data archive.
63+
// storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
6664
// If omitted, the gathering job will use ephemeral storage.
6765
// +optional
6866
StorageSpec *Storage `json:"storage,omitempty"`
@@ -73,16 +71,15 @@ type GatherConfig struct {
7371
// +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")`,message=`disabledGatherer 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`
7472
type DisabledGatherer string
7573

76-
// storage provides persistent storage configuration options for on-demand gathering jobs.
74+
// storage provides persistent storage configuration options for gathering jobs.
7775
// If the type is set to PersistentVolume, then the PersistentVolume must be defined.
7876
// If the type is set to Ephemeral, then the PersistentVolume must not be defined.
7977
// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolume' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolume, and forbidden otherwise"
8078
type Storage struct {
8179
// type is a required field that specifies the type of storage that will be used to store the Insights data archive.
8280
// Valid values are "PersistentVolume" and "Ephemeral".
8381
// When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
84-
// When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
85-
// defined by the persistentVolume field.
82+
// When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
8683
// +required
8784
Type StorageType `json:"type"`
8885
// persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive.
@@ -104,13 +101,13 @@ const (
104101

105102
// persistentVolumeConfig provides configuration options for PersistentVolume storage.
106103
type PersistentVolumeConfig struct {
107-
// claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
108-
// be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
104+
// claim is a required field that specifies the configuration of the Claim that will be used to store the Insights data archive.
105+
// The Claim must be created in the openshift-insights namespace.
109106
// +required
110-
PersistentVolumeClaim PersistentVolumeClaimReference `json:"claim"`
111-
// mountPath is an optional field specifying the directory where the PVC will be mounted inside the
112-
// Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
113-
// operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
107+
Claim PersistentVolumeClaimReference `json:"claim"`
108+
// mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
109+
// If omitted, the path that is used to store the Insights data archive by Insights operator will be used instead.
110+
// The path cannot exceed 1024 characters and must not contain a colon.
114111
// +kubebuilder:validation:MaxLength=1024
115112
// +kubebuilder:validation:XValidation:rule="!self.contains(':')",message="mountPath must not contain a colon"
116113
// +optional
@@ -120,8 +117,7 @@ type PersistentVolumeConfig struct {
120117
// persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.
121118
type PersistentVolumeClaimReference struct {
122119
// name is a string that follows the DNS1123 subdomain format.
123-
// It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
124-
// '-' and '.', and must start and end with an alphanumeric character.
120+
// 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.
125121
// +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."
126122
// +kubebuilder:validation:MaxLength:=253
127123
// +required

config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers-CustomNoUpgrade.crd.yaml

+13-16
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ spec:
4646
description: spec holds user settable values for configuration
4747
properties:
4848
gatherConfig:
49-
description: |-
50-
gatherConfig spec attribute includes all the configuration options related to
51-
gathering of the Insights data and its uploading to the ingress.
49+
description: gatherConfig spec attribute includes all the configuration
50+
options related to gathering of the Insights data and its uploading
51+
to the ingress.
5252
properties:
5353
dataPolicy:
5454
description: |-
55-
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
56-
in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
55+
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
56+
Valid values are "None" and "ObfuscateNetworking".
5757
When set to None the data is not obfuscated.
5858
When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
5959
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -88,8 +88,7 @@ spec:
8888
type: array
8989
storage:
9090
description: |-
91-
storage is an optional field that allows user to define persistent storage for on-demand gathering
92-
jobs to store the Insights data archive.
91+
storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
9392
If omitted, the gathering job will use ephemeral storage.
9493
properties:
9594
persistentVolume:
@@ -99,14 +98,13 @@ spec:
9998
properties:
10099
claim:
101100
description: |-
102-
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
103-
be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
101+
claim is a required field that specifies the configuration of the Claim that will be used to store the Insights data archive.
102+
The Claim must be created in the openshift-insights namespace.
104103
properties:
105104
name:
106105
description: |-
107106
name is a string that follows the DNS1123 subdomain format.
108-
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
109-
'-' and '.', and must start and end with an alphanumeric character.
107+
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.
110108
maxLength: 253
111109
type: string
112110
x-kubernetes-validations:
@@ -120,9 +118,9 @@ spec:
120118
type: object
121119
mountPath:
122120
description: |-
123-
mountPath is an optional field specifying the directory where the PVC will be mounted inside the
124-
Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
125-
operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
121+
mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
122+
If omitted, the path that is used to store the Insights data archive by Insights operator will be used instead.
123+
The path cannot exceed 1024 characters and must not contain a colon.
126124
maxLength: 1024
127125
type: string
128126
x-kubernetes-validations:
@@ -136,8 +134,7 @@ spec:
136134
type is a required field that specifies the type of storage that will be used to store the Insights data archive.
137135
Valid values are "PersistentVolume" and "Ephemeral".
138136
When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
139-
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
140-
defined by the persistentVolume field.
137+
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
141138
enum:
142139
- PersistentVolume
143140
- Ephemeral

config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers-DevPreviewNoUpgrade.crd.yaml

+13-16
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ spec:
4646
description: spec holds user settable values for configuration
4747
properties:
4848
gatherConfig:
49-
description: |-
50-
gatherConfig spec attribute includes all the configuration options related to
51-
gathering of the Insights data and its uploading to the ingress.
49+
description: gatherConfig spec attribute includes all the configuration
50+
options related to gathering of the Insights data and its uploading
51+
to the ingress.
5252
properties:
5353
dataPolicy:
5454
description: |-
55-
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
56-
in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
55+
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
56+
Valid values are "None" and "ObfuscateNetworking".
5757
When set to None the data is not obfuscated.
5858
When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
5959
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -88,8 +88,7 @@ spec:
8888
type: array
8989
storage:
9090
description: |-
91-
storage is an optional field that allows user to define persistent storage for on-demand gathering
92-
jobs to store the Insights data archive.
91+
storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
9392
If omitted, the gathering job will use ephemeral storage.
9493
properties:
9594
persistentVolume:
@@ -99,14 +98,13 @@ spec:
9998
properties:
10099
claim:
101100
description: |-
102-
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
103-
be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
101+
claim is a required field that specifies the configuration of the Claim that will be used to store the Insights data archive.
102+
The Claim must be created in the openshift-insights namespace.
104103
properties:
105104
name:
106105
description: |-
107106
name is a string that follows the DNS1123 subdomain format.
108-
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
109-
'-' and '.', and must start and end with an alphanumeric character.
107+
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.
110108
maxLength: 253
111109
type: string
112110
x-kubernetes-validations:
@@ -120,9 +118,9 @@ spec:
120118
type: object
121119
mountPath:
122120
description: |-
123-
mountPath is an optional field specifying the directory where the PVC will be mounted inside the
124-
Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
125-
operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
121+
mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
122+
If omitted, the path that is used to store the Insights data archive by Insights operator will be used instead.
123+
The path cannot exceed 1024 characters and must not contain a colon.
126124
maxLength: 1024
127125
type: string
128126
x-kubernetes-validations:
@@ -136,8 +134,7 @@ spec:
136134
type is a required field that specifies the type of storage that will be used to store the Insights data archive.
137135
Valid values are "PersistentVolume" and "Ephemeral".
138136
When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
139-
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
140-
defined by the persistentVolume field.
137+
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
141138
enum:
142139
- PersistentVolume
143140
- Ephemeral

0 commit comments

Comments
 (0)