Skip to content

Commit

Permalink
⚠ Update the Progressing Status condition Terminal reason to Blocked
Browse files Browse the repository at this point in the history
Closes [412](#412)
  • Loading branch information
anik120 committed Sep 24, 2024
1 parent 2dc04d9 commit d19ae56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/core/v1alpha1/clustercatalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
// Progressing reasons
ReasonSucceeded = "Succeeded"
ReasonRetrying = "Retrying"
ReasonTerminal = "Terminal"
ReasonBlocked = "Blocked"

MetadataNameLabel = "olm.operatorframework.io/metadata.name"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/controllers/core/clustercatalog_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func updateStatusProgressing(catalog *v1alpha1.ClusterCatalog, err error) {

if errors.Is(err, reconcile.TerminalError(nil)) {
progressingCond.Status = metav1.ConditionFalse
progressingCond.Reason = v1alpha1.ReasonTerminal
progressingCond.Reason = v1alpha1.ReasonBlocked
}

meta.SetStatusCondition(&catalog.Status.Conditions, progressingCond)
Expand Down
10 changes: 5 additions & 5 deletions internal/controllers/core/clustercatalog_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestCatalogdControllerReconcile(t *testing.T) {
{
Type: catalogdv1alpha1.TypeProgressing,
Status: metav1.ConditionFalse,
Reason: catalogdv1alpha1.ReasonTerminal,
Reason: catalogdv1alpha1.ReasonBlocked,
},
},
},
Expand Down Expand Up @@ -173,10 +173,10 @@ func TestCatalogdControllerReconcile(t *testing.T) {
},
},
{
name: "valid source type, unpack returns unrecoverable error, status updated to reflect unrecoverable error state and error is returned",
expectedError: fmt.Errorf("source bundle content: %w", reconcile.TerminalError(fmt.Errorf("mocksource Unrecoverable error"))),
name: "valid source type, unpack returns terminal error, status updated to reflect terminal error state(Blocked) and error is returned",
expectedError: fmt.Errorf("source bundle content: %w", reconcile.TerminalError(fmt.Errorf("mocksource terminal error"))),
source: &MockSource{
unpackError: reconcile.TerminalError(errors.New("mocksource Unrecoverable error")),
unpackError: reconcile.TerminalError(errors.New("mocksource terminal error")),
},
store: &MockStore{},
catalog: &catalogdv1alpha1.ClusterCatalog{
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestCatalogdControllerReconcile(t *testing.T) {
{
Type: catalogdv1alpha1.TypeProgressing,
Status: metav1.ConditionFalse,
Reason: catalogdv1alpha1.ReasonTerminal,
Reason: catalogdv1alpha1.ReasonBlocked,
},
},
},
Expand Down

0 comments on commit d19ae56

Please sign in to comment.