Skip to content

Commit c96d079

Browse files
aniruddha2000janiskemper
authored andcommitted
Update spec.cluster stack only after after controlplane is initialized and after cluster upgrade
Signed-off-by: Aniruddha Basak <[email protected]>
1 parent c038dec commit c96d079

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/controller/clusteraddon_controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
293293
}
294294
}
295295

296-
clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class
297296
clusterAddon.Spec.Version = releaseAsset.Meta.Versions.Components.ClusterAddon
298297

299298
if clusterAddon.Status.Ready {
@@ -329,6 +328,8 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
329328
// clusterAddon.Spec.Version = metadata.Versions.Components.ClusterAddon
330329
conditions.MarkTrue(clusterAddon, csov1alpha1.HelmChartAppliedCondition)
331330

331+
clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class
332+
332333
// store the release kubernetes version and current hook
333334
clusterAddon.Status.Ready = true
334335

@@ -349,6 +350,11 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
349350
if shouldRequeue {
350351
return reconcile.Result{RequeueAfter: 20 * time.Second}, nil
351352
}
353+
354+
}
355+
356+
if clusterAddon.Spec.Hook == "AfterControlPlaneInitialized" || clusterAddon.Spec.Hook == "BeforeClusterUpgrade" {
357+
clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class
352358
}
353359

354360
// Helm chart has been applied successfully

0 commit comments

Comments
 (0)