Skip to content

Commit

Permalink
test: don't use gh cli in kbs checkout
Browse files Browse the repository at this point in the history
Since we clone the repo we can use git to resolve a tag/branch to a
sha. We probably want to avoid using gh cli in places where it's not
required, because it involves setting secrets and makes executing tests
more cumbersome. There could also be breakage if people specify a fork
as KBS_REPO, since we use the gh cli with a hardcoded repository.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
  • Loading branch information
mkulke authored and wainersm committed Oct 11, 2024
1 parent 191ec51 commit 3f2fc95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cloud-api-adaptor/test/utils/checkout_kbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rm -rf "${TEST_DIR}/trustee"
git clone "${KBS_REPO}" "${TEST_DIR}/trustee"
pushd "${TEST_DIR}/trustee"
git checkout "${KBS_VERSION}"
KBS_SHA="$(git rev-parse HEAD)"

# kbs-client setup - to be removed when we use the cached version instead
sudo apt-get update -y
Expand All @@ -30,7 +31,6 @@ popd
pushd kbs/config/kubernetes/base/
# Trustee only updates their staging image reliably with sha tags,
# so switch to use that and convert the version to the sha
KBS_SHA=$(gh api repos/confidential-containers/trustee/commits/${KBS_VERSION} -q .sha)
kustomize edit set image kbs-container-image=ghcr.io/confidential-containers/staged-images/kbs:${KBS_SHA}
# For debugging
echo "Trustee deployment: $(cat kustomization.yaml). Images: $(grep -A 5 images: kustomization.yaml)"

0 comments on commit 3f2fc95

Please sign in to comment.