Skip to content

Commit 40c55f8

Browse files
committed
config/v1/types_cluster_operator: ClusterOperatorStatus doc wordsmithing
Leaning heavily on [1]. Autogenerated bumps via: $ hack/update-swagger-docs.sh $ make update-codegen-crds [1]: https://github.com/openshift/cluster-version-operator/blob/cd332aa6ceb924fd49f7be7aeffce815dc81d663/docs/dev/clusteroperator.md#what-should-an-operator-report-with-clusteroperator-custom-resource
1 parent abf28f9 commit 40c55f8

File tree

4 files changed

+60
-41
lines changed

4 files changed

+60
-41
lines changed

config/v1/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ spec:
7171
type: object
7272
properties:
7373
conditions:
74-
description: conditions describes the state of the operator's reconciliation
75-
functionality.
74+
description: conditions describes the state of the operator's managed
75+
and monitored components.
7676
type: array
7777
items:
7878
description: ClusterOperatorStatusCondition represents the state of
79-
the operator's reconciliation functionality.
79+
the operator's managed and monitored components.
8080
type: object
8181
required:
8282
- lastTransitionTime
@@ -85,23 +85,22 @@ spec:
8585
properties:
8686
lastTransitionTime:
8787
description: lastTransitionTime is the time of the last update
88-
to the current status object.
88+
to the current status property.
8989
type: string
9090
format: date-time
9191
message:
9292
description: message provides additional information about the
9393
current condition. This is only to be consumed by humans.
9494
type: string
9595
reason:
96-
description: reason is the reason for the condition's last transition. Reasons
97-
are CamelCase
96+
description: reason is the CamelCase reason for the condition's
97+
current status.
9898
type: string
9999
status:
100100
description: status of the condition, one of True, False, Unknown.
101101
type: string
102102
type:
103-
description: type specifies the state of the operator's reconciliation
104-
functionality.
103+
description: type specifies the aspect reported by this condition.
105104
type: string
106105
extension:
107106
description: extension contains any additional status information specific
@@ -135,10 +134,12 @@ spec:
135134
description: resource of the referent.
136135
type: string
137136
versions:
138-
description: versions is a slice of operand version tuples. Operators
139-
which manage multiple operands will have multiple entries in the array. If
140-
an operator is Available, it must have at least one entry. You must
141-
report the version of the operator itself with the name "operator".
137+
description: versions is a slice of operator and operand version tuples. Operators
138+
which manage multiple operands will have multiple operand entries
139+
in the array. Available operators must report the version of the
140+
operator itself with the name "operator". An operator reports a new
141+
"operator" version when it has rolled out the new version to all of
142+
its operands.
142143
type: array
143144
items:
144145
type: object
@@ -152,8 +153,8 @@ spec:
152153
type: string
153154
version:
154155
description: version indicates which version of a particular operand
155-
is currently being manage. It must always match the Available
156-
condition. If 1.0.0 is Available, then this must indicate 1.0.0
156+
is currently being managed. It must always match the Available
157+
operand. If 1.0.0 is Available, then this must indicate 1.0.0
157158
even if the operator is trying to rollout 1.1.0
158159
type: string
159160
versions:

config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ spec:
201201
type: array
202202
items:
203203
description: ClusterOperatorStatusCondition represents the state of
204-
the operator's reconciliation functionality.
204+
the operator's managed and monitored components.
205205
type: object
206206
required:
207207
- lastTransitionTime
@@ -210,23 +210,22 @@ spec:
210210
properties:
211211
lastTransitionTime:
212212
description: lastTransitionTime is the time of the last update
213-
to the current status object.
213+
to the current status property.
214214
type: string
215215
format: date-time
216216
message:
217217
description: message provides additional information about the
218218
current condition. This is only to be consumed by humans.
219219
type: string
220220
reason:
221-
description: reason is the reason for the condition's last transition. Reasons
222-
are CamelCase
221+
description: reason is the CamelCase reason for the condition's
222+
current status.
223223
type: string
224224
status:
225225
description: status of the condition, one of True, False, Unknown.
226226
type: string
227227
type:
228-
description: type specifies the state of the operator's reconciliation
229-
functionality.
228+
description: type specifies the aspect reported by this condition.
230229
type: string
231230
desired:
232231
description: desired is the version that the cluster is reconciling

