Skip to content
Closed
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
2 changes: 2 additions & 0 deletions api/v1/clusterobjectset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (

// Condition Reasons
ClusterObjectSetReasonArchived = "Archived"
ClusterObjectSetReasonArchiving = "Archiving"
ClusterObjectSetReasonObjectsNotReady = "ObjectsNotReady"
ClusterObjectSetReasonObjectCollision = "ObjectCollision"
ClusterObjectSetReasonRetryableError = "RetryableError"
Expand Down Expand Up @@ -504,6 +505,7 @@ type ClusterObjectSetStatus struct {
// - False with reason ValidationFailure: the revision failed a pre-apply check (an invalid revision/phase object or probe, preflight validation, a mutable referenced Secret, or changed referenced content) and requires manual intervention.
// - False with reason ProgressDeadlineExceeded: the revision did not roll out within spec.progressDeadlineMinutes.
// - False with reason RetryableError: the revision encountered a transient error that may resolve on a subsequent reconciliation.
// - False with reason Archiving: the revision is being archived and its owned objects are still being torn down.
// - False with reason Archived: the revision has been archived and its objects have been torn down.
//
// Rollout completion is recorded separately by status.completedAt.
Expand Down
1 change: 1 addition & 0 deletions applyconfigurations/api/v1/clusterobjectsetstatus.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/draft/concepts/clusterobjectsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ Indicates whether all objects in the revision have been successfully rolled out
| False | `ObjectCollision` | One or more objects are controlled by another owner, or are unowned and collision protection prevents adoption |
| False | `ValidationFailure` | A pre-apply check failed (an invalid revision/phase object or probe, preflight validation, a mutable referenced Secret, or changed referenced content); requires manual intervention |
| Unknown | `RetryableError` | Error prevented probe observation |
| Unknown | `Archived` | Objects torn down after archival |
| False | `Archiving` | The revision is being archived; owned objects are still being torn down |
| False | `Archived` | Objects torn down after archival |
| Unknown | `Migrated` | Migrated from existing release; probes not yet observed |

### Succeeded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ spec:
- False with reason ValidationFailure: the revision failed a pre-apply check (an invalid revision/phase object or probe, preflight validation, a mutable referenced Secret, or changed referenced content) and requires manual intervention.
- False with reason ProgressDeadlineExceeded: the revision did not roll out within spec.progressDeadlineMinutes.
- False with reason RetryableError: the revision encountered a transient error that may resolve on a subsequent reconciliation.
- False with reason Archiving: the revision is being archived and its owned objects are still being torn down.
- False with reason Archived: the revision has been archived and its objects have been torn down.

Rollout completion is recorded separately by status.completedAt.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func (c *ClusterObjectSetReconciler) archive(ctx context.Context, revisionEngine
return ctrl.Result{}, err
}
if tdres != nil && !tdres.IsComplete() {
setRetryableErrorConditions(cos, "removing revision resources that are not owned by another revision", false)
markAsArchiving(cos)
return ctrl.Result{RequeueAfter: 5 * time.Second}, nil
}
// Ensure conditions are set before removing the finalizer when archiving
Expand Down Expand Up @@ -780,6 +780,11 @@ func markAsNotReady(cos *ocv1.ClusterObjectSet, reason, message string) bool {
})
}

func markAsArchiving(cos *ocv1.ClusterObjectSet) {
const msg = "The object set is being archived; removing owned objects."
markAsNotReady(cos, ocv1.ClusterObjectSetReasonArchiving, msg)
}

func markAsArchived(cos *ocv1.ClusterObjectSet) bool {
const msg = "revision is archived"
return markAsNotReady(cos, ocv1.ClusterObjectSetReasonArchived, msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ func Test_ClusterObjectSetReconciler_Reconcile_ArchivalAndDeletion(t *testing.T)
},
},
{
name: "set Ready:False:RetryableError and requeue when archived revision archival is incomplete",
name: "set Ready:False:Archiving and requeue when archived revision archival is incomplete",
revisionResult: newMockRevisionResult(mockCtrl, revisionResultConfig{}),
existingObjs: func() []client.Object {
ext := newTestClusterExtension()
Expand Down Expand Up @@ -1185,8 +1185,8 @@ func Test_ClusterObjectSetReconciler_Reconcile_ArchivalAndDeletion(t *testing.T)
cond := meta.FindStatusCondition(rev.Status.Conditions, ocv1.ClusterObjectSetTypeReady)
require.NotNil(t, cond)
require.Equal(t, metav1.ConditionFalse, cond.Status)
require.Equal(t, ocv1.ClusterObjectSetReasonRetryableError, cond.Reason)
require.Equal(t, "removing revision resources that are not owned by another revision", cond.Message)
require.Equal(t, ocv1.ClusterObjectSetReasonArchiving, cond.Reason)
require.Equal(t, "The object set is being archived; removing owned objects.", cond.Message)

// Finalizer should still be present
require.Contains(t, rev.Finalizers, "olm.operatorframework.io/teardown")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,12 @@ func TestProgressingFromReady(t *testing.T) {
completed: false,
expected: metav1.Condition{Type: ocv1.TypeProgressing, Status: metav1.ConditionTrue, Reason: ocv1.ReasonRollingOut, Message: "Objects are not yet ready."},
},
{
name: "archiving maps to RollingOut",
ready: &metav1.Condition{Type: ocv1.ClusterObjectSetTypeReady, Status: metav1.ConditionFalse, Reason: ocv1.ClusterObjectSetReasonArchiving, Message: "The object set is being archived; removing owned objects."},
completed: false,
expected: metav1.Condition{Type: ocv1.TypeProgressing, Status: metav1.ConditionTrue, Reason: ocv1.ReasonRollingOut, Message: "The object set is being archived; removing owned objects."},
},
{
name: "retryable error maps to Retrying",
ready: &metav1.Condition{Type: ocv1.ClusterObjectSetTypeReady, Status: metav1.ConditionUnknown, Reason: ocv1.ClusterObjectSetReasonRetryableError, Message: "boom"},
Expand Down
1 change: 1 addition & 0 deletions manifests/experimental-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1975,6 +1975,7 @@ spec:
- False with reason ValidationFailure: the revision failed a pre-apply check (an invalid revision/phase object or probe, preflight validation, a mutable referenced Secret, or changed referenced content) and requires manual intervention.
- False with reason ProgressDeadlineExceeded: the revision did not roll out within spec.progressDeadlineMinutes.
- False with reason RetryableError: the revision encountered a transient error that may resolve on a subsequent reconciliation.
- False with reason Archiving: the revision is being archived and its owned objects are still being torn down.
- False with reason Archived: the revision has been archived and its objects have been torn down.

Rollout completion is recorded separately by status.completedAt.
Expand Down
1 change: 1 addition & 0 deletions manifests/experimental.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,7 @@ spec:
- False with reason ValidationFailure: the revision failed a pre-apply check (an invalid revision/phase object or probe, preflight validation, a mutable referenced Secret, or changed referenced content) and requires manual intervention.
- False with reason ProgressDeadlineExceeded: the revision did not roll out within spec.progressDeadlineMinutes.
- False with reason RetryableError: the revision encountered a transient error that may resolve on a subsequent reconciliation.
- False with reason Archiving: the revision is being archived and its owned objects are still being torn down.
- False with reason Archived: the revision has been archived and its objects have been torn down.

Rollout completion is recorded separately by status.completedAt.
Expand Down
Loading