Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ type ClusterExtensionStatus struct {
// When Progressing is True and the Reason is Succeeded, the ClusterExtension is making progress towards a new state.
// When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
// When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.
// <opcon:experimental:description>
// When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.
// </opcon:experimental:description>
//
// When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
// These are indications from a package owner to guide users away from a particular package, channel, or bundle.
Expand Down
55 changes: 24 additions & 31 deletions api/v1/clusterextensionrevision_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,19 @@ import (
const (
ClusterExtensionRevisionKind = "ClusterExtensionRevision"

// ClusterExtensionRevisionTypeAvailable is the condition type that represents whether the
// ClusterExtensionRevision is available and has been successfully rolled out.
ClusterExtensionRevisionTypeAvailable = "Available"

// ClusterExtensionRevisionTypeSucceeded is the condition type that represents whether the
// ClusterExtensionRevision rollout has succeeded.
ClusterExtensionRevisionTypeSucceeded = "Succeeded"

// Condition reasons
ClusterExtensionRevisionReasonAvailable = "Available"
ClusterExtensionRevisionReasonReconcileFailure = "ReconcileFailure"
ClusterExtensionRevisionReasonRevisionValidationFailure = "RevisionValidationFailure"
ClusterExtensionRevisionReasonPhaseValidationError = "PhaseValidationError"
ClusterExtensionRevisionReasonObjectCollisions = "ObjectCollisions"
ClusterExtensionRevisionReasonRolloutSuccess = "RolloutSuccess"
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
ClusterExtensionRevisionReasonIncomplete = "Incomplete"
ClusterExtensionRevisionReasonProgressing = "Progressing"
ClusterExtensionRevisionReasonArchived = "Archived"
ClusterExtensionRevisionReasonMigrated = "Migrated"
// Condition Types
ClusterExtensionRevisionTypeAvailable = "Available"
ClusterExtensionRevisionTypeProgressing = "Progressing"
ClusterExtensionRevisionTypeSucceeded = "Succeeded"

// Condition Reasons
ClusterExtensionRevisionReasonArchived = "Archived"
ClusterExtensionRevisionReasonBlocked = "Blocked"
ClusterExtensionRevisionReasonMigrated = "Migrated"
ClusterExtensionRevisionReasonProbeFailure = "ProbeFailure"
ClusterExtensionRevisionReasonProbesSucceeded = "ProbesSucceeded"
ClusterExtensionRevisionReasonReconciling = "Reconciling"
ClusterExtensionRevisionReasonRetrying = "Retrying"
)

// ClusterExtensionRevisionSpec defines the desired state of ClusterExtensionRevision.
Expand Down Expand Up @@ -190,22 +183,21 @@ type ClusterExtensionRevisionStatus struct {
// ClusterExtensionRevision.
//
// The Progressing condition represents whether the revision is actively rolling out:
// - When status is True and reason is Progressing, the revision rollout is actively making progress and is in transition.
// - When Progressing is not present, the revision is not currently in transition.
// - When status is True and reason is RollingOut, the ClusterExtensionRevision rollout is actively making progress and is in transition.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see RollingOut as a reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// - When status is True and reason is Retrying, the ClusterExtensionRevision has encountered an error that could be resolved on subsequent reconciliation attempts.
// - When status is True and reason is Succeeded, the ClusterExtensionRevision has reached the desired state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see Succeeded as a reason (There's ProbesSucceeded, but it's not the same)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// - When status is False and reason is Blocked, the ClusterExtensionRevision has encountered an error that requires manual intervention for recovery.
// - When status is False and reason is Archived, the ClusterExtensionRevision is archived and not being actively reconciled.
//
// The Available condition represents whether the revision has been successfully rolled out and is available:
// - When status is True and reason is Available, the revision has been successfully rolled out and all objects pass their readiness probes.
// - When status is False and reason is Incomplete, the revision rollout has not yet completed but no specific failures have been detected.
// - When status is True and reason is ProbesSucceeded, the ClusterExtensionRevision has been successfully rolled out and all objects pass their readiness probes.
// - When status is False and reason is ProbeFailure, one or more objects are failing their readiness probes during rollout.
// - When status is False and reason is ReconcileFailure, the revision has encountered a general reconciliation failure.
// - When status is False and reason is RevisionValidationFailure, the revision failed preflight validation checks.
// - When status is False and reason is PhaseValidationError, a phase within the revision failed preflight validation checks.
// - When status is False and reason is ObjectCollisions, objects in the revision collide with existing cluster objects that cannot be adopted.
// - When status is Unknown and reason is Archived, the revision has been archived and its objects have been torn down.
// - 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.
// - When status is Unknown and reason is Reconciling, the ClusterExtensionRevision has encountered an error that prevented it from observing the probes.
// - When status is Unknown and reason is Archived, the ClusterExtensionRevision has been archived and its objects have been torn down.
// - 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.
//
// The Succeeded condition represents whether the revision has successfully completed its rollout:
// - 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.
// - 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.
//
// +listType=map
// +listMapKey=type
Expand All @@ -217,6 +209,7 @@ type ClusterExtensionRevisionStatus struct {
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].status`
// +kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
// +kubebuilder:printcolumn:name=Age,type=date,JSONPath=`.metadata.creationTimestamp`

// ClusterExtensionRevision represents an immutable snapshot of Kubernetes objects
Expand Down
6 changes: 3 additions & 3 deletions api/v1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const (
ReasonAbsent = "Absent"

// Progressing reasons
ReasonRolloutInProgress = "RolloutInProgress"
ReasonRetrying = "Retrying"
ReasonBlocked = "Blocked"
ReasonRollingOut = "RollingOut"
ReasonRetrying = "Retrying"
ReasonBlocked = "Blocked"

// Deprecation reasons
ReasonDeprecated = "Deprecated"
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/olmv1-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `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. | | |
| `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. | | |
| `install` _[ClusterExtensionInstallStatus](#clusterextensioninstallstatus)_ | install is a representation of the current installation status for this ClusterExtension. | | |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
- jsonPath: .status.conditions[?(@.type=='Available')].status
name: Available
type: string
- jsonPath: .status.conditions[?(@.type=='Progressing')].status
name: Progressing
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -190,22 +193,21 @@ spec:
ClusterExtensionRevision.

The Progressing condition represents whether the revision is actively rolling out:
- When status is True and reason is Progressing, the revision rollout is actively making progress and is in transition.
- When Progressing is not present, the revision is not currently in transition.
- When status is True and reason is RollingOut, the ClusterExtensionRevision rollout is actively making progress and is in transition.
- When status is True and reason is Retrying, the ClusterExtensionRevision has encountered an error that could be resolved on subsequent reconciliation attempts.
- When status is True and reason is Succeeded, the ClusterExtensionRevision has reached the desired state.
- When status is False and reason is Blocked, the ClusterExtensionRevision has encountered an error that requires manual intervention for recovery.
- When status is False and reason is Archived, the ClusterExtensionRevision is archived and not being actively reconciled.

The Available condition represents whether the revision has been successfully rolled out and is available:
- When status is True and reason is Available, the revision has been successfully rolled out and all objects pass their readiness probes.
- When status is False and reason is Incomplete, the revision rollout has not yet completed but no specific failures have been detected.
- When status is True and reason is ProbesSucceeded, the ClusterExtensionRevision has been successfully rolled out and all objects pass their readiness probes.
- When status is False and reason is ProbeFailure, one or more objects are failing their readiness probes during rollout.
- When status is False and reason is ReconcileFailure, the revision has encountered a general reconciliation failure.
- When status is False and reason is RevisionValidationFailure, the revision failed preflight validation checks.
- When status is False and reason is PhaseValidationError, a phase within the revision failed preflight validation checks.
- When status is False and reason is ObjectCollisions, objects in the revision collide with existing cluster objects that cannot be adopted.
- When status is Unknown and reason is Archived, the revision has been archived and its objects have been torn down.
- 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.
- When status is Unknown and reason is Reconciling, the ClusterExtensionRevision has encountered an error that prevented it from observing the probes.
- When status is Unknown and reason is Archived, the ClusterExtensionRevision has been archived and its objects have been torn down.
- 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.

The Succeeded condition represents whether the revision has successfully completed its rollout:
- 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.
- 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.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ spec:
When Progressing is True and the Reason is Retrying, the ClusterExtension has encountered an error that could be resolved on subsequent reconciliation attempts.
When Progressing is False and the Reason is Blocked, the ClusterExtension has encountered an error that requires manual intervention for recovery.

When Progressing is True and Reason is RollingOut, the ClusterExtension has one or more ClusterExtensionRevisions in active roll out.

When the ClusterExtension is sourced from a catalog, if may also communicate a deprecation condition.
These are indications from a package owner to guide users away from a particular package, channel, or bundle.
BundleDeprecated is set if the requested bundle version is marked deprecated in the catalog.
Expand Down
9 changes: 8 additions & 1 deletion internal/operator-controller/applier/boxcutter.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,14 @@ func (bc *Boxcutter) apply(ctx context.Context, contentFS fs.FS, ext *ocv1.Clust
if progressingCondition == nil && availableCondition == nil && succeededCondition == nil {
return false, "New revision created", nil
} else if progressingCondition != nil && progressingCondition.Status == metav1.ConditionTrue {
return false, progressingCondition.Message, nil
switch progressingCondition.Reason {
case ocv1.ReasonSucceeded:
return true, "", nil
case ocv1.ClusterExtensionRevisionReasonRetrying:
return false, "", errors.New(progressingCondition.Message)
default:
return false, progressingCondition.Message, nil
}
} else if availableCondition != nil && availableCondition.Status != metav1.ConditionTrue {
return false, "", errors.New(availableCondition.Message)
} else if succeededCondition != nil && succeededCondition.Status != metav1.ConditionTrue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ var ConditionReasons = []string{
ocv1.ReasonBlocked,
ocv1.ReasonRetrying,
ocv1.ReasonAbsent,
ocv1.ReasonRolloutInProgress,
ocv1.ReasonRollingOut,
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func ApplyBundle(a Applier) ReconcileStepFunc {
apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{
Type: ocv1.TypeProgressing,
Status: metav1.ConditionTrue,
Reason: ocv1.ReasonRolloutInProgress,
Reason: ocv1.ReasonRollingOut,
Message: rolloutStatus,
ObservedGeneration: ext.GetGeneration(),
})
Expand Down
Loading
Loading