From 64db2d9c58352c651e7022880255e0142638cd60 Mon Sep 17 00:00:00 2001 From: Ashwin Venkatesh Date: Tue, 7 Nov 2023 11:02:38 -0500 Subject: [PATCH] Add kubebuilder annotations to enums (#19454) --- proto-public/pbcatalog/v2beta1/failover_policy.pb.go | 2 ++ proto-public/pbcatalog/v2beta1/failover_policy.proto | 2 ++ proto-public/pbcatalog/v2beta1/health.pb.go | 2 ++ proto-public/pbcatalog/v2beta1/health.proto | 2 ++ 4 files changed, 8 insertions(+) diff --git a/proto-public/pbcatalog/v2beta1/failover_policy.pb.go b/proto-public/pbcatalog/v2beta1/failover_policy.pb.go index 58e70174a1..844e9e7a0a 100644 --- a/proto-public/pbcatalog/v2beta1/failover_policy.pb.go +++ b/proto-public/pbcatalog/v2beta1/failover_policy.pb.go @@ -24,6 +24,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// +kubebuilder:validation:Enum=FAILOVER_MODE_UNSPECIFIED;FAILOVER_MODE_SEQUENTIAL;FAILOVER_MODE_ORDER_BY_LOCALITY +// +kubebuilder:validation:Type=string type FailoverMode int32 const ( diff --git a/proto-public/pbcatalog/v2beta1/failover_policy.proto b/proto-public/pbcatalog/v2beta1/failover_policy.proto index dec86807f7..abbeb46a3a 100644 --- a/proto-public/pbcatalog/v2beta1/failover_policy.proto +++ b/proto-public/pbcatalog/v2beta1/failover_policy.proto @@ -43,6 +43,8 @@ message FailoverDestination { string datacenter = 3; } +// +kubebuilder:validation:Enum=FAILOVER_MODE_UNSPECIFIED;FAILOVER_MODE_SEQUENTIAL;FAILOVER_MODE_ORDER_BY_LOCALITY +// +kubebuilder:validation:Type=string enum FailoverMode { FAILOVER_MODE_UNSPECIFIED = 0; FAILOVER_MODE_SEQUENTIAL = 1; diff --git a/proto-public/pbcatalog/v2beta1/health.pb.go b/proto-public/pbcatalog/v2beta1/health.pb.go index 93b045b017..154a183831 100644 --- a/proto-public/pbcatalog/v2beta1/health.pb.go +++ b/proto-public/pbcatalog/v2beta1/health.pb.go @@ -25,6 +25,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// +kubebuilder:validation:Enum=HEALTH_ANY;HEALTH_PASSING;HEALTH_WARNING;HEALTH_CRITICAL;HEALTH_MAINTENANCE +// +kubebuilder:validation:Type=string type Health int32 const ( diff --git a/proto-public/pbcatalog/v2beta1/health.proto b/proto-public/pbcatalog/v2beta1/health.proto index 316c58d5d1..29b4f5bf4c 100644 --- a/proto-public/pbcatalog/v2beta1/health.proto +++ b/proto-public/pbcatalog/v2beta1/health.proto @@ -23,6 +23,8 @@ message HealthStatus { string output = 4; } +// +kubebuilder:validation:Enum=HEALTH_ANY;HEALTH_PASSING;HEALTH_WARNING;HEALTH_CRITICAL;HEALTH_MAINTENANCE +// +kubebuilder:validation:Type=string enum Health { // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX HEALTH_ANY = 0;