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)