From 093cae494940a38f51c529a48f5b5b8407d426cf Mon Sep 17 00:00:00 2001 From: Bryce Palmer Date: Tue, 21 Nov 2023 21:45:23 -0500 Subject: [PATCH] :bug: Add enum validation for source type (#214) Add enum validation for source type Signed-off-by: Bryce Palmer --- api/core/v1alpha1/catalog_types.go | 1 + config/crd/bases/catalogd.operatorframework.io_catalogs.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/api/core/v1alpha1/catalog_types.go b/api/core/v1alpha1/catalog_types.go index fd136884..2278ccdc 100644 --- a/api/core/v1alpha1/catalog_types.go +++ b/api/core/v1alpha1/catalog_types.go @@ -99,6 +99,7 @@ type CatalogStatus struct { // CatalogSource contains the sourcing information for a Catalog type CatalogSource struct { // Type defines the kind of Catalog content being sourced. + // +kubebuilder:validation:Enum=image Type SourceType `json:"type"` // Image is the catalog image that backs the content of this catalog. Image *ImageSource `json:"image,omitempty"` diff --git a/config/crd/bases/catalogd.operatorframework.io_catalogs.yaml b/config/crd/bases/catalogd.operatorframework.io_catalogs.yaml index 6564bab8..624331d2 100644 --- a/config/crd/bases/catalogd.operatorframework.io_catalogs.yaml +++ b/config/crd/bases/catalogd.operatorframework.io_catalogs.yaml @@ -76,6 +76,8 @@ spec: type: object type: description: Type defines the kind of Catalog content being sourced. + enum: + - image type: string required: - type