2
2
3
3
ARG ref=main
4
4
5
- FROM ghcr.io/nicholasdille/docker-setup/krew:${ref} AS krew
6
5
FROM ghcr.io/nicholasdille/docker-setup/cosign:${ref} AS cosign
7
6
8
7
FROM ghcr.io/nicholasdille/docker-setup/base:${ref} AS prepare
@@ -16,8 +15,8 @@ curl --silent --location --fail --output "${prefix}${target}/bin/kubectl" \
16
15
"https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl"
17
16
chmod +x "${prefix}${target}/bin/kubectl"
18
17
19
- if test "$(echo -e "1.26.0-beta.0\n${version}\n " | sort -V | head -n 1)" == "1.26.0-beta.0"; then
20
- echo "Verifying keyless signature"
18
+ if test "$(echo -e "1.26.0-beta.0\n${version}" | sort -V | head -n 1)" == "1.26.0-beta.0"; then
19
+ echo "Verifying keyless signature for kubectl "
21
20
curl --silent --location --fail --output "/tmp/kubectl.sig" \
22
21
"https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl.sig"
23
22
curl --silent --location --fail --output "/tmp/kubectl.cert" \
@@ -27,20 +26,31 @@ if test "$(echo -e "1.26.0-beta.0\n${version}\n" | sort -V | head -n 1)" == "1.2
27
26
--certificate "/tmp/kubectl.cert" \
28
27
--certificate-oidc-issuer https://accounts.google.com \
29
28
--certificate-email krel-staging@k8s-releng-prod.iam.gserviceaccount.com
29
+ rm -f \
30
+ "/tmp/kubectl.sig" \
31
+ "/tmp/kubectl.cert"
30
32
fi
31
33
32
34
curl --silent --location --fail --output "${prefix}${target}/bin/kubectl-convert" \
33
35
"https://dl.k8s.io/release/v${version}/bin/linux/${alt_arch}/kubectl-convert"
34
36
chmod +x "${prefix}${target}/bin/kubectl-convert"
35
- #curl --silent --location --fail --output "/tmp/kubectl-convert.sig" \
36
- # "https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl-convert.sig"
37
- #curl --silent --location --fail --output "/tmp/kubectl-convert.cert" \
38
- # "https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl-convert.cert"
39
- #COSIGN_EXPERIMENTAL=1 cosign verify-blob "${prefix}${target}/bin/kubectl-convert" \
40
- # --signature "/tmp/kubectl-convert.sig" \
41
- # --certificate "/tmp/kubectl-convert.cert" \
42
- # --certificate-oidc-issuer https://accounts.google.com \
43
- # --certificate-email krel-staging@k8s-releng-prod.iam.gserviceaccount.com
37
+
38
+ if test "$(echo -e "1.26.0-beta.0\n${version}" | sort -V | head -n 1)" == "1.26.0-beta.0"; then
39
+ echo "Verifying keyless signature for kubectl-convert"
40
+ curl --silent --location --fail --output "/tmp/kubectl-convert.sig" \
41
+ "https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl-convert.sig"
42
+ curl --silent --location --fail --output "/tmp/kubectl-convert.cert" \
43
+ "https://dl.k8s.io/release/v${version}/bin/linux/amd64/kubectl-convert.cert"
44
+ COSIGN_EXPERIMENTAL=1 cosign verify-blob "${prefix}${target}/bin/kubectl-convert" \
45
+ --signature "/tmp/kubectl-convert.sig" \
46
+ --certificate "/tmp/kubectl-convert.cert" \
47
+ --certificate-oidc-issuer https://accounts.google.com \
48
+ --certificate-email krel-staging@k8s-releng-prod.iam.gserviceaccount.com
49
+ rm -f \
50
+ "/tmp/kubectl-convert.sig" \
51
+ "/tmp/kubectl-convert.cert"
52
+ fi
53
+
44
54
"${prefix}${target}/bin/kubectl" completion bash >"${prefix}${target}/share/bash-completion/completions/kubectl"
45
55
"${prefix}${target}/bin/kubectl" completion zsh >"${prefix}${target}/share/zsh/vendor-completions/_kubectl"
46
56
EOF
0 commit comments