1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2026-02-04 04:22:43 +03:00

replace set_nocloud_meta with fake_metadata_nocloud

remove redundand test code
This commit is contained in:
Natanael Copa 2023-06-07 14:15:07 +02:00
parent d5a5e88b6a
commit e36abdef4a

View File

@ -153,30 +153,8 @@ save_userdata_compressed_body() {
done done
} }
set_nocloud_meta() {
local metadata="$(cat)"
fake_bin mount <<-EOF
#!/bin/sh
# find last arg which is the mount dir
while ! [ -d "\$1" ]; do
shift
done
printf "%s" "$metadata" \
> "\$1"/meta-data
EOF
fake_bin umount <<-EOF
#!/bin/sh
while ! [ -d "\$1" ]; do
shift
done
rm -f "\$1"/meta-data
EOF
mkdir -p mnt
}
set_hostname_body() { set_hostname_body() {
set_nocloud_meta <<-EOF fake_metadata_nocloud <<-EOF
hostname: myhostname hostname: myhostname
EOF EOF
@ -191,7 +169,7 @@ set_ssh_keys_body() {
#!/bin/sh #!/bin/sh
echo "alpine:x:1000:1000:Linux User,,,:/home/alpine:/bin/sh" echo "alpine:x:1000:1000:Linux User,,,:/home/alpine:/bin/sh"
EOF EOF
set_nocloud_meta user-data <<-EOF fake_metadata_nocloud <<-EOF
public-keys: public-keys:
- openssh-key: ssh-ed25519 keydata - openssh-key: ssh-ed25519 keydata
- openssh-key: ssh-rsa foobar - openssh-key: ssh-rsa foobar