From 5eca27196c9f48d666c8aea2174347c5871f3909 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Wed, 7 Jan 2026 12:08:02 +0000
Subject: [PATCH] Fix ClusterCatalog Priority field validation markers
Changes validation markers from lowercase to uppercase to ensure
min/max constraints are properly generated in the CRD YAML.
Changes:
- +kubebuilder:validation:minimum -> +kubebuilder:validation:Minimum
- +kubebuilder:validation:maximum -> +kubebuilder:validation:Maximum
The lowercase markers (minimum/maximum) were not generating the
validation constraints in the generated CRD. Using uppercase markers
(Minimum/Maximum) ensures the CRD includes:
minimum: -2147483648
maximum: 2147483647
This completes the validation for the Priority field and resolves
the kubeapilinter:optionalfields warning about incomplete validation.
---
api/v1/clustercatalog_types.go | 4 ++--
docs/api-reference/olmv1-api-reference.md | 2 +-
.../olm.operatorframework.io_clustercatalogs.yaml | 2 ++
.../standard/olm.operatorframework.io_clustercatalogs.yaml | 2 ++
manifests/experimental-e2e.yaml | 2 ++
manifests/experimental.yaml | 2 ++
manifests/standard-e2e.yaml | 2 ++
manifests/standard.yaml | 2 ++
8 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/api/v1/clustercatalog_types.go b/api/v1/clustercatalog_types.go
index 8df90a8060..fbd9a2dce5 100644
--- a/api/v1/clustercatalog_types.go
+++ b/api/v1/clustercatalog_types.go
@@ -125,8 +125,8 @@ type ClusterCatalogSpec struct {
// The highest possible value is 2147483647.
//
// +kubebuilder:default:=0
- // +kubebuilder:validation:minimum:=-2147483648
- // +kubebuilder:validation:maximum:=2147483647
+ // +kubebuilder:validation:Minimum:=-2147483648
+ // +kubebuilder:validation:Maximum:=2147483647
// +optional
Priority int32 `json:"priority"`
diff --git a/docs/api-reference/olmv1-api-reference.md b/docs/api-reference/olmv1-api-reference.md
index 410d7d693f..4feb0d6323 100644
--- a/docs/api-reference/olmv1-api-reference.md
+++ b/docs/api-reference/olmv1-api-reference.md
@@ -178,7 +178,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `source` _[CatalogSource](#catalogsource)_ | source is a required field that defines the source of a catalog.
A catalog contains information on content that can be installed on a cluster.
The catalog source makes catalog contents discoverable and usable by other on-cluster components.
These components can present the content in a GUI dashboard or install 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.
Below is a minimal example of a ClusterCatalogSpec that sources a catalog from an image:
source:
type: Image
image:
ref: quay.io/operatorhubio/catalog:latest | | Required: \{\}
|
-| `priority` _integer_ | priority is an optional field that defines a priority for this ClusterCatalog.
Clients use the ClusterCatalog priority as a tie-breaker between ClusterCatalogs that meet their requirements.
Higher numbers mean higher priority.
Clients decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
Clients should prompt users for additional input to break the tie.
When omitted, the default priority is 0.
Use negative numbers to specify a priority lower than the default.
Use positive numbers to specify a priority higher than the default.
The lowest possible value is -2147483648.
The highest possible value is 2147483647. | 0 | |
+| `priority` _integer_ | priority is an optional field that defines a priority for this ClusterCatalog.
Clients use the ClusterCatalog priority as a tie-breaker between ClusterCatalogs that meet their requirements.
Higher numbers mean higher priority.
Clients decide how to handle scenarios where multiple ClusterCatalogs with the same priority meet their requirements.
Clients should prompt users for additional input to break the tie.
When omitted, the default priority is 0.
Use negative numbers to specify a priority lower than the default.
Use positive numbers to specify a priority higher than the default.
The lowest possible value is -2147483648.
The highest possible value is 2147483647. | 0 | Maximum: 2.147483647e+09
Minimum: -2.147483648e+09
|
| `availabilityMode` _[AvailabilityMode](#availabilitymode)_ | availabilityMode is an optional field that defines how the ClusterCatalog is made available to clients on the cluster.
Allowed values are "Available", "Unavailable", or omitted.
When omitted, the default value is "Available".
When set to "Available", the catalog contents are unpacked and served over the catalog content HTTP server.
Clients should consider this ClusterCatalog and its contents as usable.
When set to "Unavailable", the catalog contents are no longer served over the catalog content HTTP server.
Treat this the same as if the ClusterCatalog does not exist.
Use "Unavailable" when you want to keep the ClusterCatalog but treat it as if it doesn't exist. | Available | Enum: [Unavailable Available]
|
diff --git a/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml b/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml
index a4b1cda870..39d6e906fc 100644
--- a/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml
+++ b/helm/olmv1/base/catalogd/crd/experimental/olm.operatorframework.io_clustercatalogs.yaml
@@ -92,6 +92,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-
diff --git a/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml b/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml
index 2c9447a135..1a97fdfe0a 100644
--- a/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml
+++ b/helm/olmv1/base/catalogd/crd/standard/olm.operatorframework.io_clustercatalogs.yaml
@@ -92,6 +92,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-
diff --git a/manifests/experimental-e2e.yaml b/manifests/experimental-e2e.yaml
index 39e145212d..8d56b5ad4d 100644
--- a/manifests/experimental-e2e.yaml
+++ b/manifests/experimental-e2e.yaml
@@ -278,6 +278,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-
diff --git a/manifests/experimental.yaml b/manifests/experimental.yaml
index fafc202007..324a0fe4c5 100644
--- a/manifests/experimental.yaml
+++ b/manifests/experimental.yaml
@@ -239,6 +239,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-
diff --git a/manifests/standard-e2e.yaml b/manifests/standard-e2e.yaml
index 3660c2d6e9..51c3b412c5 100644
--- a/manifests/standard-e2e.yaml
+++ b/manifests/standard-e2e.yaml
@@ -278,6 +278,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-
diff --git a/manifests/standard.yaml b/manifests/standard.yaml
index 9b122ea321..16c489f761 100644
--- a/manifests/standard.yaml
+++ b/manifests/standard.yaml
@@ -239,6 +239,8 @@ spec:
The lowest possible value is -2147483648.
The highest possible value is 2147483647.
format: int32
+ maximum: 2147483647
+ minimum: -2147483648
type: integer
source:
description: |-