Skip to content

Commit

Permalink
🐛 Add enum validation for source type (#214)
Browse files Browse the repository at this point in the history
Add enum validation for source type

Signed-off-by: Bryce Palmer <everettraven@gmail.com>
  • Loading branch information
everettraven authored Nov 22, 2023
1 parent 404dc58 commit 093cae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/core/v1alpha1/catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/catalogd.operatorframework.io_catalogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ spec:
type: object
type:
description: Type defines the kind of Catalog content being sourced.
enum:
- image
type: string
required:
- type
Expand Down

0 comments on commit 093cae4

Please sign in to comment.