Skip to content

Commit

Permalink
Merge pull request #204 from vshn/ExtendStatusWithConditions
Browse files Browse the repository at this point in the history
Add Conditions to the Status information
  • Loading branch information
cimnine authored Dec 22, 2020
2 parents 31d7a45 + ca68b32 commit 92ceeb5
Show file tree
Hide file tree
Showing 25 changed files with 687 additions and 180 deletions.
8 changes: 8 additions & 0 deletions api/v1alpha1/status.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package v1alpha1

import (
// requires k8s 1.19+: metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/operator-framework/operator-lib/status" // to be replaces with `metav1` from above
)

// Status defines the observed state of a generic K8up job. It is used for the
// operator to determine what to do.
type Status struct {
Started bool `json:"started,omitempty"`
Finished bool `json:"finished,omitempty"`
Exclusive bool `json:"exclusive,omitempty"`

Conditions status.Conditions `json:"conditions,omitempty"`
// requires K8s 1.19+: Conditions metav1.Conditions `json:"conditions,omitempty"`
}
18 changes: 13 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

23 changes: 23 additions & 0 deletions config/crd/apiextensions.k8s.io/v1/backup.appuio.ch_archives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/apiextensions.k8s.io/v1/backup.appuio.ch_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/apiextensions.k8s.io/v1/backup.appuio.ch_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/apiextensions.k8s.io/v1/backup.appuio.ch_prunes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
23 changes: 23 additions & 0 deletions config/crd/apiextensions.k8s.io/v1/backup.appuio.ch_restores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,29 @@ spec:
status:
description: Status defines the observed state of a generic K8up job. It is used for the operator to determine what to do.
properties:
conditions:
description: Conditions is a set of Condition instances.
items:
description: "Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind. \n Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API."
properties:
lastTransitionTime:
format: date-time
type: string
message:
type: string
reason:
description: ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.
type: string
status:
type: string
type:
description: "ConditionType is the type of the condition and is typically a CamelCased word or short phrase. \n Condition types should indicate state in the \"abnormal-true\" polarity. For example, if the condition indicates when a policy is invalid, the \"is valid\" case is probably the norm, so the condition should be called \"Invalid\"."
type: string
required:
- status
- type
type: object
type: array
exclusive:
type: boolean
finished:
Expand Down
Loading

0 comments on commit 92ceeb5

Please sign in to comment.