Commit d0626295 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #46977 from php-coder/improve_cert_controller_logging

Automatic merge from submit-queue newCFSSLSigner: improve error reporting by including file name in the message **What this PR does / why we need it**: This PR improves error reporting by including an action and a file name into the error message. Before: >E0605 17:01:57.020485 29156 certificates.go:38] Failed to start certificate controller: open : no such file or directory After: >E0605 18:21:32.375884 4896 certificates.go:38] Failed to start certificate controller: error reading CA file "": open : no such file or directory **Release note**: ```release-note NONE ``` CC @mfojtik
parents f89d2493 418cf371
......@@ -64,16 +64,16 @@ type cfsslSigner struct {
func newCFSSLSigner(caFile, caKeyFile string, client clientset.Interface, certificateDuration time.Duration) (*cfsslSigner, error) {
ca, err := ioutil.ReadFile(caFile)
if err != nil {
return nil, err
return nil, fmt.Errorf("error reading CA cert file %q: %v", caFile, err)
}
cakey, err := ioutil.ReadFile(caKeyFile)
if err != nil {
return nil, err
return nil, fmt.Errorf("error reading CA key file %q: %v", caKeyFile, err)
}
parsedCa, err := helpers.ParseCertificatePEM(ca)
if err != nil {
return nil, err
return nil, fmt.Errorf("error parsing CA cert file %q: %v", caFile, err)
}
strPassword := os.Getenv("CFSSL_CA_PK_PASSWORD")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment