Skip to content

Instantly share code, notes, and snippets.

@sjenning
Created March 19, 2024 21:36
Show Gist options
  • Save sjenning/9a25290b04e79fb883696e0c15867950 to your computer and use it in GitHub Desktop.
Save sjenning/9a25290b04e79fb883696e0c15867950 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eux
HC_NAMESPACE=sjenning
HC_NAME=sjenning-mgmt
NP_NAME=sjenning-mgmt-us-east-1a
IGNITION_ROUTE=$(oc get route -n $HC_NAMESPACE-$HC_NAME ignition-server -ojsonpath='{.status.ingress[0].host}')
NODEPOOL_TOKEN_SECERT=$(oc get secret | cut -f1 -d' ' | grep ^token-$NP_NAME)
TARGET_CONFIG_VERSION_HASH=$(echo $NODEPOOL_TOKEN_SECERT | awk -F'-' '{print $NF}')
TOKEN=$(oc get secret $NODEPOOL_TOKEN_SECERT -ojsonpath='{.data.token}')
curl -s --insecure \
-H "NodePool: $NP_NAME" \
-H "TargetConfigVersionHash: $TARGET_CONFIG_VERSION_HASH" \
-H "Authorization: Bearer $TOKEN" \
https://$IGNITION_ROUTE/ignition | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment