Skip to content

Commit 7d53aab

Browse files
author
Ian Campbell
committed
boot.sh: Support additional user-supplied metadata
Specified with the KUBE_METADATA environment variable, which should omit the outermost `{}` e.g. might typically contain a key for a custom directory: KUBE_METADATA='"custom-thing": { "entries": { "foo" : {"content": "bar" }, ... } }' Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent 3a80c64 commit 7d53aab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

boot.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ set -e
1717
: ${KUBE_MAC:=}
1818
: ${KUBE_CLEAR_STATE:=}
1919

20+
: ${KUBE_METADATA:=} # Without the outermost braces {}.
21+
2022
[ "$(uname -s)" = "Darwin" ] && KUBE_EFI=1
2123

2224
suffix=".iso"
@@ -84,6 +86,9 @@ fi
8486

8587
mkdir -p "${state}"
8688
touch $state/metadata.json
89+
if [ -n "${KUBE_METADATA}" ] ; then
90+
metadata="${metadata:+$metadata, }${KUBE_METADATA}"
91+
fi
8792
if [ -n "${kubeadm_data}" ] ; then
8893
metadata="${metadata:+$metadata, }\"kubeadm\": { \"entries\": { ${kubeadm_data} } }"
8994
fi

0 commit comments

Comments
 (0)