Skip to content

Commit 2e4f6dd

Browse files
author
Per Goncalves da Silva
committed
Update ClusterExtensionRevision status conditions
Co-authored-by: Per Goncalves da Silva <[email protected]> Co-authored-by: Predrag Knezevic <[email protected] Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent 1355ff7 commit 2e4f6dd

18 files changed

+646
-228
lines changed

api/v1/clusterextension_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,11 @@ 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
//
486-
// When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
489+
// When the ClusterExtension is sourced from a catalog, it 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.
488491
// BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.
489492
// ChannelDeprecated is set if the requested channel is marked deprecated in the catalog.

api/v1/clusterextensionrevision_types.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,19 @@ const (
2525
ClusterExtensionRevisionKind = "ClusterExtensionRevision"
2626

2727
// Condition Types
28-
ClusterExtensionRevisionTypeAvailable = "Available"
29-
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
28+
ClusterExtensionRevisionTypeAvailable = "Available"
29+
ClusterExtensionRevisionTypeProgressing = "Progressing"
30+
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
3031

3132
// Condition Reasons
32-
ClusterExtensionRevisionReasonAvailable = "Available"
33-
ClusterExtensionRevisionReasonReconcileFailure = "ReconcileFailure"
34-
ClusterExtensionRevisionReasonRevisionValidationFailure = "RevisionValidationFailure"
35-
ClusterExtensionRevisionReasonPhaseValidationError = "PhaseValidationError"
36-
ClusterExtensionRevisionReasonObjectCollisions = "ObjectCollisions"
37-
ClusterExtensionRevisionReasonRolloutSuccess = "RolloutSuccess"
38-
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
39-
ClusterExtensionRevisionReasonIncomplete = "Incomplete"
40-
ClusterExtensionRevisionReasonProgressing = "Progressing"
41-
ClusterExtensionRevisionReasonArchived = "Archived"
42-
ClusterExtensionRevisionReasonMigrated = "Migrated"
33+
ClusterExtensionRevisionReasonArchived = "Archived"
34+
ClusterExtensionRevisionReasonBlocked = "Blocked"
35+
ClusterExtensionRevisionReasonMigrated = "Migrated"
36+
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
37+
ClusterExtensionRevisionReasonProbesSucceeded = "ProbesSucceeded"
38+
ClusterExtensionRevisionReasonReconciling = "Reconciling"
39+
ClusterExtensionRevisionReasonRetrying = "Retrying"
40+
ClusterExtensionRevisionReasonRollingOut = "RollingOut"
4341
)
4442

4543
// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
@@ -140,6 +138,7 @@ type ClusterExtensionRevisionStatus struct {
140138

141139
// ClusterExtensionRevision is the Schema for the clusterextensionrevisions API
142140
// +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].status`
141+
// +kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
143142
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`
144143
type ClusterExtensionRevision struct {
145144
metav1.TypeMeta `json:",inline"`

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, it 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: 3 additions & 0 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

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ 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 the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
521+
When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.
522+
523+
When the ClusterExtension is sourced from a catalog, it 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.
524526
ChannelDeprecated is set if the requested channel is marked deprecated in the catalog.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ spec:
479479
When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
480480
When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
481481
482-
When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
482+
When the ClusterExtension is sourced from a catalog, it may also communicate a deprecation condition.
483483
These are indications from a package owner to guide users away from a particular package, channel, or bundle.
484484
BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.
485485
ChannelDeprecated is set if the requested channel 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_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1.Cl
317317
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
318318
Type: ocv1.TypeProgressing,
319319
Status: metav1.ConditionTrue,
320-
Reason: ocv1.ReasonRolloutInProgress,
320+
Reason: ocv1.ReasonRollingOut,
321321
Message: rolloutStatus,
322322
ObservedGeneration: ext.GetGeneration(),
323323
})

0 commit comments

Comments
 (0)