replace teleport labels
Build and Push Docker Images / build-and-push (push) Successful in 22s

This commit is contained in:
2025-10-22 21:52:28 +02:00
parent 5b9ff2dc1d
commit 99de6de842
@@ -103,15 +103,14 @@ add_teleport_labels() {
return 1 return 1
fi fi
# Check if labels section already exists under ssh_service # Remove any existing labels section
if grep -q " labels:" "$CONFIG_FILE"; then sed -i '/^ labels:/,/^[^[:space:]]/ { /^ labels:/d; /^[^[:space:]]/!d; }' "$CONFIG_FILE"
echo "Labels section already exists, updating..."
# Remove existing labels section # Find the line number of ssh_service and add labels after it
sed -i '/^ labels:/,/^[^ ]/ { /^ labels:/d; /^[^ ]/!d; }' "$CONFIG_FILE" ssh_line=$(grep -n "^ssh_service:" "$CONFIG_FILE" | cut -d: -f1)
fi
# Add labels section after ssh_service # Add labels section after ssh_service
sed -i '/^ssh_service:/a\ labels:' "$CONFIG_FILE" sed -i "${ssh_line}a\\ labels:" "$CONFIG_FILE"
# Parse TELEPORT_LABELS and add each label # Parse TELEPORT_LABELS and add each label
IFS=',' read -ra LABELS <<< "$TELEPORT_LABELS" IFS=',' read -ra LABELS <<< "$TELEPORT_LABELS"