deps(deps): update kubernetes packages ( v0.31.1 → v0.31.2 ) #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Test E2E | |
on: | |
# Manual Trigger | |
workflow_dispatch: {} | |
# Run on any PR that changes this pipeline or that should ultimately trigger a release when merged | |
pull_request: | |
paths: | |
- ".github/workflows/test.yaml" | |
- "go.mod" | |
- "go.sum" | |
- "**/**.go" | |
env: | |
KUBECONFIG_DIR: ./configs/ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Build `kubectl-switch` | |
run: go build -o kubectl-switch | |
- name: Install `minikube` | |
run: | | |
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 | |
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64 | |
- name: Set Up Kubernetes Clusters | |
run: | | |
KUBECONFIG=./configs/cluster1.yaml minikube start -p test-cluster-1 & | |
KUBECONFIG=./configs/cluster2.yaml minikube start -p test-cluster-2 & | |
wait | |
- name: Switch context to test-cluster-1 | |
run: ./kubectl-switch context test-cluster-1 | |
- name: Validate the cluster has switched to test-cluster-1 by listing nodes | |
run: | | |
kubectl get nodes | grep "test-cluster-1" || { echo "Error: test-cluster-1 not found in node list!" >&2; exit 1; } | |
- name: Check that no pods are found in the default namespace | |
run: | | |
kubectl get pods --namespace=default 2>&1 | grep "No resources found" || { echo "Error: Pods found in default namespace!" >&2; exit 1; } | |
- name: Switch to the kube-system namespace | |
run: ./kubectl-switch namespace kube-system | |
- name: Validate that kube-system namespace is selected and kube-apiserver is running | |
run: | | |
kubectl get pods --namespace=kube-system | grep "kube-apiserver" || { echo "Error: kube-apiserver not found in kube-system!" >&2; exit 1; } | |
- name: Switch back to the default namespace | |
run: ./kubectl-switch namespace default | |
- name: Check that no pods are found again in the default namespace | |
run: | | |
kubectl get pods --namespace=default 2>&1 | grep "No resources found" || { echo "Error: Pods found in default namespace!" >&2; exit 1; } | |
- name: Switch context to test-cluster-2 | |
run: ./kubectl-switch context test-cluster-2 | |
- name: Validate the cluster has switched to test-cluster-2 by listing nodes | |
run: | | |
kubectl get nodes | grep "test-cluster-2" || { echo "Error: test-cluster-2 not found in node list!" >&2; exit 1; } |