use common boostrapperhost field and wait before reading pcr values (#281)

* use common boostrapperhost field and wait before reading pcr values
* use wait to be more explicit about goal
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com>
This commit is contained in:
Fabian Kammel 2022-07-20 10:47:22 +02:00 committed by GitHub
parent 877fc7a0d2
commit 3842e50c49

View File

@ -41,17 +41,14 @@ runs:
# for why we ignore certain measurement values. # for why we ignore certain measurement values.
- name: Fetch PCRs - name: Fetch PCRs
run: | run: |
KUBECONFIG="$PWD/constellation-admin.conf" kubectl wait ds/verification-service -n kube-system --for condition=available
CONSTELL_IP=$(jq -r ".bootstrapperhost" constellation-state.json)
pcr-reader --constell-ip ${CONSTELL_IP} -format yaml > measurements.yaml
case $CSP in case $CSP in
azure) azure)
FIRST_NODE=$(jq -r ".azurecontrolplanes | keys | first" constellation-state.json)
CONSTELL_IP=$(jq -r ".azurecontrolplanes.\"${FIRST_NODE}\".PublicIP" constellation-state.json)
pcr-reader --constell-ip ${CONSTELL_IP} -format yaml > measurements.yaml
yq e 'del(.[0,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23])' -i measurements.yaml yq e 'del(.[0,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23])' -i measurements.yaml
;; ;;
gcp) gcp)
FIRST_NODE=$(jq -r ".gcpcontrolplanes | keys | first" constellation-state.json)
CONSTELL_IP=$(jq -r ".gcpcontrolplanes.\"${FIRST_NODE}\".PublicIP" constellation-state.json)
pcr-reader --constell-ip ${CONSTELL_IP} -format yaml > measurements.yaml
yq e 'del(.[11,12,13,14,15,16,17,18,19,20,21,22,23])' -i measurements.yaml yq e 'del(.[11,12,13,14,15,16,17,18,19,20,21,22,23])' -i measurements.yaml
;; ;;
esac esac