diff --git a/storage/kubernetes/client_test.go b/storage/kubernetes/client_test.go index 77fe8d48..5fee5774 100644 --- a/storage/kubernetes/client_test.go +++ b/storage/kubernetes/client_test.go @@ -3,8 +3,18 @@ package kubernetes import ( "hash" "hash/fnv" + "io/ioutil" + "net/http" + "os" + "path/filepath" "sync" "testing" + "time" + + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + + "github.com/dexidp/dex/storage/kubernetes/k8sapi" ) // This test does not have an explicit error condition but is used diff --git a/storage/kubernetes/transport.go b/storage/kubernetes/transport.go index 084d15db..984184c7 100644 --- a/storage/kubernetes/transport.go +++ b/storage/kubernetes/transport.go @@ -82,13 +82,15 @@ type inClusterTransportHelper struct { } func newInClusterTransportHelper(info k8sapi.AuthInfo) *inClusterTransportHelper { - user := inClusterTransportHelper{ + user := &inClusterTransportHelper{ info: info, now: time.Now, tokenLocation: "/var/run/secrets/kubernetes.io/serviceaccount/token", } + user.UpdateToken() - return &user + + return user } func (c *inClusterTransportHelper) UpdateToken() {