Skip to content

Commit

Permalink
Merge pull request #155 from SovereignCloudStack/fix-status-reset
Browse files Browse the repository at this point in the history
🐛 Fix reset of HelmChartStatus of ClusterAddon
  • Loading branch information
janiskemper committed May 28, 2024
2 parents cef2e7b + 3605aa0 commit 1fa9e3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/controller/clusteraddon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
// if a hook is specified, we cannot be ready yet
// if a hook is set, it is expected that HelmChartAppliedCondition is removed
if clusterAddon.Spec.Hook != "" {
clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions)
// if the clusterAddon was ready before, it means this hook is fresh and we have to reset the status
if clusterAddon.Status.Ready {
clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions)
}
if clusterAddon.Status.HelmChartStatus == nil {
clusterAddon.Status.HelmChartStatus = make(map[string]csov1alpha1.HelmChartStatusConditions)
}
clusterAddon.Status.Ready = false
}

Expand Down

0 comments on commit 1fa9e3a

Please sign in to comment.