Skip to content

Commit

Permalink
snapinstalldata in initcontrolplane
Browse files Browse the repository at this point in the history
  • Loading branch information
eaudetcobello committed Oct 7, 2024
1 parent 957f259 commit e72410e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions bootstrap/controllers/ck8sconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,21 @@ func (r *CK8sConfigReconciler) handleClusterNotInitialized(ctx context.Context,
return ctrl.Result{}, fmt.Errorf("failed to render k8sd-proxy daemonset: %w", err)
}

snapInstallData := r.setSnapInstallDataFromSpec(scope.Config.Spec)

inPlaceInstallData := r.resolveInPlaceUpgradeRelease(machine)

if inPlaceInstallData != (cloudinit.SnapInstallData{}) {
snapInstallData = inPlaceInstallData
}

cpinput := cloudinit.InitControlPlaneInput{
BaseUserData: cloudinit.BaseUserData{
BootCommands: scope.Config.Spec.BootCommands,
PreRunCommands: scope.Config.Spec.PreRunCommands,
PostRunCommands: scope.Config.Spec.PostRunCommands,
KubernetesVersion: scope.Config.Spec.Version,
SnapInstallData: snapInstallData,
ExtraFiles: cloudinit.FilesFromAPI(files),
ConfigFileContents: string(initConfig),
MicroclusterAddress: scope.Config.Spec.ControlPlaneConfig.MicroclusterAddress,
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudinit/controlplane_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func TestNewInitControlPlaneSnapInstall(t *testing.T) {
name: "ChannelOverride",
snapInstall: cloudinit.SnapInstallData{
Option: cloudinit.InstallOptionChannel,
Value: "v1.30/stable",
Value: "v1.30/edge",
},
},
{
Expand Down

0 comments on commit e72410e

Please sign in to comment.