config/v1/types_cluster_operator.go

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ type ClusterOperatorSpec struct {
3434
// ClusterOperatorStatus provides information about the status of the operator.
3535
// +k8s:deepcopy-gen=true
3636
type ClusterOperatorStatus struct {
37-
// conditions describes the state of the operator's reconciliation functionality.
37+
// conditions describes the state of the operator's managed and monitored components.
3838
// +patchMergeKey=type
3939
// +patchStrategy=merge
4040
// +optional
4141
Conditions []ClusterOperatorStatusCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
4242

43-
// versions is a slice of operand version tuples. Operators which manage multiple operands will have multiple
44-
// entries in the array. If an operator is Available, it must have at least one entry. You must report the version of
45-
// the operator itself with the name "operator".
43+
// versions is a slice of operator and operand version tuples. Operators which manage multiple operands will have multiple
44+
// operand entries in the array. Available operators must report the version of the operator itself with the name "operator".
45+
// An operator reports a new "operator" version when it has rolled out the new version to all of its operands.
4646
// +optional
4747
Versions []OperandVersion `json:"versions,omitempty"`
4848

@@ -67,8 +67,8 @@ type OperandVersion struct {
6767
// +required
6868
Name string `json:"name"`
6969

70-
// version indicates which version of a particular operand is currently being manage. It must always match the Available
71-
// condition. If 1.0.0 is Available, then this must indicate 1.0.0 even if the operator is trying to rollout
70+
// version indicates which version of a particular operand is currently being managed. It must always match the Available
71+
// operand. If 1.0.0 is Available, then this must indicate 1.0.0 even if the operator is trying to rollout
7272
// 1.1.0
7373
// +kubebuilder:validation:Required
7474
// +required
@@ -107,10 +107,10 @@ const (
107107
)
108108

109109
// ClusterOperatorStatusCondition represents the state of the operator's
110-
// reconciliation functionality.
110+
// managed and monitored components.
111111
// +k8s:deepcopy-gen=true
112112
type ClusterOperatorStatusCondition struct {
113-
// type specifies the state of the operator's reconciliation functionality.
113+
// type specifies the aspect reported by this condition.
114114
// +kubebuilder:validation:Required
115115
// +required
116116
Type ClusterStatusConditionType `json:"type"`
@@ -120,12 +120,12 @@ type ClusterOperatorStatusCondition struct {
120120
// +required
121121
Status ConditionStatus `json:"status"`
122122

123-
// lastTransitionTime is the time of the last update to the current status object.
123+
// lastTransitionTime is the time of the last update to the current status property.
124124
// +kubebuilder:validation:Required
125125
// +required
126126
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
127127

128-
// reason is the reason for the condition's last transition. Reasons are CamelCase
128+
// reason is the CamelCase reason for the condition's current status.
129129
// +optional
130130
Reason string `json:"reason,omitempty"`
131131

@@ -135,21 +135,40 @@ type ClusterOperatorStatusCondition struct {
135135
Message string `json:"message,omitempty"`
136136
}
137137

138-
// ClusterStatusConditionType is the state of the operator's reconciliation functionality.
138+
// ClusterStatusConditionType is an aspect of operator state.
139139
type ClusterStatusConditionType string
140140

141141
const (
142-
// Available indicates that the binary maintained by the operator (eg: openshift-apiserver for the
142+
// Available indicates that the operand (eg: openshift-apiserver for the
143143
// openshift-apiserver-operator), is functional and available in the cluster.
144144
OperatorAvailable ClusterStatusConditionType = "Available"
145145

146-
// Progressing indicates that the operator is actively making changes to the binary maintained by the
147-
// operator (eg: openshift-apiserver for the openshift-apiserver-operator).
146+
// Progressing indicates that the operator is actively rolling out new code,
147+
// propagating config changes, or otherwise moving from one steady state to
148+
// another. Operators should not report progressing when they are reconciling
149+
// a previously known state.
148150
OperatorProgressing ClusterStatusConditionType = "Progressing"
149151

150152
// Degraded indicates that the operand is not functioning completely. An example of a degraded state
151153
// would be if there should be 5 copies of the operand running but only 4 are running. It may still be available,
152154
// but it is degraded
155+
156+
// Degraded indicated that the operator's current state does not match its
157+
// desired state over a period of time resulting in a lower quality of service.
158+
// The period of time may vary by component, but a Degraded state represents
159+
// persistent observation of a condition. As a result, a component should not
160+
// oscillate in and out of Degraded state. A service may be Available even
161+
// if its degraded. For example, your service may desire 3 running pods, but 1
162+
// pod is crash-looping. The service is Available but Degraded because it
163+
// may have a lower quality of service. A component may be Progressing but
164+
// not Degraded because the transition from one state to another does not
165+
// persist over a long enough period to report Degraded. A service should not
166+
// report Degraded during the course of a normal upgrade. A service may report
167+
// Degraded in response to a persistent infrastructure failure that requires
168+
// administrator intervention. For example, if a control plane host is unhealthy
169+
// and must be replaced. An operator should report Degraded if unexpected
170+
// errors occur over a period, but the expectation is that all unexpected errors
171+
// are handled as operators mature.
153172
OperatorDegraded ClusterStatusConditionType = "Degraded"
154173

155174
// Upgradeable indicates whether the operator is in a state that is safe to upgrade. When status is `False`

config/v1/zz_generated.swagger_doc_generated.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)