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

BundlePostInstall hook's rsync command needs a slash #3098

Open
ChrisPbb opened this issue Dec 27, 2024 · 0 comments
Open

BundlePostInstall hook's rsync command needs a slash #3098

ChrisPbb opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed

Comments

@ChrisPbb
Copy link

ChrisPbb commented Dec 27, 2024

Kairos version:

kairos@localhost:~$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
kairos@localhost:~$ cat /etc/kairos-release
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_SOFTWARE_VERSION_PREFIX="k3s"
KAIROS_ID="kairos"
KAIROS_FLAVOR="ubuntu"
KAIROS_RELEASE="v3.2.3"
KAIROS_ARTIFACT="kairos-ubuntu-22.04-core-amd64-generic-v3.2.3"
KAIROS_TARGETARCH="amd64"
KAIROS_VARIANT="core"
KAIROS_GITHUB_REPO="kairos-io/kairos"
KAIROS_NAME="kairos-core-ubuntu-22.04"
KAIROS_ID_LIKE="kairos-core-ubuntu-22.04"
KAIROS_IMAGE_REPO="quay.io/kairos/ubuntu:22.04-core-amd64-generic-v3.2.3"
KAIROS_IMAGE_LABEL="22.04-core-amd64-generic-v3.2.3"
KAIROS_FLAVOR_RELEASE="22.04"
KAIROS_FAMILY="ubuntu"
KAIROS_MODEL="generic"
KAIROS_REGISTRY_AND_ORG="quay.io/kairos"
KAIROS_VERSION="v3.2.3"
KAIROS_VERSION_ID="v3.2.3"
KAIROS_PRETTY_NAME="kairos-core-ubuntu-22.04 v3.2.3"
kairos@localhost:~$

CPU architecture, OS, and Version:

kairos@localhost:~$ uname -a
Linux localhost 6.8.0-48-generic #48~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct  7 11:24:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug
The source image's extensions are not properly copied over to the machine after install. Instead they all end up in /var/lib/extensions/extensions, causing systemd-sysext to treat them all as one big extension.

According to the rsync man page:

A trailing slash on the source ... [avoids] creating an additional directory level at the destination.

Thus, I think the culprit is the BundlePostInstall hook's rsync command. We should be able to solve the issue with a / on the source (example below)

cmd := exec.Command("rsync", "-aqAX", "/var/lib/extensions/", "/usr/local/.state/var-lib-extensions.bind")

To Reproduce
Define some bundles under install.bundles and provision a system. Notice the resulting system has /var/lib/extensions/extensions.

Expected behavior
The source image's /var/lib/extensions content is copied to the bind mount instead of the entire extensions directory itself.

Logs

kairos@localhost:~$ ls -l /var/lib/extensions/
total 8
d--------- 2 root root 4096 Dec 27 20:55 extensions
drwxr-xr-x 4 root root 4096 Dec 27 20:57 <CENSORED>
kairos@localhost:~$
@ChrisPbb ChrisPbb added bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Add this label to issues that should be triaged and prioretized in the next planning call unconfirmed
Projects
Status: No status
Development

No branches or pull requests

1 participant