From c4fe6496b5d99ff097fa393e2199a16b0cd8709a Mon Sep 17 00:00:00 2001 From: Matt Leung Date: Tue, 24 Apr 2018 15:26:12 -0700 Subject: [PATCH] fixup: catch err from parseduration --- plugins/secrets/vault/kubernetes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/secrets/vault/kubernetes.go b/plugins/secrets/vault/kubernetes.go index ca23021d8..be5d8ed04 100644 --- a/plugins/secrets/vault/kubernetes.go +++ b/plugins/secrets/vault/kubernetes.go @@ -43,5 +43,9 @@ func getKubernetesToken(addr, role, mountPoint, tokenFile string) (string, time. } ttl, err := time.ParseDuration(resp.Auth.Lease) + if err != nil { + return "", 0, err + } + return resp.Auth.Token, ttl, nil }