Skip to content

Commit

Permalink
Update ops request enumerations
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 2, 2020
1 parent 41083a9 commit c31cd2f
Show file tree
Hide file tree
Showing 26 changed files with 243 additions and 70 deletions.
3 changes: 3 additions & 0 deletions apis/ops/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion apis/ops/v1alpha1/mongodb_ops_types.go
Expand Up @@ -74,7 +74,10 @@ type MongoDBOpsRequestSpec struct {
// MongoDBReadinessCriteria is the criteria for checking readiness of a MongoDB pod
// after updating, horizontal scaling etc.
type MongoDBReadinessCriteria struct {
OplogMaxLagSeconds int32 `json:"oplogMaxLagSeconds,omitempty" protobuf:"varint,1,opt,name=oplogMaxLagSeconds"`
// +kubebuilder:validation:Minimum:=0
OplogMaxLagSeconds int32 `json:"oplogMaxLagSeconds,omitempty" protobuf:"varint,1,opt,name=oplogMaxLagSeconds"`
// +kubebuilder:validation:Minimum:=0
// +kubebuilder:validation:Maximum:=100
DBSizeDiffPercentage int32 `json:"dbSizeDiffPercentage,omitempty" protobuf:"varint,2,opt,name=dbSizeDiffPercentage"`
}

Expand Down
7 changes: 4 additions & 3 deletions apis/ops/v1alpha1/type.go
Expand Up @@ -85,6 +85,7 @@ const (
ConfigServerVolumeExpansion = "ConfigServerVolumeExpansion"
)

// +kubebuilder:validation:Enum=Progressing;Successful;WaitingForApproval;Failed;Approved;Denied
type OpsRequestPhase string

const (
Expand All @@ -102,7 +103,7 @@ const (
OpsRequestDenied OpsRequestPhase = "Denied"
)

// +kubebuilder:validation:Enum=Upgrade;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;RotateCertificates;Reconfigure
// +kubebuilder:validation:Enum=Upgrade;HorizontalScaling;VerticalScaling;VolumeExpansion;Restart;Reconfigure;ReconfigureTLS
type OpsRequestType string

const (
Expand All @@ -118,8 +119,8 @@ const (
OpsRequestTypeRestart OpsRequestType = "Restart"
// used for Reconfigure operation
OpsRequestTypeReconfigure OpsRequestType = "Reconfigure"
// used for RotateCertificates operation
OpsRequestTypeRotateCertificates OpsRequestType = "ReconfigureTLS"
// used for ReconfigureTLS operation
OpsRequestTypeReconfigureTLSs OpsRequestType = "ReconfigureTLS"
)

type RestartSpec struct {
Expand Down
88 changes: 44 additions & 44 deletions crds/bindata.go

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_elasticsearchopsrequests.v1.yaml
Expand Up @@ -161,8 +161,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -213,6 +213,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_elasticsearchopsrequests.yaml
Expand Up @@ -162,8 +162,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -214,6 +214,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_etcdopsrequests.v1.yaml
Expand Up @@ -151,8 +151,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -203,6 +203,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_etcdopsrequests.yaml
Expand Up @@ -152,8 +152,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -204,6 +204,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_mariadbopsrequests.v1.yaml
Expand Up @@ -158,8 +158,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -246,6 +246,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_mariadbopsrequests.yaml
Expand Up @@ -159,8 +159,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -247,6 +247,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_memcachedopsrequests.v1.yaml
Expand Up @@ -151,8 +151,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -203,6 +203,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_memcachedopsrequests.yaml
Expand Up @@ -152,8 +152,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -204,6 +204,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
15 changes: 14 additions & 1 deletion crds/ops.kubedb.com_mongodbopsrequests.v1.yaml
Expand Up @@ -247,18 +247,21 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
readinessCriteria:
properties:
dbSizeDiffPercentage:
format: int32
maximum: 100
minimum: 0
type: integer
oplogMaxLagSeconds:
format: int32
minimum: 0
type: integer
type: object
targetVersion:
Expand Down Expand Up @@ -327,9 +330,12 @@ spec:
properties:
dbSizeDiffPercentage:
format: int32
maximum: 100
minimum: 0
type: integer
oplogMaxLagSeconds:
format: int32
minimum: 0
type: integer
type: object
replicaSet:
Expand Down Expand Up @@ -452,6 +458,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
15 changes: 14 additions & 1 deletion crds/ops.kubedb.com_mongodbopsrequests.yaml
Expand Up @@ -248,18 +248,21 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
readinessCriteria:
properties:
dbSizeDiffPercentage:
format: int32
maximum: 100
minimum: 0
type: integer
oplogMaxLagSeconds:
format: int32
minimum: 0
type: integer
type: object
targetVersion:
Expand Down Expand Up @@ -328,9 +331,12 @@ spec:
properties:
dbSizeDiffPercentage:
format: int32
maximum: 100
minimum: 0
type: integer
oplogMaxLagSeconds:
format: int32
minimum: 0
type: integer
type: object
replicaSet:
Expand Down Expand Up @@ -453,6 +459,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_mysqlopsrequests.v1.yaml
Expand Up @@ -158,8 +158,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -246,6 +246,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down
9 changes: 8 additions & 1 deletion crds/ops.kubedb.com_mysqlopsrequests.yaml
Expand Up @@ -159,8 +159,8 @@ spec:
- VerticalScaling
- VolumeExpansion
- Restart
- RotateCertificates
- Reconfigure
- ReconfigureTLS
type: string
upgrade:
properties:
Expand Down Expand Up @@ -247,6 +247,13 @@ spec:
format: int64
type: integer
phase:
enum:
- Progressing
- Successful
- WaitingForApproval
- Failed
- Approved
- Denied
type: string
type: object
type: object
Expand Down

0 comments on commit c31cd2f

Please sign in to comment.