lxd
lxd copied to clipboard
Support for binary cloud-init user data
Cloud-init has support for certain forms of binary user data, but LXD doesn't pass it along correctly.
For example, with the following user data:
$ cat cloud-config.yaml
#cloud-config
bootcmd:
- echo 'hi' > /var/tmp/hi
If I
gzip cloud-config.yaml
then
lxc launch ubuntu:jammy asdf -c user.user-data="$(cat cloud-config.yaml.gz)"
the data received from inside the container using
curl --unix-socket /dev/lxd/sock http://1.0/1.0/config/user.user-data
doesn't match the data contained in cloud-config.yaml.gz
It appears the data is getting cutoff at a null byte.