Add kubebuilder annotations to enums (#19454)

This commit is contained in:
Ashwin Venkatesh 2023-11-07 11:02:38 -05:00 committed by GitHub
parent f115cdb1d5
commit 64db2d9c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,8 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = 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 type FailoverMode int32
const ( const (

View File

@ -43,6 +43,8 @@ message FailoverDestination {
string datacenter = 3; string datacenter = 3;
} }
// +kubebuilder:validation:Enum=FAILOVER_MODE_UNSPECIFIED;FAILOVER_MODE_SEQUENTIAL;FAILOVER_MODE_ORDER_BY_LOCALITY
// +kubebuilder:validation:Type=string
enum FailoverMode { enum FailoverMode {
FAILOVER_MODE_UNSPECIFIED = 0; FAILOVER_MODE_UNSPECIFIED = 0;
FAILOVER_MODE_SEQUENTIAL = 1; FAILOVER_MODE_SEQUENTIAL = 1;

View File

@ -25,6 +25,8 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = 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 type Health int32
const ( const (

View File

@ -23,6 +23,8 @@ message HealthStatus {
string output = 4; string output = 4;
} }
// +kubebuilder:validation:Enum=HEALTH_ANY;HEALTH_PASSING;HEALTH_WARNING;HEALTH_CRITICAL;HEALTH_MAINTENANCE
// +kubebuilder:validation:Type=string
enum Health { enum Health {
// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
HEALTH_ANY = 0; HEALTH_ANY = 0;