From 0caba8690d7beafa42ad7130dd23f0ddbd80c2e4 Mon Sep 17 00:00:00 2001 From: James Gu Date: Tue, 13 Apr 2021 08:31:57 -0700 Subject: [PATCH] Improve the script 33 to retrieve the target node from rendered document Changes from hard coded value node01 to retrieve the first target node name from the rendered phase document Signed-off-by: James Gu Change-Id: I5e80b34a3a1267b75202b2bdef9d43d053bf22c5 (cherry picked from commit 1ceecdb1f198e1fc4bb9f4c53b2a57a350822947) --- tools/deployment/33_cluster_move_target_node.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/deployment/33_cluster_move_target_node.sh b/tools/deployment/33_cluster_move_target_node.sh index c58376949..4d18e49b8 100755 --- a/tools/deployment/33_cluster_move_target_node.sh +++ b/tools/deployment/33_cluster_move_target_node.sh @@ -19,6 +19,11 @@ export TIMEOUT=${TIMEOUT:-3600} export KUBECONFIG=${KUBECONFIG:-"$HOME/.airship/kubeconfig"} export KUBECONFIG_TARGET_CONTEXT=${KUBECONFIG_TARGET_CONTEXT:-"target-cluster"} export CLUSTER_NAMESPACE=${CLUSTER_NAMESPACE:-"default"} +export TARGET_NODE=${TARGET_NODE:-"$(airshipctl phase render controlplane-ephemeral \ + -k BareMetalHost -l airshipit.org/k8s-role=controlplane-host \ + 2> /dev/null | \ + yq .metadata.name | \ + sed 's/"//g')"} # Annotating BMH objects with a pause label # Scripts for this phase placed in manifests/function/phase-helpers/pause_bmh/