From 2fe5eb28687a55ac3c59f2d134cea201defeaea7 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 24 Sep 2024 12:42:45 -0400 Subject: [PATCH] api: add k8s validation for workflow names to be unique Signed-off-by: Raghavendra Talur Co-Authored-by: Annaraya Narasagond --- api/v1alpha1/recipe_types.go | 2 ++ config/crd/bases/ramendr.openshift.io_recipes.yaml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/api/v1alpha1/recipe_types.go b/api/v1alpha1/recipe_types.go index 3611046..8fe6df6 100644 --- a/api/v1alpha1/recipe_types.go +++ b/api/v1alpha1/recipe_types.go @@ -39,6 +39,8 @@ type RecipeSpec struct { //+listMapKey=name Hooks []*Hook `json:"hooks,omitempty"` // Workflow is the sequence of actions to take + //+listType=map + //+listMapKey=name //+optional Workflows []*Workflow `json:"workflows"` } diff --git a/config/crd/bases/ramendr.openshift.io_recipes.yaml b/config/crd/bases/ramendr.openshift.io_recipes.yaml index 8629d8e..acdb80f 100644 --- a/config/crd/bases/ramendr.openshift.io_recipes.yaml +++ b/config/crd/bases/ramendr.openshift.io_recipes.yaml @@ -612,6 +612,9 @@ spec: - sequence type: object type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map required: - appType type: object