diff --git a/api/core/v1alpha1/clustercatalog_types.go b/api/core/v1alpha1/clustercatalog_types.go index 8d8d72e5..3f4f1440 100644 --- a/api/core/v1alpha1/clustercatalog_types.go +++ b/api/core/v1alpha1/clustercatalog_types.go @@ -65,8 +65,10 @@ type ClusterCatalog struct { // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ObjectMeta `json:"metadata"` - // spec is the desired state of the ClusterCatalog. The controller will work - // to ensure that the desired catalog is unpacked and served over the catalog content HTTP server. + // spec is the desired state of the ClusterCatalog. + // spec is required. + // The controller will work to ensure that the desired + // catalog is unpacked and served over the catalog content HTTP server. // +kubebuilder:validation:Required Spec ClusterCatalogSpec `json:"spec"` @@ -88,7 +90,8 @@ type ClusterCatalogList struct { // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ListMeta `json:"metadata"` - // items is a list of ClusterCatalogs + // items is a list of ClusterCatalogs. + // items is required. // +kubebuilder:validation:Required Items []ClusterCatalog `json:"items"` } @@ -99,6 +102,8 @@ type ClusterCatalogSpec struct { // A "catalog" contains information on content that can be installed on a cluster. // Providing a catalog source makes the contents of the catalog discoverable and usable by // other on-cluster components. + // These on-cluster components may do a variety of things with this information, such as + // presenting the content in a GUI dashboard or installing content from the catalog on the cluster. // The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format. // For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs. // source is a required field. @@ -117,7 +122,7 @@ type ClusterCatalogSpec struct { // priority is optional. // // A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements. - // It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet + // It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements. // For example, in the case where multiple ClusterCatalogs provide the same bundle. // A higher number means higher priority. // @@ -126,7 +131,12 @@ type ClusterCatalogSpec struct { // Negative numbers can be used to specify a priority lower than the default. // Positive numbers can be used to specify a priority higher than the default. // + // The lowest possible value is -2147483648. + // The highest possible value is 214748647. + // // +kubebuilder:default:=0 + // +kubebuilder:validation:minimum:=-2147483648 + // +kubebuilder:validation:maximum:=214748647 // +optional Priority int32 `json:"priority"` @@ -146,8 +156,8 @@ type ClusterCatalogSpec struct { // Setting the availabilityMode to "Unavailable" can be useful in scenarios where a user may not want // to delete the ClusterCatalog all together, but would still like it to be treated as if it doesn't exist. // - // +kubebuilder:validation:Enum="Unavailable";"Available" - // +kubebuilder:default="Available" + // +kubebuilder:validation:Enum:="Unavailable";"Available" + // +kubebuilder:default:="Available" // +optional AvailabilityMode AvailabilityMode `json:"availabilityMode,omitempty"` } @@ -183,7 +193,7 @@ type ClusterCatalogStatus struct { // urls contains the URLs that can be used to access the catalog. // +optional URLs *ClusterCatalogURLs `json:"urls,omitempty"` - // lastUnpacked represents the time when the contents of the + // lastUnpacked represents the last time the contents of the // catalog were extracted from their source format. As an example, // when using an Image source, the OCI image will be pulled and the // image layers written to a file-system backed cache. We refer to the @@ -213,7 +223,7 @@ type ClusterCatalogURLs struct { // REST API may be added. // // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength:525 + // +kubebuilder:validation:MaxLength:=525 Base string `json:"base"` } @@ -270,7 +280,7 @@ type ResolvedImageSource struct { // The digest format is used so users can use other tooling to fetch the exact // OCI manifests that were used to extract the catalog contents. // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength:1000 + // +kubebuilder:validation:MaxLength:=1000 Ref string `json:"ref"` } @@ -320,7 +330,7 @@ type ImageSource struct { // An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest" // // +kubebuilder:validation:Required - // +kubebuilder:validation:MaxLength:1000 + // +kubebuilder:validation:MaxLength:=1000 Ref string `json:"ref"` // pollIntervalMinutes allows the user to set the interval, in minutes, at which the image source should be polled for new content. @@ -328,7 +338,7 @@ type ImageSource struct { // pollIntervalMinutes can not be specified when ref is a digest-based reference. // // When omitted, the image will not be polled for new content. - // +kubebuilder:validation:Minimum:1 + // +kubebuilder:validation:Minimum:=1 // +optional PollIntervalMinutes *int `json:"pollIntervalMinutes,omitempty"` } diff --git a/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml b/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml index 3a7b3d21..58fdae20 100644 --- a/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml +++ b/config/base/crd/bases/olm.operatorframework.io_clustercatalogs.yaml @@ -50,8 +50,10 @@ spec: type: object spec: description: |- - spec is the desired state of the ClusterCatalog. The controller will work - to ensure that the desired catalog is unpacked and served over the catalog content HTTP server. + spec is the desired state of the ClusterCatalog. + spec is required. + The controller will work to ensure that the desired + catalog is unpacked and served over the catalog content HTTP server. properties: availabilityMode: default: Available @@ -82,7 +84,7 @@ spec: priority is optional. A ClusterCatalog's priority is used by clients as a tie-breaker between ClusterCatalogs that meet the client's requirements. - It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet + It is up to clients to decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements. For example, in the case where multiple ClusterCatalogs provide the same bundle. A higher number means higher priority. @@ -90,6 +92,9 @@ spec: Negative numbers can be used to specify a priority lower than the default. Positive numbers can be used to specify a priority higher than the default. + + The lowest possible value is -2147483648. + The highest possible value is 214748647. format: int32 type: integer source: @@ -98,6 +103,8 @@ spec: A "catalog" contains information on content that can be installed on a cluster. Providing a catalog source makes the contents of the catalog discoverable and usable by other on-cluster components. + These on-cluster components may do a variety of things with this information, such as + presenting the content in a GUI dashboard or installing content from the catalog on the cluster. The catalog source must contain catalog metadata in the File-Based Catalog (FBC) format. For more information on FBC, see https://olm.operatorframework.io/docs/reference/file-based-catalogs/#docs. source is a required field. @@ -121,6 +128,7 @@ spec: pollIntervalMinutes can not be specified when ref is a digest-based reference. When omitted, the image will not be polled for new content. + minimum: 1 type: integer ref: description: |- @@ -161,6 +169,7 @@ spec: An example of a valid digest-based image reference is "quay.io/operatorhubio/catalog@sha256:200d4ddb2a73594b91358fe6397424e975205bfbe44614f5846033cad64b3f05" An example of a valid tag-based image reference is "quay.io/operatorhubio/catalog:latest" + maxLength: 1000 type: string required: - ref @@ -311,6 +320,7 @@ spec: ref contains the resolved image digest-based reference. The digest format is used so users can use other tooling to fetch the exact OCI manifests that were used to extract the catalog contents. + maxLength: 1000 type: string required: - ref @@ -364,6 +374,7 @@ spec: As the needs of users and clients of the REST API evolve, new versions of the REST API may be added. + maxLength: 525 type: string required: - base