From 5758f100aa6b75e68c2bf99f2b6b377f69919230 Mon Sep 17 00:00:00 2001 From: Brett Tofel Date: Wed, 3 Jul 2024 10:20:28 -0400 Subject: [PATCH] Rm InstalledStatus->nil on upack & add comment Signed-off-by: Brett Tofel --- api/v1alpha1/clusterextension_types.go | 2 ++ internal/controllers/common_controller.go | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index 7fc8bd9b0..afcd439f3 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -160,6 +160,8 @@ type BundleMetadata struct { } // ClusterExtensionStatus defines the observed state of ClusterExtension +// InstalledBundle should only be modified when a new bundle is successfully installed, that way if you've previously successfully installed a bundle before, +// if an upgrade fails it is still appropriately communicated to you that there is still a bundle that is currently installed and owned by the ClusterExtension type ClusterExtensionStatus struct { // +optional InstalledBundle *BundleMetadata `json:"installedBundle,omitempty"` diff --git a/internal/controllers/common_controller.go b/internal/controllers/common_controller.go index 640d557f3..dff4aceb1 100644 --- a/internal/controllers/common_controller.go +++ b/internal/controllers/common_controller.go @@ -119,7 +119,6 @@ func setStatusUnpackFailed(ext *ocv1alpha1.ClusterExtension, message string) { } func setStatusInstallFalseUnpackFailed(ext *ocv1alpha1.ClusterExtension, message string) { - ext.Status.InstalledBundle = nil apimeta.SetStatusCondition(&ext.Status.Conditions, metav1.Condition{ Type: ocv1alpha1.TypeUnpacked, Status: metav1.ConditionFalse,