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

Use in-place upgrade release annotation if present #61

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

berkayoz
Copy link
Member

@berkayoz berkayoz commented Oct 1, 2024

This PR adjusts the ck8s config reconciler to use the snap install option from an in-place upgrade release annotation if it exists. This can be utilized by adding the release annotation under the CK8sControlPlane or MachineDeployment specs, which will be propagated down to the machine.

For control-plane (CK8sControlPlane)
.spec.machineTemplate.metadata.annotations => Machine.annotations

Adopted something similar to propagation logic from KCP

For workers (MachineDeployment)
.spec.template.metadata.annotations => MachineSet.spec.template.metadata.annotations => Machine.annotations

@berkayoz berkayoz marked this pull request as ready for review October 1, 2024 13:58
@berkayoz berkayoz requested a review from a team as a code owner October 1, 2024 13:58
Copy link
Contributor

@eaudetcobello eaudetcobello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work, left one comment. Thanks!

bootstrap/controllers/ck8sconfig_controller.go Outdated Show resolved Hide resolved
Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work @berkayoz! Left some minor comments.

controlplane/controllers/ck8scontrolplane_controller.go Outdated Show resolved Hide resolved
type InstallOption string

const (
InstallOptionChannel InstallOption = "track"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about this part. I can see channel instead of track and localPath instead of local-path.
https://github.com/canonical/cluster-api-k8s/blob/main/pkg/ck8s/workload_cluster.go#L279-L288

If these are the same, maybe we can centralize them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the track mentions to channel. For localPath vs local-path, I've kept local-path to fit the separate with - file naming convention we had. I'll adjust the k8s-snap-api to fit this form with another (cleanup) card I've this pulse.

pkg/cloudinit/scripts/install.sh Outdated Show resolved Hide resolved
pkg/cloudinit/scripts/install.sh Show resolved Hide resolved
Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work and thanks a lot @berkayoz! LGTM

@berkayoz berkayoz merged commit 098ea26 into main Oct 3, 2024
7 checks passed
@berkayoz berkayoz deleted the KU-1208/in-place-compatibility branch October 3, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants