Skip to content

Commit 04de603

Browse files
author
Per Goncalves da Silva
committed
Update ClusterExtensionRevision status conditions
Co-authored-by: Per Goncalves da Silva <pegoncal@redhat.com> Co-authored-by: Predrag Knezevic <pknezevi@redhat.com Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent b23e124 commit 04de603

15 files changed

+733
-272
lines changed

api/v1/clusterextension_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ type ClusterExtensionStatus struct {
482482
// When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.
483483
// When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
484484
// When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
485+
// <opcon:experimental:description>
486+
// When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.
487+
// </opcon:experimental:description>
485488
//
486489
// When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
487490
// These are indications from a package owner to guide users away from a particular package, channel, or bundle.

api/v1/clusterextensionrevision_types.go

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,19 @@ import (
2424
const (
2525
ClusterExtensionRevisionKind = "ClusterExtensionRevision"
2626

27-
// ClusterExtensionRevisionTypeAvailable is the condition type that represents whether the
28-
// ClusterExtensionRevision is available and has been successfully rolled out.
29-
ClusterExtensionRevisionTypeAvailable = "Available"
30-
31-
// ClusterExtensionRevisionTypeSucceeded is the condition type that represents whether the
32-
// ClusterExtensionRevision rollout has succeeded.
33-
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
34-
35-
// Condition reasons
36-
ClusterExtensionRevisionReasonAvailable = "Available"
37-
ClusterExtensionRevisionReasonReconcileFailure = "ReconcileFailure"
38-
ClusterExtensionRevisionReasonRevisionValidationFailure = "RevisionValidationFailure"
39-
ClusterExtensionRevisionReasonPhaseValidationError = "PhaseValidationError"
40-
ClusterExtensionRevisionReasonObjectCollisions = "ObjectCollisions"
41-
ClusterExtensionRevisionReasonRolloutSuccess = "RolloutSuccess"
42-
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
43-
ClusterExtensionRevisionReasonIncomplete = "Incomplete"
44-
ClusterExtensionRevisionReasonProgressing = "Progressing"
45-
ClusterExtensionRevisionReasonArchived = "Archived"
46-
ClusterExtensionRevisionReasonMigrated = "Migrated"
27+
// Condition Types
28+
ClusterExtensionRevisionTypeAvailable = "Available"
29+
ClusterExtensionRevisionTypeProgressing = "Progressing"
30+
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
31+
32+
// Condition Reasons
33+
ClusterExtensionRevisionReasonArchived = "Archived"
34+
ClusterExtensionRevisionReasonBlocked = "Blocked"
35+
ClusterExtensionRevisionReasonMigrated = "Migrated"
36+
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
37+
ClusterExtensionRevisionReasonProbesSucceeded = "ProbesSucceeded"
38+
ClusterExtensionRevisionReasonReconciling = "Reconciling"
39+
ClusterExtensionRevisionReasonRetrying = "Retrying"
4740
)
4841

4942
// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
@@ -190,22 +183,21 @@ type ClusterExtensionRevisionStatus struct {
190183
// ClusterExtensionRevision.
191184
//
192185
// The Progressing condition represents whether the revision is actively rolling out:
193-
// - When status is True and reason is Progressing, the revision rollout is actively making progress and is in transition.
194-
// - When Progressing is not present, the revision is not currently in transition.
186+
// - When status is True and reason is RollingOut, the ClusterExtensionRevision rollout is actively making progress and is in transition.
187+
// - When status is True and reason is Retrying, the ClusterExtensionRevision has encountered an error that could be resolved on subsequent reconciliation attempts.
188+
// - When status is True and reason is Succeeded, the ClusterExtensionRevision has reached the desired state.
189+
// - When status is False and reason is Blocked, the ClusterExtensionRevision has encountered an error that requires manual intervention for recovery.
190+
// - When status is False and reason is Archived, the ClusterExtensionRevision is archived and not being actively reconciled.
195191
//
196192
// The Available condition represents whether the revision has been successfully rolled out and is available:
197-
// - When status is True and reason is Available, the revision has been successfully rolled out and all objects pass their readiness probes.
198-
// - When status is False and reason is Incomplete, the revision rollout has not yet completed but no specific failures have been detected.
193+
// - When status is True and reason is ProbesSucceeded, the ClusterExtensionRevision has been successfully rolled out and all objects pass their readiness probes.
199194
// - When status is False and reason is ProbeFailure, one or more objects are failing their readiness probes during rollout.
200-
// - When status is False and reason is ReconcileFailure, the revision has encountered a general reconciliation failure.
201-
// - When status is False and reason is RevisionValidationFailure, the revision failed preflight validation checks.
202-
// - When status is False and reason is PhaseValidationError, a phase within the revision failed preflight validation checks.
203-
// - When status is False and reason is ObjectCollisions, objects in the revision collide with existing cluster objects that cannot be adopted.
204-
// - When status is Unknown and reason is Archived, the revision has been archived and its objects have been torn down.
205-
// - When status is Unknown and reason is Migrated, the revision was migrated from an existing release and object status probe results have not yet been observed.
195+
// - When status is Unknown and reason is Reconciling, the ClusterExtensionRevision has encountered an error that prevented it from observing the probes.
196+
// - When status is Unknown and reason is Archived, the ClusterExtensionRevision has been archived and its objects have been torn down.
197+
// - When status is Unknown and reason is Migrated, the ClusterExtensionRevision was migrated from an existing release and object status probe results have not yet been observed.
206198
//
207199
// The Succeeded condition represents whether the revision has successfully completed its rollout:
208-
// - When status is True and reason is RolloutSuccess, the revision has successfully completed its rollout. This condition is set once and persists even if the revision later becomes unavailable.
200+
// - When status is True and reason is Succeeded, the ClusterExtensionRevision has successfully completed its rollout. This condition is set once and persists even if the revision later becomes unavailable.
209201
//
210202
// +listType=map
211203
// +listMapKey=type
@@ -217,6 +209,7 @@ type ClusterExtensionRevisionStatus struct {
217209
// +kubebuilder:resource:scope=Cluster
218210
// +kubebuilder:subresource:status
219211
// +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].status`
212+
// +kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
220213
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`
221214

222215
// ClusterExtensionRevision represents an immutable snapshot of Kubernetes objects

api/v1/common_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const (
2424
ReasonAbsent = "Absent"
2525

2626
// Progressing reasons
27-
ReasonRolloutInProgress = "RolloutInProgress"
28-
ReasonRetrying = "Retrying"
29-
ReasonBlocked = "Blocked"
27+
ReasonRollingOut = "RollingOut"
28+
ReasonRetrying = "Retrying"
29+
ReasonBlocked = "Blocked"
3030

3131
// Deprecation reasons
3232
ReasonDeprecated = "Deprecated"

docs/api-reference/olmv1-api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ _Appears in:_
359359

360360
| Field | Description | Default | Validation |
361361
| --- | --- | --- | --- |
362-
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | The set of condition types which apply to all spec.source variations are Installed and Progressing.<br />The Installed condition represents whether or not the bundle has been installed for this ClusterExtension.<br />When Installed is True and the Reason is Succeeded, the bundle has been successfully installed.<br />When Installed is False and the Reason is Failed, the bundle has failed to install.<br />The Progressing condition represents whether or not the ClusterExtension is advancing towards a new state.<br />When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.<br />When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.<br />When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.<br />When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.<br />These are indications from a package owner to guide users away from a particular package, channel, or bundle.<br />BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.<br />ChannelDeprecated is set if the requested channel is marked deprecated in the catalog.<br />PackageDeprecated is set if the requested package is marked deprecated in the catalog.<br />Deprecated is a rollup condition that is present when any of the deprecated conditions are present. | | |
362+
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | The set of condition types which apply to all spec.source variations are Installed and Progressing.<br />The Installed condition represents whether or not the bundle has been installed for this ClusterExtension.<br />When Installed is True and the Reason is Succeeded, the bundle has been successfully installed.<br />When Installed is False and the Reason is Failed, the bundle has failed to install.<br />The Progressing condition represents whether or not the ClusterExtension is advancing towards a new state.<br />When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.<br />When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.<br />When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.<br /><opcon:experimental:description><br />When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.<br /></opcon:experimental:description><br />When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.<br />These are indications from a package owner to guide users away from a particular package, channel, or bundle.<br />BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.<br />ChannelDeprecated is set if the requested channel is marked deprecated in the catalog.<br />PackageDeprecated is set if the requested package is marked deprecated in the catalog.<br />Deprecated is a rollup condition that is present when any of the deprecated conditions are present. | | |
363363
| `install` _[ClusterExtensionInstallStatus](#clusterextensioninstallstatus)_ | install is a representation of the current installation status for this ClusterExtension. | | |
364364

365365

helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ spec:
1919
- jsonPath: .status.conditions[?(@.type=='Available')].status
2020
name: Available
2121
type: string
22+
- jsonPath: .status.conditions[?(@.type=='Progressing')].status
23+
name: Progressing
24+
type: string
2225
- jsonPath: .metadata.creationTimestamp
2326
name: Age
2427
type: date
@@ -190,22 +193,21 @@ spec:
190193
ClusterExtensionRevision.
191194
192195
The Progressing condition represents whether the revision is actively rolling out:
193-
- When status is True and reason is Progressing, the revision rollout is actively making progress and is in transition.
194-
- When Progressing is not present, the revision is not currently in transition.
196+
- When status is True and reason is RollingOut, the ClusterExtensionRevision rollout is actively making progress and is in transition.
197+
- When status is True and reason is Retrying, the ClusterExtensionRevision has encountered an error that could be resolved on subsequent reconciliation attempts.
198+
- When status is True and reason is Succeeded, the ClusterExtensionRevision has reached the desired state.
199+
- When status is False and reason is Blocked, the ClusterExtensionRevision has encountered an error that requires manual intervention for recovery.
200+
- When status is False and reason is Archived, the ClusterExtensionRevision is archived and not being actively reconciled.
195201
196202
The Available condition represents whether the revision has been successfully rolled out and is available:
197-
- When status is True and reason is Available, the revision has been successfully rolled out and all objects pass their readiness probes.
198-
- When status is False and reason is Incomplete, the revision rollout has not yet completed but no specific failures have been detected.
203+
- When status is True and reason is ProbesSucceeded, the ClusterExtensionRevision has been successfully rolled out and all objects pass their readiness probes.
199204
- When status is False and reason is ProbeFailure, one or more objects are failing their readiness probes during rollout.
200-
- When status is False and reason is ReconcileFailure, the revision has encountered a general reconciliation failure.
201-
- When status is False and reason is RevisionValidationFailure, the revision failed preflight validation checks.
202-
- When status is False and reason is PhaseValidationError, a phase within the revision failed preflight validation checks.
203-
- When status is False and reason is ObjectCollisions, objects in the revision collide with existing cluster objects that cannot be adopted.
204-
- When status is Unknown and reason is Archived, the revision has been archived and its objects have been torn down.
205-
- When status is Unknown and reason is Migrated, the revision was migrated from an existing release and object status probe results have not yet been observed.
205+
- When status is Unknown and reason is Reconciling, the ClusterExtensionRevision has encountered an error that prevented it from observing the probes.
206+
- When status is Unknown and reason is Archived, the ClusterExtensionRevision has been archived and its objects have been torn down.
207+
- When status is Unknown and reason is Migrated, the ClusterExtensionRevision was migrated from an existing release and object status probe results have not yet been observed.
206208
207209
The Succeeded condition represents whether the revision has successfully completed its rollout:
208-
- When status is True and reason is RolloutSuccess, the revision has successfully completed its rollout. This condition is set once and persists even if the revision later becomes unavailable.
210+
- When status is True and reason is Succeeded, the ClusterExtensionRevision has successfully completed its rollout. This condition is set once and persists even if the revision later becomes unavailable.
209211
items:
210212
description: Condition contains details for one aspect of the current
211213
state of this API Resource.

helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ spec:
518518
When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
519519
When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
520520
521+
When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.
522+
521523
When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
522524
These are indications from a package owner to guide users away from a particular package, channel, or bundle.
523525
BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.

internal/operator-controller/applier/boxcutter.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,14 @@ func (bc *Boxcutter) apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust
397397
if progressingCondition == nil && availableCondition == nil && succeededCondition == nil {
398398
return false, "New revision created", nil
399399
} else if progressingCondition != nil && progressingCondition.Status == metav1.ConditionTrue {
400-
return false, progressingCondition.Message, nil
400+
switch progressingCondition.Reason {
401+
case ocv1.ReasonSucceeded:
402+
return true, "", nil
403+
case ocv1.ClusterExtensionRevisionReasonRetrying:
404+
return false, "", errors.New(progressingCondition.Message)
405+
default:
406+
return false, progressingCondition.Message, nil
407+
}
401408
} else if availableCondition != nil && availableCondition.Status != metav1.ConditionTrue {
402409
return false, "", errors.New(availableCondition.Message)
403410
} else if succeededCondition != nil && succeededCondition.Status != metav1.ConditionTrue {

internal/operator-controller/conditionsets/conditionsets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ var ConditionReasons = []string{
4040
ocv1.ReasonBlocked,
4141
ocv1.ReasonRetrying,
4242
ocv1.ReasonAbsent,
43-
ocv1.ReasonRolloutInProgress,
43+
ocv1.ReasonRollingOut,
4444
}

internal/operator-controller/controllers/clusterextension_reconcile_steps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func ApplyBundle(a Applier) ReconcileStepFunc {
191191
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
192192
Type: ocv1.TypeProgressing,
193193
Status: metav1.ConditionTrue,
194-
Reason: ocv1.ReasonRolloutInProgress,
194+
Reason: ocv1.ReasonRollingOut,
195195
Message: rolloutStatus,
196196
ObservedGeneration: ext.GetGeneration(),
197197
})

0 commit comments

Comments
 (0)