Skip to content

Commit

Permalink
Update DB condition types and phases (#598)
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 1, 2020
1 parent f27cb72 commit 5c12de3
Show file tree
Hide file tree
Showing 26 changed files with 134 additions and 138 deletions.
28 changes: 12 additions & 16 deletions apis/kubedb/v1alpha1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,20 @@ const (

// List of possible condition types for a KubeDB object
const (
// used for Databases that are currently running
DatabaseRunning = "Running"
// used for Databases that are currently running
DatabasePodRunning = "PodRunning"
// used for Databases that are currently creating
DatabaseCreating = "Creating"
// used for Databases that are currently initializing
DatabaseeInitializing = "Initializing"
// used for Databases that are already initialized
DatabaseInitialized = "Initialized"
// used for Databases that have started provisioning
DatabaseProvisioningStarted = "ProvisioningStarted"
// used for Databases whose pods are ready
DatabaseReplicaReady = "ReplicaReady"
// used for Databases that are currently accepting connection
DatabaseAcceptingConnection = "AcceptingConnection"
// used for Databases that report status OK (also implies that we can connect to it)
DatabaseReady = "Ready"
// used for Databases that are already initialized using stash
DatabaseDataRestored = "DataRestored"
// used for Databases that are paused
DatabasePaused = "Paused"
// used for Databases that are halted
DatabaseHalted = "Halted"
// used for Databases that are failed
DatabaseFailed = "Failed"

// Condition reasons
DatabaseSuccessfullyInitialized = "SuccessfullyInitialized"
FailedToInitializeDatabase = "FailedToInitialize"
DatabaseSuccessfullyRestored = "SuccessfullyDataRestored"
FailedToRestoreData = "FailedToRestoreData"
)
18 changes: 9 additions & 9 deletions apis/kubedb/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ type LeaderElectionConfig struct {
RetryPeriodSeconds int32 `json:"retryPeriodSeconds" protobuf:"varint,3,opt,name=retryPeriodSeconds"`
}

// +kubebuilder:validation:Enum=Running;Creating;Initializing;Paused;Halted;Failed
// +kubebuilder:validation:Enum=Provisioning;Ready;Critical;NotReady;Paused;Halted
type DatabasePhase string

const (
// used for Databases that are currently running
DatabasePhaseRunning DatabasePhase = "Running"
// used for Databases that are currently creating
DatabasePhaseCreating DatabasePhase = "Creating"
// used for Databases that are currently initializing
DatabasePhaseInitializing DatabasePhase = "Initializing"
// used for Databases that are currently provisioning
DatabasePhaseProvisioning DatabasePhase = "Provisioning"
// used for Databases that are currently ReplicaReady, AcceptingConnection and Ready
DatabasePhaseRunning DatabasePhase = "Ready"
// used for Databases that can connect, ReplicaReady == false || Ready == false (eg, ES yellow)
DatabasePhaseCritical DatabasePhase = "Critical"
// used for Databases that can't connect
DatabasePhaseNotReady DatabasePhase = "NotReady"
// used for Databases that are paused
DatabasePhasePaused DatabasePhase = "Paused"
// used for Databases that are halted
DatabasePhaseHalted DatabasePhase = "Halted"
// used for Databases that are failed
DatabasePhaseFailed DatabasePhase = "Failed"
)

// +kubebuilder:validation:Enum=Durable;Ephemeral
Expand Down
44 changes: 22 additions & 22 deletions crds/bindata.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions crds/kubedb.com_elasticsearches.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4072,12 +4072,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_elasticsearches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4077,12 +4077,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_etcds.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3045,12 +3045,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_etcds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3050,12 +3050,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mariadbs.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3707,12 +3707,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mariadbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3712,12 +3712,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_memcacheds.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2931,12 +2931,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_memcacheds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2936,12 +2936,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mongodbs.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9363,12 +9363,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mongodbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9365,12 +9365,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mysqls.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3729,12 +3729,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_mysqls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3734,12 +3734,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_perconaxtradbs.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3707,12 +3707,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_perconaxtradbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3712,12 +3712,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_pgbouncers.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1827,12 +1827,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_pgbouncers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1832,12 +1832,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_postgreses.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4441,12 +4441,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_postgreses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4446,12 +4446,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
8 changes: 4 additions & 4 deletions crds/kubedb.com_proxysqls.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2381,12 +2381,12 @@ spec:
type: integer
phase:
enum:
- Running
- Creating
- Initializing
- Provisioning
- Ready
- Critical
- NotReady
- Paused
- Halted
- Failed
type: string
type: object
type: object
Expand Down
Loading

0 comments on commit 5c12de3

Please sign in to comment.