mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-23 08:20:15 -05:00
e2e: fix collection of boot logs on GCP (#401)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
fd74ef754e
commit
4cd659b394
@ -179,10 +179,7 @@ runs:
|
|||||||
./.github/actions/constellation_create/az-logs.sh ${AZURE_RESOURCE_GROUP}
|
./.github/actions/constellation_create/az-logs.sh ${AZURE_RESOURCE_GROUP}
|
||||||
;;
|
;;
|
||||||
gcp)
|
gcp)
|
||||||
CONTROL_NODES=$(jq -r '.gcpcontrolplaneinstancegroup' constellation-state.json)
|
./.github/actions/constellation_create/gcp-logs.sh
|
||||||
WORKER_NODES=$(jq -r '.gcpworkerinstancegroup' constellation-state.json)
|
|
||||||
ZONE=$(jq -r '.gcpzone' constellation-state.json)
|
|
||||||
./.github/actions/constellation_create/gcp-logs.sh ${CONTROL_NODES} ${WORKER_NODES} ${ZONE}
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
22
.github/actions/constellation_create/gcp-logs.sh
vendored
22
.github/actions/constellation_create/gcp-logs.sh
vendored
@ -1,18 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Usage: ./gcp-logs.sh <control-instance-group-name> <worker-instance-group-name> <zone>
|
# Usage: ./gcp-logs.sh
|
||||||
|
|
||||||
|
CONTROL_INSTANCE_GROUP=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_control_plane") | .resources[0].values.base_instance_name' )
|
||||||
|
WORKER_INSTANCE_GROUP=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_worker") | .resources[0].values.base_instance_name')
|
||||||
|
ZONE=$(terraform show -json | jq -r .'values.root_module.child_modules[] | select(.address == "module.instance_group_control_plane") | .resources[0].values.zone' )
|
||||||
|
|
||||||
|
CONTROL_INSTANCE_GROUP_SHORT=${CONTROL_INSTANCE_GROUP##*/}
|
||||||
|
WORKER_INSTANCE_GROUP_SHORT=${WORKER_INSTANCE_GROUP##*/}
|
||||||
|
|
||||||
|
CONTROL_INSTANCES=$(gcloud compute instance-groups managed list-instances ${CONTROL_INSTANCE_GROUP_SHORT} --zone ${ZONE} --format=json | jq -r '.[] | .instance')
|
||||||
|
WORKER_INSTANCES=$(gcloud compute instance-groups managed list-instances ${WORKER_INSTANCE_GROUP_SHORT} --zone ${ZONE} --format=json | jq -r '.[] | .instance')
|
||||||
|
|
||||||
CONTROL_INSTANCES=$(gcloud compute instance-groups list-instances $1 --zone $3 --format=json | jq -r .'[] | .instance')
|
|
||||||
WORKER_INSTANCES=$(gcloud compute instance-groups list-instances $2 --zone $3 --format=json | jq -r .'[] | .instance')
|
|
||||||
ALL_INSTANCES="$CONTROL_INSTANCES $WORKER_INSTANCES"
|
ALL_INSTANCES="$CONTROL_INSTANCES $WORKER_INSTANCES"
|
||||||
|
|
||||||
printf "Fetching logs for %s and %s\n" $CONTROL_INSTANCES $WORKER_INSTANCES
|
printf "Fetching logs for %s and %s\n" ${CONTROL_INSTANCES} ${WORKER_INSTANCES}
|
||||||
|
|
||||||
for INSTANCE in $ALL_INSTANCES; do
|
for INSTANCE in $ALL_INSTANCES; do
|
||||||
SHORT_NAME=${INSTANCE##*/}
|
SHORT_NAME=${INSTANCE##*/}
|
||||||
printf "Fetching for %s\n" $SHORT_NAME
|
printf "Fetching for %s\n" ${SHORT_NAME}
|
||||||
gcloud compute instances get-serial-port-output $INSTANCE \
|
gcloud compute instances get-serial-port-output ${INSTANCE} \
|
||||||
--port 1 \
|
--port 1 \
|
||||||
--start 0 \
|
--start 0 \
|
||||||
--zone $3 > $SHORT_NAME.log
|
--zone ${ZONE} > ${SHORT_NAME}.log
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user