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 Oct 29, 2024
1 parent d3511cf commit 1f002de
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 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
52 changes: 30 additions & 22 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -283,28 +283,36 @@ 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 from the CI AKS cluster.
get-credentials-ci:
nix run -L .#azure-cli -- aks get-credentials \
--resource-group "contrast-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")
# 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"
;;
"AKS-CI")
nix run -L .#azure-cli -- aks get-credentials \
--resource-group "contrast-ci" \
--name "contrast-ci" \
--admin
;;
*)
echo "Unsupported platform: {{ platform }}"
exit 1
;;
esac
# Destroy a running AKS cluster.
destroy platform=default_platform:
Expand Down

0 comments on commit 1f002de

Please sign in to comment.