From 28b08ef46b76e0f8e2c7fe6eb5ec53a6c094eedb Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Wed, 11 Dec 2019 16:26:53 -0800 Subject: [PATCH] Fail silently if the identity fails. --- ca/client.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ca/client.go b/ca/client.go index 66e97275..95b383e5 100644 --- a/ca/client.go +++ b/ca/client.go @@ -119,20 +119,21 @@ func (o *clientOptions) applyDefaultIdentity() error { return nil } + // Do not load an identity if something fails b, err := ioutil.ReadFile(IdentityFile) if err != nil { return nil } var identity Identity if err := json.Unmarshal(b, &identity); err != nil { - return errors.Wrapf(err, "error unmarshaling %s", IdentityFile) + return nil } if err := identity.Validate(); err != nil { - return err + return nil } opts, err := identity.Options() if err != nil { - return err + return nil } for _, fn := range opts { if err := fn(o); err != nil {