From 1defd007af325782363c7bf4449019192b443136 Mon Sep 17 00:00:00 2001 From: Sebastian Hasler Date: Tue, 6 Dec 2022 18:14:01 +0100 Subject: [PATCH] fix certificate generation in webhook example After bb957259da3b the script was broken. This commit fixes this by respecting the format of TLS-type secrets in the script, too. --- deploy/kubernetes/webhook-example/create-cert.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/kubernetes/webhook-example/create-cert.sh b/deploy/kubernetes/webhook-example/create-cert.sh index 5ec0db24..4cafaf1f 100755 --- a/deploy/kubernetes/webhook-example/create-cert.sh +++ b/deploy/kubernetes/webhook-example/create-cert.sh @@ -120,8 +120,8 @@ echo ${serverCert} | openssl base64 -d -A -out ${tmpdir}/server-cert.pem # create the secret with CA cert and server cert/key -kubectl create secret generic ${secret} \ - --from-file=key.pem=${tmpdir}/server-key.pem \ - --from-file=cert.pem=${tmpdir}/server-cert.pem \ +kubectl create secret tls ${secret} \ + --key=${tmpdir}/server-key.pem \ + --cert=${tmpdir}/server-cert.pem \ --dry-run=client -o yaml | kubectl -n ${namespace} apply -f -