Skip to content

Commit

Permalink
add common condition types
Browse files Browse the repository at this point in the history
  • Loading branch information
floreks committed Dec 15, 2023
1 parent d8f3d60 commit 0f92e28
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions controller/apis/deployments/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,25 @@ func (t *Taint) Attributes() *console.TaintAttributes {

// TaintEffect is the effect for a Kubernetes taint.
type TaintEffect string

type ConditionType string

func (c ConditionType) String() string {
return string(c)
}

const (
ReadonlyConditionType ConditionType = "Readonly"
ReadyConditionType ConditionType = "Ready"
)

type ConditionReason string

func (c ConditionReason) String() string {
return string(c)
}

const (
ReadonlyConditionReason ConditionReason = "Readonly"
ReadyConditionReason ConditionReason = "Ready"
)
7 changes: 7 additions & 0 deletions controller/apis/deployments/v1alpha1/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ type ProviderStatus struct {
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Type:=boolean
Existing *bool `json:"existing,omitempty"`
// Represents the observations of a Provider's current state.
// Known .status.conditions.type are: "Available", "Progressing", and "Degraded"
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

func (p *ProviderStatus) GetID() string {
Expand Down

0 comments on commit 0f92e28

Please sign in to comment.