Skip to content

Commit 0e2de6b

Browse files
committed
Add conditions array to OperatorCondition's spec
The conditions array in the spec is now available for operator to create/update as the operator progresses through installation process. As the spec is updated, the object generation will be incremented and it can be used for tracking object changes. Signed-off-by: Vu Dinh <vudinh@outlook.com>
1 parent 1c3cb2e commit 0e2de6b

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

crds/operators.coreos.com_operatorconditions.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,48 @@ spec:
8484
type: string
8585
maxLength: 316
8686
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
87+
conditions:
88+
type: array
89+
items:
90+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo'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\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
91+
type: object
92+
required:
93+
- message
94+
- reason
95+
- status
96+
- type
97+
properties:
98+
lastTransitionTime:
99+
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
100+
type: string
101+
format: date-time
102+
message:
103+
description: message is a human readable message indicating details about the transition. This may be an empty string.
104+
type: string
105+
maxLength: 32768
106+
observedGeneration:
107+
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
108+
type: integer
109+
format: int64
110+
minimum: 0
111+
reason:
112+
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
113+
type: string
114+
maxLength: 1024
115+
minLength: 1
116+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
117+
status:
118+
description: status of the condition, one of True, False, Unknown.
119+
type: string
120+
enum:
121+
- "True"
122+
- "False"
123+
- Unknown
124+
type:
125+
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
126+
type: string
127+
maxLength: 316
128+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
87129
serviceAccounts:
88130
type: array
89131
items:

pkg/operators/v1/operatorcondition_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type OperatorConditionSpec struct {
1414
ServiceAccounts []string `json:"serviceAccounts,omitempty"`
1515
Deployments []string `json:"deployments,omitempty"`
1616
Overrides []metav1.Condition `json:"overrides,omitempty"`
17+
Conditions []metav1.Condition `json:"conditions,omitempty"`
1718
}
1819

1920
// OperatorConditionStatus allows an operator to convey information its state to OLM. The status may trail the actual

0 commit comments

Comments
 (0)