From d90294e8f95a58ca8d9aa2adba282fbe6641d8aa Mon Sep 17 00:00:00 2001 From: Wang Guoliang Date: Sun, 11 Feb 2018 21:17:00 +0800 Subject: [PATCH] should use time.Since instead of time.Now().Sub Kubernetes-commit: 89669283fe84619f0c15af8495ccb28a752bb1e8 --- plugin/pkg/client/auth/openstack/openstack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pkg/client/auth/openstack/openstack.go b/plugin/pkg/client/auth/openstack/openstack.go index 7f524a64..3c1c896a 100644 --- a/plugin/pkg/client/auth/openstack/openstack.go +++ b/plugin/pkg/client/auth/openstack/openstack.go @@ -95,7 +95,7 @@ func (c *cachedGetter) Token() (string, error) { var err error // no token or exceeds the TTL - if c.token == "" || time.Now().Sub(c.born) > c.ttl { + if c.token == "" || time.Since(c.born) > c.ttl { c.token, err = c.tokenGetter.Token() if err != nil { return "", fmt.Errorf("failed to get token: %s", err)