From 4073ab90d8faaa5faab9747fc6c29961944a5ead Mon Sep 17 00:00:00 2001 From: Aniruddha Basak Date: Wed, 24 Apr 2024 17:51:22 +0200 Subject: [PATCH] Remove helmchartstatus after hook is finished Signed-off-by: Aniruddha Basak --- .yamllint.yaml | 15 ++++++++++----- internal/controller/clusteraddon_controller.go | 8 +++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.yamllint.yaml b/.yamllint.yaml index 164f56052..310f7dfb4 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -17,13 +17,18 @@ rules: min-spaces-from-content: 1 yaml-files: - - '*.yaml' - - '*.yml' + - "*.yaml" + - "*.yml" ignore: - - '**/vendor/**' - - '.cache' + - "**/vendor/**" + - ".cache" - _artifacts - config/crd/**/*.yaml - config/rbac/**/*.yaml - - config/webhook/**/*.yaml \ No newline at end of file + - config/webhook/**/*.yaml + - test/infrastructure/**/config/webhook/**/*.yaml + - test/infrastructure/**/config/crd/**/*.yaml + - test/infrastructure/**/config/rbac/**/*.yaml + - test/releases/** + - test/cluster-stacks/** diff --git a/internal/controller/clusteraddon_controller.go b/internal/controller/clusteraddon_controller.go index ca8daf6fc..76e02dd98 100644 --- a/internal/controller/clusteraddon_controller.go +++ b/internal/controller/clusteraddon_controller.go @@ -356,7 +356,8 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class - // store the release kubernetes version and current hook + // remove the helm chart status from the status. + clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions) clusterAddon.Status.Ready = true return ctrl.Result{}, nil @@ -387,6 +388,11 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re // clusterAddon.Spec.Version = metadata.Versions.Components.ClusterAddon conditions.MarkTrue(clusterAddon, csov1alpha1.HelmChartAppliedCondition) + // remove the helm chart status from the status. + clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions) + + // store the release kubernetes version and current hook + clusterAddon.Status.KubernetesVersion = releaseAsset.Meta.Versions.Kubernetes clusterAddon.Status.CurrentHook = clusterAddon.Spec.Hook clusterAddon.Status.Ready = true }