Skip to content

Commit

Permalink
just: use default platform for get-credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
davidweisse committed Nov 4, 2024
1 parent 78cb6dc commit e2fcc5b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/asciinema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
cat <<EOF > justfile.env
container_registry=${{ env.container_registry }}
azure_resource_group=${{ env.azure_resource_group }}
default_platform="AKS-CLH-SNP"
EOF
- name: Get credentials for CI cluster
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
cat <<EOF > justfile.env
container_registry=${{ env.container_registry }}
azure_resource_group=${{ env.azure_resource_group }}
default_platform=${{ inputs.platform }}
EOF
- if: ${{ !inputs.self-hosted }}
name: Get credentials for CI cluster
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ jobs:
cat <<EOF > justfile.env
container_registry=${{ env.container_registry }}
azure_resource_group=${{ env.azure_resource_group }}
default_platform=${{ matrix.platform.name }}
EOF
- name: Get credentials for CI cluster
if: ${{ !matrix.platform.self-hosted }}
Expand Down
39 changes: 24 additions & 15 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,30 @@ wait-for-workload target=default_deploy_target:
;;
esac
# Load the kubeconfig from the running AKS cluster.
get-credentials:
nix run -L .#azure-cli -- aks get-credentials \
--resource-group "$azure_resource_group" \
--name "$azure_resource_group"
get-credentials-peerpod:
nix run -L .#scripts.merge-kube-config -- ./infra/azure-peerpods/kube.conf
# Load the kubeconfig for the given platform.
get-credentials platform=default_platform:
#!/usr/bin/env bash
set -euo pipefail
case {{ platform }} in
"AKS-CLH-SNP")
nix run -L .#azure-cli -- aks get-credentials \
--resource-group "$azure_resource_group" \
--name "$azure_resource_group"
;;
"AKS-PEER-SNP")
nix run -L .#scripts.merge-kube-config -- ./infra/azure-peerpods/kube.conf
;;
"K3s-QEMU-TDX")
nix run -L .#scripts.get-credentials "projects/796962942582/secrets/m50-ganondorf-kubeconf/versions/5"
;;
"K3s-QEMU-SNP")
nix run -L .#scripts.get-credentials "projects/796962942582/secrets/discovery-kubeconf/versions/2"
;;
*)
echo "Unsupported platform: {{ platform }}"
exit 1
;;
esac
# Load the kubeconfig from the CI AKS cluster.
get-credentials-ci:
Expand All @@ -302,13 +318,6 @@ get-credentials-ci:
--name "contrast-ci" \
--admin
get-credentials-from-gcloud path:
nix run -L .#scripts.get-credentials {{ path }}
get-credentials-tdxbm: (get-credentials-from-gcloud "projects/796962942582/secrets/m50-ganondorf-kubeconf/versions/5")
get-credentials-snpbm: (get-credentials-from-gcloud "projects/796962942582/secrets/discovery-kubeconf/versions/2")
# Destroy a running AKS cluster.
destroy platform=default_platform:
#!/usr/bin/env bash
Expand Down

0 comments on commit e2fcc5b

Please sign in to comment.