-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows injection of arbitrary config files from an external source into the target root. This is pretty low tech...I'd really like to also support structured, cleanly "day 2" updatable configmaps, etc. But there is simply no getting away from the generally wanting the ability to inject arbitrary machine-local external state today. It's the lowest common denominitator that applies across many use cases. We're agnostic to *how* the data is provided; that could be fetched from cloud instance metadata, the hypervisor, a USB stick, config state provided for bootc-image-builder, etc. Just one technical implementation point, we do handle SELinux labeling here in a consistent way at least. Signed-off-by: Colin Walters <[email protected]>
- Loading branch information
Showing
4 changed files
with
207 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,13 +145,22 @@ jobs: | |
run: | | ||
set -xeuo pipefail | ||
image=quay.io/centos-bootc/centos-bootc-dev:stream9 | ||
tmpd=$(mktemp -d) | ||
# Create local /etc content | ||
echo foohost > ${tmpd}/hostname | ||
mkdir -p ${tmpd}/systemd/system | ||
echo -e '[Service]\nExecStart=true' > ${tmpd}/systemd/system/foo-local.service | ||
echo 'ssh-ed25519 ABC0123 [email protected]' > test_authorized_keys | ||
sudo podman run --rm --privileged -v ./test_authorized_keys:/test_authorized_keys --env RUST_LOG=debug -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc --pid=host --security-opt label=disable \ | ||
sudo podman run --rm --privileged -v ./test_authorized_keys:/test_authorized_keys --env RUST_LOG=debug -v /:/target -v /var/lib/containers:/var/lib/containers -v ./usr/bin/bootc:/usr/bin/bootc \ | ||
-v ${tmpd}:/config \ | ||
--pid=host --security-opt label=disable \ | ||
${image} bootc install to-filesystem --acknowledge-destructive \ | ||
--copy-etc /config \ | ||
--karg=foo=bar --disable-selinux --replace=alongside --root-ssh-authorized-keys=/test_authorized_keys /target | ||
ls -al /boot/loader/ | ||
sudo grep foo=bar /boot/loader/entries/*.conf | ||
grep authorized_keys /ostree/deploy/default/deploy/*/etc/tmpfiles.d/bootc-root-ssh.conf | ||
grep ExecStart=true /ostree/deploy/default/deploy/*/etc/systemd/system/foo-local.service | ||
# TODO fix https://github.com/containers/bootc/pull/137 | ||
sudo chattr -i /ostree/deploy/default/deploy/* | ||
sudo rm /ostree/deploy/default -rf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters