From ddfb930b03d07bc8075338b56bed3d4a8aaa146f Mon Sep 17 00:00:00 2001 From: air-31 Date: Wed, 6 Nov 2024 17:36:27 +0100 Subject: [PATCH] Add InstanceSnapshot status validation --- operators/api/v1alpha2/instancesnapshot_types.go | 2 ++ .../deploy/crds/crownlabs.polito.it_instancesnapshots.yaml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/operators/api/v1alpha2/instancesnapshot_types.go b/operators/api/v1alpha2/instancesnapshot_types.go index 4c616ffc5..d50676393 100644 --- a/operators/api/v1alpha2/instancesnapshot_types.go +++ b/operators/api/v1alpha2/instancesnapshot_types.go @@ -21,6 +21,8 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +// +kubebuilder:validation:Enum="";"Pending";"Processing";"Completed";"Failed" + // SnapshotStatus is an enumeration representing the current state of the InstanceSnapshot. type SnapshotStatus string diff --git a/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml b/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml index f8857170e..9911de962 100644 --- a/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml @@ -98,6 +98,12 @@ spec: properties: phase: description: Phase represents the current state of the Instance Snapshot. + enum: + - "" + - Pending + - Processing + - Completed + - Failed type: string required: - phase