mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-25 06:24:59 +00:00
c-go: Use http Etag cache
Add a new command-line cachedir flag to specify where to store the http cache responses. This cache will only be used for OpenAPI Swagger spec for now (as this is the only end-point that returns an ETag). Kubernetes-commit: d7bba25d4a42f346f1963c86fc0dab43aa4f242e
This commit is contained in:
committed by
Kubernetes Publisher
parent
9d2814a37f
commit
d7f469601f
@@ -71,6 +71,10 @@ type Config struct {
|
||||
// TODO: demonstrate an OAuth2 compatible client.
|
||||
BearerToken string
|
||||
|
||||
// CacheDir is the directory where we'll store HTTP cached responses.
|
||||
// If set to empty string, no caching mechanism will be used.
|
||||
CacheDir string
|
||||
|
||||
// Impersonate is the configuration that RESTClient will use for impersonation.
|
||||
Impersonate ImpersonationConfig
|
||||
|
||||
|
@@ -249,6 +249,7 @@ func TestAnonymousConfig(t *testing.T) {
|
||||
expected.BearerToken = ""
|
||||
expected.Username = ""
|
||||
expected.Password = ""
|
||||
expected.CacheDir = ""
|
||||
expected.AuthProvider = nil
|
||||
expected.AuthConfigPersister = nil
|
||||
expected.TLSClientConfig.CertData = nil
|
||||
|
@@ -89,6 +89,7 @@ func (c *Config) TransportConfig() (*transport.Config, error) {
|
||||
},
|
||||
Username: c.Username,
|
||||
Password: c.Password,
|
||||
CacheDir: c.CacheDir,
|
||||
BearerToken: c.BearerToken,
|
||||
Impersonate: transport.ImpersonationConfig{
|
||||
UserName: c.Impersonate.UserName,
|
||||
|
Reference in New Issue
Block a user