Merge pull request #72437 from liggitt/shorten-token-re-read

Shorten re-read period for token files to work with ProjectedTokenVolumeSource

Kubernetes-commit: de4e1ce401e7787f51ead201ea8a66a89421cc3a
This commit is contained in:
Kubernetes Publisher 2019-01-07 15:25:10 -08:00
commit f97fdd8c9d
2 changed files with 57 additions and 57 deletions

102
Godeps/Godeps.json generated
View File

@ -408,207 +408,207 @@
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/fuzzer",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/apitesting/roundtrip",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/naming",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "0cd393178e09f379032a493f73993dc600e1959d"
"Rev": "849b284f3b756a3fbb5084b09d2718dd41373068"
},
{
"ImportPath": "k8s.io/klog",

View File

@ -47,14 +47,14 @@ func TokenSourceWrapTransport(ts oauth2.TokenSource) func(http.RoundTripper) htt
func NewCachedFileTokenSource(path string) oauth2.TokenSource {
return &cachingTokenSource{
now: time.Now,
leeway: 1 * time.Minute,
leeway: 10 * time.Second,
base: &fileTokenSource{
path: path,
// This period was picked because it is half of the minimum validity
// duration for a token provisioned by they TokenRequest API. This is
// unsophisticated and should induce rotation at a frequency that should
// work with the token volume source.
period: 5 * time.Minute,
// This period was picked because it is half of the duration between when the kubelet
// refreshes a projected service account token and when the original token expires.
// Default token lifetime is 10 minutes, and the kubelet starts refreshing at 80% of lifetime.
// This should induce re-reading at a frequency that works with the token volume source.
period: time.Minute,
},
}
}