Skip to content

Commit bfb8716

Browse files
jmprusitmshort
authored andcommitted
Extends status conditions and fields
This commits adds a new status conditions: "Resolved" that represent if the Operator-Controller was able to resolv the desired operator image or not. Also, extends the status with a new field: "resolvedBundleResource" that contains the resolved operator image. Signed-off-by: Joaquim Moreno Prusi <[email protected]>
1 parent 8661cc6 commit bfb8716

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

api/v1alpha1/operator_types.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,43 @@ type OperatorSpec struct {
4646

4747
const (
4848
// TODO(user): add more Types, here and into init()
49-
TypeReady = "Ready"
49+
TypeReady = "Ready"
50+
TypeResolved = "Resolved"
5051

51-
ReasonInstallationSucceeded = "InstallationSucceeded"
52-
ReasonResolutionFailed = "ResolutionFailed"
5352
ReasonBundleLookupFailed = "BundleLookupFailed"
5453
ReasonInstallationFailed = "InstallationFailed"
5554
ReasonInstallationStatusUnknown = "InstallationStatusUnknown"
55+
ReasonInstallationSucceeded = "InstallationSucceeded"
5656
ReasonInvalidSpec = "InvalidSpec"
57+
ReasonResolutionFailed = "ResolutionFailed"
58+
ReasonResolutionUnknown = "ResolutionUnknown"
59+
ReasonSuccess = "Success"
5760
)
5861

5962
func init() {
6063
// TODO(user): add Types from above
6164
operatorutil.ConditionTypes = append(operatorutil.ConditionTypes,
6265
TypeReady,
66+
TypeResolved,
6367
)
6468
// TODO(user): add Reasons from above
6569
operatorutil.ConditionReasons = append(operatorutil.ConditionReasons,
6670
ReasonInstallationSucceeded,
6771
ReasonResolutionFailed,
72+
ReasonResolutionUnknown,
6873
ReasonBundleLookupFailed,
6974
ReasonInstallationFailed,
7075
ReasonInstallationStatusUnknown,
7176
ReasonInvalidSpec,
77+
ReasonSuccess,
7278
)
7379
}
7480

7581
// OperatorStatus defines the observed state of Operator
7682
type OperatorStatus struct {
83+
// +optional
84+
ResolvedBundleResource string `json:"resolvedBundleResource,omitempty"`
85+
7786
// +patchMergeKey=type
7887
// +patchStrategy=merge
7988
// +listType=map

config/crd/bases/operators.operatorframework.io_operators.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ spec:
131131
x-kubernetes-list-map-keys:
132132
- type
133133
x-kubernetes-list-type: map
134+
resolvedBundleResource:
135+
type: string
134136
type: object
135137
type: object
136138
served: true

0 commit comments

Comments
 (0)