Created
August 21, 2019 19:33
-
-
Save mcornea/ac642f1f7ba99efd905133c30355159b to your computer and use it in GitHub Desktop.
link-machine-and-node.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/link-machine-and-node.sh b/link-machine-and-node.sh | |
index 29fb82c..01d618b 100755 | |
--- a/link-machine-and-node.sh | |
+++ b/link-machine-and-node.sh | |
@@ -49,6 +49,16 @@ ipaddr=$(echo "${addresses}" | jq '.[] | select(. | .type == "InternalIP") | .ad | |
host_patch=' | |
{ | |
"status": { | |
+ "poweredOn": true, | |
+ "operationalStatus": "", | |
+ "hardwareProfile": "", | |
+ "provisioning": { | |
+ "state": "", | |
+ "ID": "" | |
+ }, | |
+ "goodCredentials": {}, | |
+ "triedCredentials": {}, | |
+ "errorMessage": "", | |
"hardware": { | |
"hostname": "'${hostname}'", | |
"nics": [ | |
@@ -98,16 +108,14 @@ while true; do | |
return 1 | |
fi | |
- state=$(curl -s \ | |
+ externally_provisioned=$(curl -s \ | |
-X GET \ | |
${HOST_PROXY_API_PATH}/${host}/status \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "User-Agent: link-machine-and-node" \ | |
- | jq '.status.provisioning.state' \ | |
- | sed 's/"//g') | |
- echo "$state" | |
- if [ "$state" = "externally provisioned" ]; then | |
+ | jq '.spec.externallyProvisioned' ) | |
+ if [ "$externally_provisioned" ]; then | |
break | |
fi | |
sleep 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment