Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix workspace related errors when setting up k8s version for test #2891

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/e2e-test-provider-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jobs:
id: build
shell: bash
run: |
mkdir build
cd build
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
bazel run //:devbuild --cli_edition=enterprise

bazel build //bazel/settings:tag
Expand Down Expand Up @@ -189,19 +189,22 @@ jobs:
- name: Set Kubernetes version
id: kubernetes
run: |
set -e

# take the middle (2nd) supported Kubernetes version (default)
if [[ "${{ inputs.providerVersion }}" != "" ]]; then
echo "VERSION=$(../release/constellation config kubernetes-versions | awk 'NR==3{print $1}')" | tee -a "$GITHUB_OUTPUT"
cli_output=$(${{ github.workspace }}/release/constellation config kubernetes-versions)
else
echo "VERSION=$(../build/constellation config kubernetes-versions | awk 'NR==3{print $1}')" | tee -a "$GITHUB_OUTPUT"
cli_output=$(${{ github.workspace }}/build/constellation config kubernetes-versions)
fi
echo "version=$(echo "${cli_output}" | awk 'NR==3{print $1}')" | tee -a "${GITHUB_OUTPUT}"

- name: Common CSP Terraform overrides
working-directory: ${{ github.workspace }}
shell: bash
run: |
mkdir cluster
cd cluster
mkdir -p ${{ github.workspace }}/cluster
cd ${{ github.workspace }}/cluster
if [[ "${{ inputs.providerVersion }}" == "" ]]; then
prefixed_version=${{ steps.build.outputs.build_version }}
else
Expand All @@ -210,8 +213,8 @@ jobs:
version=${prefixed_version#v} # remove v prefix

if [[ "${{ inputs.providerVersion }}" == "" ]]; then
iam_src="../terraform-module/iam/${{ steps.determine.outputs.cloudProvider }}"
infra_src="../terraform-module/${{ steps.determine.outputs.cloudProvider }}"
iam_src="${{ github.workspace }}/terraform-module/iam/${{ steps.determine.outputs.cloudProvider }}"
infra_src="${{ github.workspace }}/terraform-module/${{ steps.determine.outputs.cloudProvider }}"
else
iam_src="https://github.com/edgelesssys/constellation/releases/download/${{ inputs.providerVersion }}/terraform-module.zip//terraform-module/iam/${{ steps.determine.outputs.cloudProvider }}"
infra_src="https://github.com/edgelesssys/constellation/releases/download/${{ inputs.providerVersion }}/terraform-module.zip//terraform-module/${{ steps.determine.outputs.cloudProvider }}"
Expand Down Expand Up @@ -310,10 +313,10 @@ jobs:
shell: bash
run: |
terraform init
if [[ "${{ steps.determine.outputs.cloudProvider }}" == "azure" ]]; then
if [[ "${{ inputs.attestationVariant }}" == "azure-sev-snp" ]]; then
terraform apply -target module.azure_iam -auto-approve
terraform apply -target module.azure_infrastructure -auto-approve
../build/constellation maa-patch "$(terraform output -raw maa_url)"
${{ github.workspace }}/build/constellation maa-patch "$(terraform output -raw maa_url)"
terraform apply -target constellation_cluster.azure_example -auto-approve
else
terraform apply -auto-approve
Expand Down Expand Up @@ -405,7 +408,7 @@ jobs:
fi

# cfg must be in same dir as KUBECONFIG
../build/constellation config generate "${{ steps.determine.outputs.cloudProvider }}"
${{ github.workspace }}/build/constellation config generate "${{ steps.determine.outputs.cloudProvider }}"
# make cfg valid with fake data
# IMPORTANT: zone needs to be correct because it is used to resolve the CSP image ref
if [[ "${{ steps.determine.outputs.cloudProvider }}" == "azure" ]]; then
Expand Down
Loading