From 073241e341cc772673fbf0a13a0caa00bd38e6e9 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Date: Fri, 22 Sep 2017 15:21:16 -0500 Subject: [PATCH] Add more descriptive logging in certificate loading Currently a log "secret %v has no private key" is provided for cert and "secret %v has no cert" is provided for key. They are in the wrong place. This PR corrects the ordering and adds a description as to what is actually missing. --- controllers/gce/controller/tls.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/gce/controller/tls.go b/controllers/gce/controller/tls.go index a44f16405..771b785cf 100644 --- a/controllers/gce/controller/tls.go +++ b/controllers/gce/controller/tls.go @@ -66,11 +66,11 @@ func (t *apiServerTLSLoader) load(ing *extensions.Ingress) (*loadbalancers.TLSCe } cert, ok := secret.Data[api_v1.TLSCertKey] if !ok { - return nil, fmt.Errorf("secret %v has no private key", secretName) + return nil, fmt.Errorf("secret %v has no 'tls.crt'", secretName) } key, ok := secret.Data[api_v1.TLSPrivateKeyKey] if !ok { - return nil, fmt.Errorf("secret %v has no cert", secretName) + return nil, fmt.Errorf("secret %v has no 'tls.key'", secretName) } certs := &loadbalancers.TLSCerts{Key: string(key), Cert: string(cert)} if err := t.validate(certs); err != nil {