Page MenuHomePhabricator

[tbs.buildpack-admission-service] throw error if unable to load ssl cert
Closed, ResolvedPublic

Description

Currently if there's no ssl certificate for the server, it starts up, shows an error message, and listens to the port,
but fails to handle any connections:

dcaro@vulcanus$ go run .
INFO[0000] &{0.0.0.0:8080 /etc/webhook/certs/cert.pem /etc/webhook/certs/key.pem [harbor.toolforge.org harbor.toolsbeta.wmflabs.org] [system:serviceaccount:tekton-pipelines:tekton-pipelines-controller] [paketobuildpacks/builder:base gcr.io/buildpacks/builder:v1 docker-registry.tools.wmflabs.org/toolforge-bullseye0-builder:latest] true nobuildid}
ERRO[0000] open /etc/webhook/certs/cert.pem: no such file or directory
# curl https://127.0.0.1:8080
2023/02/02 13:22:22 http: TLS handshake error from 127.0.0.1:43970: tls: certificate private key (<nil>) does not implement crypto.Signer

This task is to stop the execution instead with a return code of 1