Skip to content

Commit 0d09d95

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 f3569d5 commit 0d09d95

15 files changed

+578
-206
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 RolloutInProgress, 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: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,16 @@ const (
2525
ClusterExtensionRevisionKind = "ClusterExtensionRevision"
2626

2727
// Condition Types
28-
ClusterExtensionRevisionTypeAvailable = "Available"
29-
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
28+
ClusterExtensionRevisionTypeAvailable = "Available"
29+
ClusterExtensionRevisionTypeSucceeded = "Succeeded"
30+
ClusterExtensionRevisionTypeProgressing = "Progressing"
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+
ClusterExtensionRevisionReasonRetrying = "Retrying"
34+
ClusterExtensionRevisionReasonBlocked = "Blocked"
35+
ClusterExtensionRevisionReasonRollingOut = "RollingOut"
36+
37+
ClusterExtensionRevisionReasonArchived = "Archived"
4338
)
4439

4540
// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
@@ -140,6 +135,7 @@ type ClusterExtensionRevisionStatus struct {
140135

141136
// ClusterExtensionRevision is the Schema for the clusterextensionrevisions API
142137
// +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].status`
138+
// +kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
143139
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`
144140
type ClusterExtensionRevision struct {
145141
metav1.TypeMeta `json:",inline"`

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 RolloutInProgress, 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 RolloutInProgress, 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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ func (m *BoxcutterStorageMigrator) Migrate(ctx context.Context, ext *ocv1.Cluste
264264
meta.SetStatusCondition(&rev.Status.Conditions, metav1.Condition{
265265
Type: ocv1.ClusterExtensionRevisionTypeAvailable,
266266
Status: metav1.ConditionUnknown,
267-
Reason: ocv1.ClusterExtensionRevisionReasonMigrated,
268267
Message: "Migrated from Helm storage, awaiting cluster state verification",
269268
ObservedGeneration: rev.Generation,
270269
})
@@ -398,6 +397,12 @@ func (bc *Boxcutter) apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust
398397
if progressingCondition == nil && availableCondition == nil && succeededCondition == nil {
399398
return false, "New revision created", nil
400399
} else if progressingCondition != nil && progressingCondition.Status == metav1.ConditionTrue {
400+
switch progressingCondition.Reason {
401+
case ocv1.ReasonSucceeded:
402+
return true, "", nil
403+
case ocv1.ClusterExtensionRevisionReasonRetrying:
404+
return false, "", errors.New(progressingCondition.Message)
405+
}
401406
return false, progressingCondition.Message, nil
402407
} else if availableCondition != nil && availableCondition.Status != metav1.ConditionTrue {
403408
return false, "", errors.New(availableCondition.Message)

0 commit comments

Comments
 (0)