Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Update spec.cluster stack only after after controlplane is initialized and after cluster upgrade #115

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion internal/controller/clusteraddon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
}
}

clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class
clusterAddon.Spec.Version = releaseAsset.Meta.Versions.Components.ClusterAddon

if clusterAddon.Status.Ready {
Expand Down Expand Up @@ -327,6 +326,8 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
// clusterAddon.Spec.Version = metadata.Versions.Components.ClusterAddon
conditions.MarkTrue(clusterAddon, csov1alpha1.HelmChartAppliedCondition)

clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class

// store the release kubernetes version and current hook
clusterAddon.Status.Ready = true

Expand All @@ -347,6 +348,11 @@ func (r *ClusterAddonReconciler) Reconcile(ctx context.Context, req reconcile.Re
if shouldRequeue {
return reconcile.Result{RequeueAfter: 20 * time.Second}, nil
}

}

if clusterAddon.Spec.Hook == "AfterControlPlaneInitialized" || clusterAddon.Spec.Hook == "BeforeClusterUpgrade" {
clusterAddon.Spec.ClusterStack = cluster.Spec.Topology.Class
}

// Helm chart has been applied successfully
Expand Down
Loading