From 9c2cfd203c07b0173c7f6de0149c420a77cfd815 Mon Sep 17 00:00:00 2001 From: Tapajit Chandra Paul Date: Mon, 2 Dec 2024 19:18:07 +0600 Subject: [PATCH] Remove redundant database phase Signed-off-by: Tapajit Chandra Paul --- apis/kubedb/v1alpha2/druid_types.go | 12 +----------- apis/kubedb/v1alpha2/rabbitmq_types.go | 12 +----------- crds/kubedb.com_druids.yaml | 5 ++++- crds/kubedb.com_rabbitmqs.yaml | 5 ++++- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/apis/kubedb/v1alpha2/druid_types.go b/apis/kubedb/v1alpha2/druid_types.go index 3ffd2dedee..fbca1a0570 100644 --- a/apis/kubedb/v1alpha2/druid_types.go +++ b/apis/kubedb/v1alpha2/druid_types.go @@ -223,7 +223,7 @@ type ZookeeperRef struct { type DruidStatus struct { // Specifies the current phase of the database // +optional - Phase DruidPhase `json:"phase,omitempty"` + Phase DatabasePhase `json:"phase,omitempty"` // observedGeneration is the most recent generation observed for this resource. It corresponds to the // resource's generation, which is updated on mutation by the API Server. // +optional @@ -242,16 +242,6 @@ type DruidList struct { Items []Druid `json:"items"` } -// +kubebuilder:validation:Enum=Provisioning;Ready;NotReady;Critical -type DruidPhase string - -const ( - DruidPhaseProvisioning DruidPhase = "Provisioning" - DruidPhaseReady DruidPhase = "Ready" - DruidPhaseNotReady DruidPhase = "NotReady" - DruidPhaseCritical DruidPhase = "Critical" -) - // +kubebuilder:validation:Enum=coordinators;overlords;brokers;routers;middleManagers;historicals type DruidNodeRoleType string diff --git a/apis/kubedb/v1alpha2/rabbitmq_types.go b/apis/kubedb/v1alpha2/rabbitmq_types.go index bb42ff5a79..f360bf5564 100644 --- a/apis/kubedb/v1alpha2/rabbitmq_types.go +++ b/apis/kubedb/v1alpha2/rabbitmq_types.go @@ -122,7 +122,7 @@ type RabbitMQSpec struct { type RabbitMQStatus struct { // Specifies the current phase of the database // +optional - Phase RabbitMQPhase `json:"phase,omitempty"` + Phase DatabasePhase `json:"phase,omitempty"` // observedGeneration is the most recent generation observed for this resource. It corresponds to the // resource's generation, which is updated on mutation by the API Server. // +optional @@ -132,16 +132,6 @@ type RabbitMQStatus struct { Conditions []kmapi.Condition `json:"conditions,omitempty"` } -// +kubebuilder:validation:Enum=Provisioning;Ready;NotReady;Critical -type RabbitMQPhase string - -const ( - RabbitmqProvisioning RabbitMQPhase = "Provisioning" - RabbitmqReady RabbitMQPhase = "Ready" - RabbitmqNotReady RabbitMQPhase = "NotReady" - RabbitmqCritical RabbitMQPhase = "Critical" -) - // +kubebuilder:validation:Enum=ca;client;server type RabbitMQCertificateAlias string diff --git a/crds/kubedb.com_druids.yaml b/crds/kubedb.com_druids.yaml index ae2e6e6e7a..07ba49b0d0 100644 --- a/crds/kubedb.com_druids.yaml +++ b/crds/kubedb.com_druids.yaml @@ -20246,9 +20246,12 @@ spec: phase: enum: - Provisioning + - DataRestoring - Ready - - NotReady - Critical + - NotReady + - Halted + - Unknown type: string type: object type: object diff --git a/crds/kubedb.com_rabbitmqs.yaml b/crds/kubedb.com_rabbitmqs.yaml index 3071bd071c..396e2d7f0b 100644 --- a/crds/kubedb.com_rabbitmqs.yaml +++ b/crds/kubedb.com_rabbitmqs.yaml @@ -3684,9 +3684,12 @@ spec: phase: enum: - Provisioning + - DataRestoring - Ready - - NotReady - Critical + - NotReady + - Halted + - Unknown type: string type: object type: object