Skip to content

capi: fix swap removal in qemu Ubuntu autoinstall templates - #2119

Open
hajowieland wants to merge 1 commit into
kubernetes-sigs:mainfrom
hajowieland:fix-ubuntu-raw-late
Open

capi: fix swap removal in qemu Ubuntu autoinstall templates#2119
hajowieland wants to merge 1 commit into
kubernetes-sigs:mainfrom
hajowieland:fix-ubuntu-raw-late

Conversation

@hajowieland

Copy link
Copy Markdown
Contributor

Change description

qemu autoinstall user-data tries to disable and remove the swap file via late-commands, but they seem to not work correctly.

  • no curtin in-target wrapper (like for raw)
  • remove /swapfile but the file to be removed is at /swap.img

This change mirrors the config already in place for the raw Ubuntu templates.

  • Is this change including a new Provider or a new OS? (y/n) n
  • If yes, has the Provider/OS matrix been updated in the readme? (y/n) n
  • If adding a new provider, are you a representative of that provider? (y/n) n

Related issues

--

Additional context

Was currently masked by Ansible node role which also disables swap and sysprep role deleting /swap.img and /swapfile.

Signed-off-by: hajowieland <mail@wieland.tech>
@kubernetes-prow
kubernetes-prow Bot requested review from mdbooth and vishesh92 July 12, 2026 09:17
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chrischdi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 12, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @hajowieland. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 12, 2026
@mboersma

Copy link
Copy Markdown
Contributor

Nice catch, thanks for cleaning this up. Two small things:

  1. The raw templates keep a trailing curtin in-target --target=/target -- rm -rf /var/lib/apt/lists/* in addition to apt-get clean. This PR drops that line, so it's not quite a full mirror, and the numbered comment still says "5. Removes the cached list of packages." Could you either keep that line or update the comment?

  2. Since this was already masked by the node and sysprep roles, the shipped images weren't affected, so this is really a correctness and consistency fix. Have you been able to run a qemu Ubuntu build to confirm it still passes?

Otherwise this looks good to me.

@mboersma

mboersma commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 4, 2026

@mboersma mboersma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you update the active 24.04.immutable template as well? It still removes /swapfile, but curtin creates /swap.img.

Also, please either restore the package-list cleanup or update the comments that say those lists are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants