This repository was archived by the owner on Aug 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 33set -e
44
55# default configure URL
6- CONFIG_URL=${CONFIG_URL:- https:// github.com/ packethost/ cluster-api-provider-packet/ releases/ latest/ clusterctl.yaml}
6+ DEFAULT_CONFIG_URL=https://api.github.com/repos/packethost/cluster-api-provider-packet/releases/latest
7+ TMPYAML=/tmp/clusterctl-packet.yaml
8+
9+ CONFIG_URL=${CONFIG_URL:- " " }
10+
11+ # if the config url was not provided, download it
12+ if [ -z " ${CONFIG_URL} " ]; then
13+ # because github does not have a direct link to an asset
14+ # this would be easier with jq, but not everyone has jq installed
15+ YAML_URL=$( curl -s ${DEFAULT_CONFIG_URL} | grep clusterctl.yaml | grep browser_download_url | cut -d " :" -f 2,3 | tr -d " \" " )
16+ curl -L -o ${TMPYAML} ${YAML_URL}
17+ CONFIG_URL=${TMPYAML}
18+ fi
719
820TEMPLATE_OUT=./out/cluster.yaml
921
@@ -51,6 +63,8 @@ FACILITY=${PACKET_FACILITY}
5163# and now export them all so envsubst can use them
5264export PROJECT_ID FACILITY NODE_OS WORKER_NODE_TYPE MASTER_NODE_TYPE POD_CIDR SERVICE_CIDR SSH_KEY KUBERNETES_VERSION
5365clusterctl --config=${CONFIG_URL} config cluster ${CLUSTER_NAME} > $TEMPLATE_OUT
66+ # remove any lingering config file
67+ rm -f ${TMPYAML}
5468
5569echo " Done! See output file at ${TEMPLATE_OUT} . Run:"
5670echo " kubectl apply -f ${TEMPLATE_OUT} "
You can’t perform that action at this time.
0 commit comments