DelegatingAuthorizationOptions: exposes and sets a default timeout for SubjectAccessReview client

previously no timeout was set. Requests without explicit timeout might potentially hang forever and lead to starvation of the application.
This commit is contained in:
Lukasz Szaszkiewicz
2020-10-20 14:39:45 +02:00
parent a285e3f7cd
commit 2160cbc53f
3 changed files with 14 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ func TestDefaultFlags(t *testing.T) {
Authorization: &apiserveroptions.DelegatingAuthorizationOptions{
AllowCacheTTL: 10 * time.Second,
DenyCacheTTL: 10 * time.Second,
ClientTimeout: 10 * time.Second,
RemoteKubeConfigFileOptional: true,
AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or
},
@@ -248,6 +249,7 @@ func TestAddFlags(t *testing.T) {
Authorization: &apiserveroptions.DelegatingAuthorizationOptions{
AllowCacheTTL: 10 * time.Second,
DenyCacheTTL: 10 * time.Second,
ClientTimeout: 10 * time.Second,
RemoteKubeConfigFileOptional: true,
AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or
},