-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Issue: When using a custom userdata yaml file, the "ExpandString" portion of "New-HyperVCloudImageVM.ps1" causes errors when parsing of PowerShell variables is not required/desired.
Examples:
- Adding the following to the
runcmd:section of a custom userdata file:
# Install the Kubectl binary:
- |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
causes the script to fail with the following error:
- Adding the following to the
runcmd:section of the custom userdata file:
# Install the Cilium CNI CLI binary:
- |
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
CLI_ARCH=amd64
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
causes the script to fail with the following error:
Removing these sections from the userdata yaml file allows the script to run without error, but results in the undesirable result of having to manually run the commands after the VM build completes.
Recommendation: Provide a flag or other option to disable variable parsing when using a custom userdata yaml file.
Metadata
Metadata
Assignees
Labels
No labels

