install kubectl in kube-bench workflow
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 13s

This commit is contained in:
2026-08-11 16:54:07 -04:00
parent 97320318f4
commit 4c1864587f
+17
View File
@@ -21,6 +21,23 @@ jobs:
- name: Install k3d - name: Install k3d
run: curl -sfL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash run: curl -sfL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
- name: Install kubectl
shell: bash
run: |
set -euo pipefail
kubectl_version=v1.35.5
temp_dir="$(mktemp -d)"
trap 'rm -rf "$temp_dir"' EXIT
curl --fail --location --retry 3 \
--output "$temp_dir/kubectl" \
"https://dl.k8s.io/release/${kubectl_version}/bin/linux/amd64/kubectl"
curl --fail --location --retry 3 \
--output "$temp_dir/kubectl.sha256" \
"https://dl.k8s.io/release/${kubectl_version}/bin/linux/amd64/kubectl.sha256"
printf '%s %s\n' "$(cat "$temp_dir/kubectl.sha256")" "$temp_dir/kubectl" | sha256sum --check --strict -
install -m 0755 "$temp_dir/kubectl" /usr/local/bin/kubectl
kubectl version --client
- name: Create ephemeral K3s cluster - name: Create ephemeral K3s cluster
run: | run: |
k3d cluster create --config ci/k3d-ci-cluster-config.yaml k3d cluster create --config ci/k3d-ci-cluster-config.yaml