From d19ae564f89d43c0a3ed2bd1ff0f7fb203263752 Mon Sep 17 00:00:00 2001 From: Anik Bhattacharjee Date: Tue, 24 Sep 2024 21:01:45 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A0=20Update=20the=20Progressing=20Status?= =?UTF-8?q?=20condition=20`Terminal`=20reason=20to=20`Blocked`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes [412](https://github.com/operator-framework/catalogd/issues/412) --- api/core/v1alpha1/clustercatalog_types.go | 2 +- internal/controllers/core/clustercatalog_controller.go | 2 +- .../controllers/core/clustercatalog_controller_test.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/core/v1alpha1/clustercatalog_types.go b/api/core/v1alpha1/clustercatalog_types.go index 45b87319..e45b23da 100644 --- a/api/core/v1alpha1/clustercatalog_types.go +++ b/api/core/v1alpha1/clustercatalog_types.go @@ -37,7 +37,7 @@ const ( // Progressing reasons ReasonSucceeded = "Succeeded" ReasonRetrying = "Retrying" - ReasonTerminal = "Terminal" + ReasonBlocked = "Blocked" MetadataNameLabel = "olm.operatorframework.io/metadata.name" ) diff --git a/internal/controllers/core/clustercatalog_controller.go b/internal/controllers/core/clustercatalog_controller.go index 9f6c5660..2a903a9b 100644 --- a/internal/controllers/core/clustercatalog_controller.go +++ b/internal/controllers/core/clustercatalog_controller.go @@ -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) diff --git a/internal/controllers/core/clustercatalog_controller_test.go b/internal/controllers/core/clustercatalog_controller_test.go index 5ba30ba9..1e67becd 100644 --- a/internal/controllers/core/clustercatalog_controller_test.go +++ b/internal/controllers/core/clustercatalog_controller_test.go @@ -121,7 +121,7 @@ func TestCatalogdControllerReconcile(t *testing.T) { { Type: catalogdv1alpha1.TypeProgressing, Status: metav1.ConditionFalse, - Reason: catalogdv1alpha1.ReasonTerminal, + Reason: catalogdv1alpha1.ReasonBlocked, }, }, }, @@ -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{ @@ -211,7 +211,7 @@ func TestCatalogdControllerReconcile(t *testing.T) { { Type: catalogdv1alpha1.TypeProgressing, Status: metav1.ConditionFalse, - Reason: catalogdv1alpha1.ReasonTerminal, + Reason: catalogdv1alpha1.ReasonBlocked, }, }, },