#!/bin/bash CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" [ -d "$CURR_DIR" ] || { echo "FATAL: no current dir (maybe running in zsh?)"; exit 1; } # shellcheck source=./common.sh source "$CURR_DIR/common.sh" ### Step Setup ### # Redirect all stdout/stderr output to logfile LOG_FILE="$TEST_OUTPUT_DIR/$( basename "${BASH_SOURCE[0]}" ).log" exec >${LOG_FILE} 2>&1 export LOG_FILE # use a kubeconfig file specific to this test KUBECONFIG="$KUBECONFIG_ROOT/$( basename "${BASH_SOURCE[0]}" ).yaml" export KUBECONFIG ### Step Setup ### : "${EXTRA_FLAG:=""}" : "${EXTRA_TITLE:=""}" if [[ -n "$K3S_IMAGE" ]]; then EXTRA_FLAG="--image rancher/k3s:$K3S_IMAGE" EXTRA_TITLE="(rancher/k3s:$K3S_IMAGE)" fi export CURRENT_STAGE="Test | config-file-stdin | $K3S_IMAGE" configfileoriginal="$CURR_DIR/assets/config_test_simple.yaml" configfile="/tmp/config_test_simple-tmp_$(date -u +'%Y%m%dT%H%M%SZ').yaml" clustername="configteststdin" sed -E "s/^ name:.+/ name: $clustername/g" < "$configfileoriginal" > "$configfile" # replace cluster name in config file so we can use it in this script without running into override issues cat "$configfile" highlight "[START] ConfigTest $EXTRA_TITLE" info "Creating cluster $clustername..." cat <