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

just: use default platform for get-credentials #962

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
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
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 @@ -283,14 +283,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 @@ -299,13 +315,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