From 075d99e30f117c4bfd788fc3950c1a05a3cf3108 Mon Sep 17 00:00:00 2001 From: Manabu McCloskey Date: Mon, 3 Jun 2024 18:05:59 +0000 Subject: [PATCH] enable validation for custom package type Signed-off-by: Manabu McCloskey --- api/v1alpha1/custom_package_types.go | 3 ++- .../resources/idpbuilder.cnoe.io_custompackages.yaml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/custom_package_types.go b/api/v1alpha1/custom_package_types.go index ef421929..69d5ade5 100644 --- a/api/v1alpha1/custom_package_types.go +++ b/api/v1alpha1/custom_package_types.go @@ -56,7 +56,8 @@ type ArgoCDPackageSpec struct { ApplicationFile string `json:"applicationFile"` Name string `json:"name"` Namespace string `json:"namespace"` - Type string `json:"type"` + // +kubebuilder:validation:Enum:=Application;ApplicationSet + Type string `json:"type"` } type CustomPackageStatus struct { diff --git a/pkg/controllers/resources/idpbuilder.cnoe.io_custompackages.yaml b/pkg/controllers/resources/idpbuilder.cnoe.io_custompackages.yaml index 6ad4f86d..f22b5ec8 100644 --- a/pkg/controllers/resources/idpbuilder.cnoe.io_custompackages.yaml +++ b/pkg/controllers/resources/idpbuilder.cnoe.io_custompackages.yaml @@ -50,6 +50,9 @@ spec: namespace: type: string type: + enum: + - Application + - ApplicationSet type: string required: - applicationFile