Settle on v1 setup method. Test run completed successfully from bootstrap to service setup.
- Refactor dnsmasq configuration and scripts for improved variable handling and clarity - Updated dnsmasq configuration files to use direct variable references instead of data source functions for better readability. - Modified setup scripts to ensure they are run from the correct environment and directory, checking for the WC_HOME variable. - Changed paths in README and scripts to reflect the new directory structure. - Enhanced error handling in setup scripts to provide clearer guidance on required configurations. - Adjusted kernel and initramfs URLs in boot.ipxe to use the updated variable references.
This commit is contained in:
@@ -7,7 +7,7 @@ set -o pipefail
|
||||
usage() {
|
||||
echo "Usage: wild-config <yaml_key_path>"
|
||||
echo ""
|
||||
echo "Read a value from ./config.yaml using a YAML key path."
|
||||
echo "Read a value from \$WC_HOME/config.yaml using a YAML key path."
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " wild-config 'cluster.name' # Get cluster name"
|
||||
@@ -49,17 +49,25 @@ if [ -z "${KEY_PATH}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "./config.yaml" ]; then
|
||||
echo "Error: ./config.yaml not found in current directory"
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
||||
if [ ! -f "${CONFIG_FILE}" ]; then
|
||||
echo "Error: config file not found at ${CONFIG_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use yq to extract the value from the YAML file
|
||||
result=$(yq eval ".${KEY_PATH}" ./config.yaml)
|
||||
result=$(yq eval ".${KEY_PATH}" "${CONFIG_FILE}") 2>/dev/null
|
||||
|
||||
# Check if result is null (key not found)
|
||||
if [ "${result}" = "null" ]; then
|
||||
echo "Error: Key path '${KEY_PATH}' not found in ./config.yaml" >&2
|
||||
echo "Error: Key path '${KEY_PATH}' not found in ${CONFIG_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user