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
Copy file name to clipboardExpand all lines: api/v1/clusterextension_types.go
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -130,10 +130,19 @@ const (
130
130
//
131
131
// +union
132
132
// +kubebuilder:validation:XValidation:rule="has(self.sourceType) && self.sourceType == 'Catalog' ? has(self.catalog) : !has(self.catalog)",message="catalog is required when sourceType is Catalog, and forbidden otherwise"
133
-
// +kubebuilder:validation:XValidation:rule="has(self.sourceType) && self.sourceType == 'OCIImage' ? has(self.ociImage) : !has(self.ociImage)",message="ociImage is required when sourceType is OCIImage, and forbidden otherwise"
133
+
// <opcon:experimental:validation:XValidation:rule="has(self.sourceType) && self.sourceType == 'OCIImage' ? self.ociImage.ref.size() != 0 : self.ociImage.ref.size() == 0",message="ociImage is required when sourceType is OCIImage, and forbidden otherwise">
134
134
typeSourceConfigstruct {
135
135
// sourceType is required and specifies the type of install source.
136
136
//
137
+
// <opcon:standard:description>
138
+
// The allowed value is "Catalog".
139
+
//
140
+
// When set to "Catalog", information for determining the appropriate bundle of content to install
141
+
// is fetched from ClusterCatalog resources on the cluster.
142
+
// When using the Catalog sourceType, the catalog field must also be set.
143
+
// </opcon:standard:description>
144
+
//
145
+
// <opcon:experimental:description>
137
146
// The allowed values are "Catalog" and "OCIImage".
138
147
//
139
148
// When set to "OCIImage", the bundle image is used directly. Direct sources do not perform
@@ -142,9 +151,11 @@ type SourceConfig struct {
142
151
// When set to "Catalog", information for determining the appropriate bundle of content to install
143
152
// is fetched from ClusterCatalog resources on the cluster.
144
153
// When using the Catalog sourceType, the catalog field must also be set.
// OCIImageSource identifies a bundle image to install directly from an OCI registry.
178
+
// +kubebuilder:validation:MinProperties:=1
165
179
typeOCIImageSourcestruct {
166
180
// ref is a Docker-style image reference with a tag or digest.
167
181
//
168
182
// +required
169
183
// +kubebuilder:validation:MaxLength:=1000
170
-
// +kubebuilder:validation:XValidation:rule="self.matches(\"^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])((\\\\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(:[0-9]+)?\\\\b\")",message="must start with a valid domain"
171
-
// +kubebuilder:validation:XValidation:rule="self.find(\"(\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?((\\\\/[a-z0-9]+((([._]|__|[-]*)[a-z0-9]+)+)?)+)?)\") != \"\"",message="a valid image name is required"
172
-
// +kubebuilder:validation:XValidation:rule="self.find(\"(@.*:)\") != \"\" || self.find(\":.*$\") != \"\"",message="must end with a digest or a tag"
// +kubebuilder:validation:XValidation:rule="self.find(\"(@.*:)\") != \"\" ? self.find(\"(@.*:)\").matches(\"(@[A-Za-z][A-Za-z0-9]*([-_+.][A-Za-z][A-Za-z0-9]*)*[:])\") : true",message="digest algorithm is not valid"
176
-
// +kubebuilder:validation:XValidation:rule="self.find(\"(@.*:)\") != \"\" ? self.find(\":.*$\").substring(1).size() >= 32 : true",message="digest is not valid"
177
-
// +kubebuilder:validation:XValidation:rule="self.find(\"(@.*:)\") != \"\" ? self.find(\":.*$\").matches(\":[0-9A-Fa-f]*$\") : true",message="digest is not valid"
178
-
Refstring`json:"ref"`
184
+
// +kubebuilder:validation:MinLength:=1
185
+
// +kubebuilder:validation:XValidation:rule="self.matches(\"^[a-zA-Z0-9]([a-zA-Z0-9.-]*[a-zA-Z0-9])?(:[0-9]+)?/[a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)*(:[A-Za-z0-9_][A-Za-z0-9_.-]{0,126}|@[A-Za-z][A-Za-z0-9+._-]*:[0-9A-Fa-f]{32,})$\")",message="must be a complete image reference with a valid repository and tag or digest"
186
+
Refstring`json:"ref,omitempty"`
179
187
}
180
188
181
189
// ClusterExtensionInstallConfig is a union which selects the clusterExtension installation config.
Copy file name to clipboardExpand all lines: docs/api-reference/olmv1-api-reference.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -463,14 +463,15 @@ _Appears in:_
463
463
464
464
OCIImageSource identifies a bundle image to install directly from an OCI registry.
465
465
466
-
466
+
_Validation:_
467
+
- MinProperties: 1
467
468
468
469
_Appears in:_
469
470
-[SourceConfig](#sourceconfig)
470
471
471
472
| Field | Description | Default | Validation |
472
473
| --- | --- | --- | --- |
473
-
|`ref`_string_| ref is a Docker-style image reference with a tag or digest. || MaxLength: 1000 <br />Required: \{\} <br /> |
474
+
|`ref`_string_| ref is a Docker-style image reference with a tag or digest. || MaxLength: 1000 <br />MinLength: 1 <br />Required: \{\} <br /> |
474
475
475
476
476
477
#### ObjectSelector
@@ -622,16 +623,18 @@ _Appears in:_
622
623
623
624
SourceConfig is a discriminated union which selects the installation source.
624
625
626
+
<opcon:experimental:validation:XValidation:rule="has(self.sourceType) && self.sourceType == 'OCIImage' ? self.ociImage.ref.size() != 0 : self.ociImage.ref.size() == 0",message="ociImage is required when sourceType is OCIImage, and forbidden otherwise">
627
+
625
628
626
629
627
630
_Appears in:_
628
631
-[ClusterExtensionSpec](#clusterextensionspec)
629
632
630
633
| Field | Description | Default | Validation |
631
634
| --- | --- | --- | --- |
632
-
|`sourceType`_string_| sourceType is required and specifies the type of install source.<br />The allowed values are "Catalog" and "OCIImage".<br />When set to "OCIImage", the bundle image is used directly. Direct sources do not perform<br />dependency resolution and are only supported by the Boxcutter runtime.<br />When set to "Catalog", information for determining the appropriate bundle of content to install<br />is fetched from ClusterCatalog resources on the cluster.<br />When using the Catalog sourceType, the catalog field must also be set. || Enum: [Catalog OCIImage] <br />Required: \{\} <br /> |
635
+
| `sourceType` _string_ | sourceType is required and specifies the type of install source.<br /><opcon:standard:description><br />The allowed value is "Catalog".<br />When set to "Catalog", information for determining the appropriate bundle of content to install<br />is fetched from ClusterCatalog resources on the cluster.<br />When using the Catalog sourceType, the catalog field must also be set.<br /></opcon:standard:description><br /><opcon:experimental:description><br />The allowed values are "Catalog" and "OCIImage".<br />When set to "OCIImage", the bundle image is used directly. Direct sources do not perform<br />dependency resolution and are only supported by the Boxcutter runtime.<br />When set to "Catalog", information for determining the appropriate bundle of content to install<br />is fetched from ClusterCatalog resources on the cluster.<br />When using the Catalog sourceType, the catalog field must also be set.<br /></opcon:experimental:description><br /><opcon:experimental:validation:Enum=Catalog;OCIImage> | | Enum: [Catalog] <br />Required: \{\} <br /> |
633
636
|`catalog`_[CatalogFilter](#catalogfilter)_| catalog configures how information is sourced from a catalog.<br />It is required when sourceType is "Catalog", and forbidden otherwise. || Optional: \{\} <br /> |
634
-
|`ociImage`_[OCIImageSource](#ociimagesource)_| ociImage configures a bundle image to install directly.<br />They do not provide catalog dependency resolution or upgrade safety.|| Optional: \{\} <br /> |
637
+
|`ociImage`_[OCIImageSource](#ociimagesource)_| ociImage configures a bundle image to install directly.<br /><opcon:experimental:description><br />They do not provide catalog dependency resolution or upgrade safety.<br /></opcon:experimental:description><br /><opcon:experimental>||MinProperties: 1 <br />Optional: \{\} <br /> |
0 commit comments