Remove config wrappers.
This commit is contained in:
@@ -123,7 +123,7 @@ prompt_if_unset_config "cluster.ipAddressPool" "MetalLB IP address pool" "${SUBN
|
||||
ip_pool=$(wild-config "cluster.ipAddressPool")
|
||||
|
||||
# Load balancer IP (automatically set to first address in the pool if not set)
|
||||
current_lb_ip=$(get_current_config "cluster.loadBalancerIp")
|
||||
current_lb_ip=$(wild-config "cluster.loadBalancerIp")
|
||||
if [ -z "$current_lb_ip" ] || [ "$current_lb_ip" = "null" ]; then
|
||||
lb_ip=$(echo "${ip_pool}" | cut -d'-' -f1)
|
||||
wild-config-set "cluster.loadBalancerIp" "${lb_ip}"
|
||||
@@ -135,14 +135,14 @@ prompt_if_unset_config "cluster.nodes.talos.version" "Talos version" "v1.10.4"
|
||||
talos_version=$(wild-config "cluster.nodes.talos.version")
|
||||
|
||||
# Talos schematic ID
|
||||
current_schematic_id=$(get_current_config "cluster.nodes.talos.schematicId")
|
||||
current_schematic_id=$(wild-config "cluster.nodes.talos.schematicId")
|
||||
if [ -z "$current_schematic_id" ] || [ "$current_schematic_id" = "null" ]; then
|
||||
echo ""
|
||||
print_info "Get your Talos schematic ID from: https://factory.talos.dev/"
|
||||
print_info "This customizes Talos with the drivers needed for your hardware."
|
||||
|
||||
# Use current schematic ID from config as default
|
||||
default_schematic_id=$(get_current_config "cluster.nodes.talos.schematicId")
|
||||
default_schematic_id=$(wild-config "cluster.nodes.talos.schematicId")
|
||||
if [ -n "$default_schematic_id" ] && [ "$default_schematic_id" != "null" ]; then
|
||||
print_info "Using schematic ID from config for Talos $talos_version"
|
||||
else
|
||||
@@ -154,7 +154,7 @@ if [ -z "$current_schematic_id" ] || [ "$current_schematic_id" = "null" ]; then
|
||||
fi
|
||||
|
||||
# External DNS
|
||||
cluster_name=$(get_current_config "cluster.name")
|
||||
cluster_name=$(wild-config "cluster.name")
|
||||
prompt_if_unset_config "cluster.externalDns.ownerId" "External DNS owner ID" "external-dns-${cluster_name}"
|
||||
|
||||
|
||||
@@ -188,18 +188,18 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
print_info "Registering control plane node: $NODE_NAME (IP: $TARGET_IP)"
|
||||
|
||||
# Initialize the node in cluster.nodes.active if not already present
|
||||
if [ -z "$(get_current_config "cluster.nodes.active.\"${NODE_NAME}\".role")" ]; then
|
||||
if [ -z "$(wild-config "cluster.nodes.active.\"${NODE_NAME}\".role")" ]; then
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".role" "controlplane"
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".targetIp" "$TARGET_IP"
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".currentIp" "$TARGET_IP"
|
||||
fi
|
||||
|
||||
# Check if node is already configured
|
||||
existing_interface=$(get_current_config "cluster.nodes.active.\"${NODE_NAME}\".interface")
|
||||
existing_interface=$(wild-config "cluster.nodes.active.\"${NODE_NAME}\".interface")
|
||||
if [ -n "$existing_interface" ] && [ "$existing_interface" != "null" ]; then
|
||||
print_success "Node $NODE_NAME already configured"
|
||||
print_info " - Interface: $existing_interface"
|
||||
print_info " - Disk: $(get_current_config "cluster.nodes.active.\"${NODE_NAME}\".disk")"
|
||||
print_info " - Disk: $(wild-config "cluster.nodes.active.\"${NODE_NAME}\".disk")"
|
||||
|
||||
# Generate machine config patch for this node if necessary.
|
||||
NODE_SETUP_DIR="${WC_HOME}/setup/cluster-nodes"
|
||||
@@ -288,8 +288,8 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".disk" "$SELECTED_DISK"
|
||||
|
||||
# Copy current Talos version and schematic ID to this node
|
||||
current_talos_version=$(get_current_config "cluster.nodes.talos.version")
|
||||
current_schematic_id=$(get_current_config "cluster.nodes.talos.schematicId")
|
||||
current_talos_version=$(wild-config "cluster.nodes.talos.version")
|
||||
current_schematic_id=$(wild-config "cluster.nodes.talos.schematicId")
|
||||
if [ -n "$current_talos_version" ] && [ "$current_talos_version" != "null" ]; then
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".version" "$current_talos_version"
|
||||
fi
|
||||
@@ -420,8 +420,8 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".disk" "$SELECTED_DISK"
|
||||
|
||||
# Copy current Talos version and schematic ID to this node
|
||||
current_talos_version=$(get_current_config "cluster.nodes.talos.version")
|
||||
current_schematic_id=$(get_current_config "cluster.nodes.talos.schematicId")
|
||||
current_talos_version=$(wild-config "cluster.nodes.talos.version")
|
||||
current_schematic_id=$(wild-config "cluster.nodes.talos.schematicId")
|
||||
if [ -n "$current_talos_version" ] && [ "$current_talos_version" != "null" ]; then
|
||||
wild-config-set "cluster.nodes.active.\"${NODE_NAME}\".version" "$current_talos_version"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user