Skip to content

Commit 8189015

Browse files
committed
review updates
Signed-off-by: Jordan Keister <[email protected]>
1 parent e29724d commit 8189015

File tree

7 files changed

+46
-35
lines changed

7 files changed

+46
-35
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type SourceConfig struct {
9797
// catalog is used to configure how information is sourced from a catalog.
9898
// This field is required when sourceType is "Catalog", and forbidden otherwise.
9999
//
100-
// +optional.
100+
// +optional
101101
Catalog *CatalogSource `json:"catalog,omitempty"`
102102
}
103103

@@ -107,7 +107,7 @@ type SourceConfig struct {
107107
// +union
108108
type ClusterExtensionInstallConfig struct {
109109
// namespace designates the kubernetes Namespace where bundle content
110-
// for the 'packageName' package field will be applied and the necessary
110+
// for the package, referenced in the 'packageName' field, will be applied and the necessary
111111
// service account can be found.
112112
// The bundle may contain cluster-scoped resources or resources that are
113113
// applied to other Namespaces. This Namespace is expected to exist.
@@ -120,7 +120,7 @@ type ClusterExtensionInstallConfig struct {
120120
//
121121
// +kubebuilder:validation:MaxLength:=63
122122
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="namespace is immutable"
123-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$\")",message="namespace must be a valid DNS1123 label"
123+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$\")",message="namespace must be a valid DNS1123 label. It must contain only lowercase alphanumeric characters or hyphens (-), start and end with an alphanumeric character, and be no longer than 63 characters"
124124
// +kubebuilder:validation:Required
125125
Namespace string `json:"namespace"`
126126

@@ -173,7 +173,7 @@ type CatalogSource struct {
173173
// +kubebuilder:validation.Required
174174
// +kubebuilder:validation:MaxLength:=253
175175
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="packageName is immutable"
176-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain"
176+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
177177
// +kubebuilder:validation:Required
178178
PackageName string `json:"packageName"`
179179

@@ -264,7 +264,7 @@ type CatalogSource struct {
264264
// Each channel in the list must follow the DNS subdomain standard
265265
// as defined in [RFC 1123]. It must contain only lowercase alphanumeric characters,
266266
// hyphens (-) or periods (.), start and end with an alphanumeric character,
267-
// and be no longer than 253 characters.
267+
// and be no longer than 253 characters. No more than 256 channels can be specified.
268268
//
269269
// When specified, it is used to constrain the set of installable bundles and
270270
// the automated upgrade path. This constraint is an AND operation with the
@@ -363,7 +363,7 @@ type ServiceAccountReference struct {
363363
//
364364
// +kubebuilder:validation:MaxLength:=253
365365
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable"
366-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="name must be a valid DNS1123 subdomain"
366+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="name must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
367367
// +kubebuilder:validation:Required
368368
Name string `json:"name"`
369369
}
@@ -394,7 +394,6 @@ type CRDUpgradeSafetyPreflightConfig struct {
394394
// performing an upgrade operation.
395395
//
396396
// +kubebuilder:validation:Enum:="None";"Strict"
397-
// +kubebuilder:default:=Strict
398397
// +kubebuilder:validation:Required
399398
Enforcement CRDUpgradeSafetyEnforcement `json:"enforcement"`
400399
}
@@ -430,14 +429,14 @@ type BundleMetadata struct {
430429
// and be no longer than 253 characters.
431430
//
432431
// +kubebuilder:validation:Required
433-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain"
432+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$\")",message="packageName must be a valid DNS1123 subdomain. It must contain only lowercase alphanumeric characters, hyphens (-) or periods (.), start and end with an alphanumeric character, and be no longer than 253 characters"
434433
Name string `json:"name"`
435434

436435
// version is a required field and is a reference to the version that this bundle represents
437-
// version follows the semantic versioning standard as defined in https://semver.org/, but permits a leading 'v' character.
436+
// version follows the semantic versioning standard as defined in https://semver.org/.
438437
//
439438
// +kubebuilder:validation:Required
440-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^v?([0-9]+)(\\\\.[0-9]+)?(\\\\.[0-9]+)?(-([-0-9A-Za-z]+(\\\\.[-0-9A-Za-z]+)*))?(\\\\+([-0-9A-Za-z]+(-\\\\.[-0-9A-Za-z]+)*))?\")",message="version name must foo"
439+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^([0-9]+)(\\\\.[0-9]+)?(\\\\.[0-9]+)?(-([-0-9A-Za-z]+(\\\\.[-0-9A-Za-z]+)*))?(\\\\+([-0-9A-Za-z]+(-\\\\.[-0-9A-Za-z]+)*))?\")",message="version must be well-formed semver"
441440
Version string `json:"version"`
442441
}
443442

@@ -451,8 +450,8 @@ type ClusterExtensionStatus struct {
451450
//
452451
// The Progressing condition represents whether or not the ClusterExtension is advancing towards a new state.
453452
// When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.
453+
// When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
454454
// When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
455-
// When Progressing is False and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
456455
//
457456
// When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
458457
// These are indications from a package owner to guide users away from a particular package, channel, or bundle.
@@ -517,6 +516,8 @@ type ClusterExtensionList struct {
517516
// +optional
518517
metav1.ListMeta `json:"metadata,omitempty"`
519518

519+
// items is a required list of ClusterExtension objects.
520+
//
520521
// +kubebuilder:validation:Required
521522
Items []ClusterExtension `json:"items"`
522523
}

config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
namespace:
7272
description: |-
7373
namespace designates the kubernetes Namespace where bundle content
74-
for the 'packageName' package field will be applied and the necessary
74+
for the package, referenced in the 'packageName' field, will be applied and the necessary
7575
service account can be found.
7676
The bundle may contain cluster-scoped resources or resources that are
7777
applied to other Namespaces. This Namespace is expected to exist.
@@ -86,7 +86,10 @@ spec:
8686
x-kubernetes-validations:
8787
- message: namespace is immutable
8888
rule: self == oldSelf
89-
- message: namespace must be a valid DNS1123 label
89+
- message: namespace must be a valid DNS1123 label. It must contain
90+
only lowercase alphanumeric characters or hyphens (-), start
91+
and end with an alphanumeric character, and be no longer than
92+
63 characters
9093
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
9194
preflight:
9295
description: |-
@@ -105,7 +108,6 @@ spec:
105108
consequences of upgrading a CRD, such as data loss.
106109
properties:
107110
enforcement:
108-
default: Strict
109111
description: |-
110112
enforcement is a required field, used to configure the state of the CRD Upgrade Safety pre-flight check.
111113
@@ -172,7 +174,10 @@ spec:
172174
x-kubernetes-validations:
173175
- message: name is immutable
174176
rule: self == oldSelf
175-
- message: name must be a valid DNS1123 subdomain
177+
- message: name must be a valid DNS1123 subdomain. It must
178+
contain only lowercase alphanumeric characters, hyphens
179+
(-) or periods (.), start and end with an alphanumeric
180+
character, and be no longer than 253 characters
176181
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$")
177182
required:
178183
- name
@@ -211,7 +216,7 @@ spec:
211216
Each channel in the list must follow the DNS subdomain standard
212217
as defined in [RFC 1123]. It must contain only lowercase alphanumeric characters,
213218
hyphens (-) or periods (.), start and end with an alphanumeric character,
214-
and be no longer than 253 characters.
219+
and be no longer than 253 characters. No more than 256 channels can be specified.
215220
216221
When specified, it is used to constrain the set of installable bundles and
217222
the automated upgrade path. This constraint is an AND operation with the
@@ -277,7 +282,10 @@ spec:
277282
x-kubernetes-validations:
278283
- message: packageName is immutable
279284
rule: self == oldSelf
280-
- message: packageName must be a valid DNS1123 subdomain
285+
- message: packageName must be a valid DNS1123 subdomain.
286+
It must contain only lowercase alphanumeric characters,
287+
hyphens (-) or periods (.), start and end with an alphanumeric
288+
character, and be no longer than 253 characters
281289
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$")
282290
selector:
283291
description: |-
@@ -477,8 +485,8 @@ spec:
477485
478486
The Progressing condition represents whether or not the ClusterExtension is advancing towards a new state.
479487
When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.
488+
When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
480489
When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
481-
When Progressing is False and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
482490
483491
When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
484492
These are indications from a package owner to guide users away from a particular package, channel, or bundle.
@@ -563,16 +571,19 @@ spec:
563571
and be no longer than 253 characters.
564572
type: string
565573
x-kubernetes-validations:
566-
- message: packageName must be a valid DNS1123 subdomain
574+
- message: packageName must be a valid DNS1123 subdomain.
575+
It must contain only lowercase alphanumeric characters,
576+
hyphens (-) or periods (.), start and end with an alphanumeric
577+
character, and be no longer than 253 characters
567578
rule: self.matches("^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$")
568579
version:
569580
description: |-
570581
version is a required field and is a reference to the version that this bundle represents
571-
version follows the semantic versioning standard as defined in https://semver.org/, but permits a leading 'v' character.
582+
version follows the semantic versioning standard as defined in https://semver.org/.
572583
type: string
573584
x-kubernetes-validations:
574-
- message: version name must foo
575-
rule: self.matches("^v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(-([-0-9A-Za-z]+(\\.[-0-9A-Za-z]+)*))?(\\+([-0-9A-Za-z]+(-\\.[-0-9A-Za-z]+)*))?")
585+
- message: version must be well-formed semver
586+
rule: self.matches("^([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(-([-0-9A-Za-z]+(\\.[-0-9A-Za-z]+)*))?(\\+([-0-9A-Za-z]+(-\\.[-0-9A-Za-z]+)*))?")
576587
required:
577588
- name
578589
- version

0 commit comments

Comments
 (0)