Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c1bf6e83
Commit
c1bf6e83
authored
May 23, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apiserver: move LongRunningRequestCheck type into endpoints/request
parent
3bfae793
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
requestcontext.go
.../k8s.io/apiserver/pkg/endpoints/request/requestcontext.go
+3
-0
config.go
staging/src/k8s.io/apiserver/pkg/server/config.go
+1
-1
longrunning.go
...ng/src/k8s.io/apiserver/pkg/server/filters/longrunning.go
+1
-4
maxinflight.go
...ng/src/k8s.io/apiserver/pkg/server/filters/maxinflight.go
+1
-1
timeout.go
staging/src/k8s.io/apiserver/pkg/server/filters/timeout.go
+1
-1
No files found.
staging/src/k8s.io/apiserver/pkg/endpoints/request/requestcontext.go
View file @
c1bf6e83
...
...
@@ -24,6 +24,9 @@ import (
"github.com/golang/glog"
)
// LongRunningRequestCheck is a predicate which is true for long-running http requests.
type
LongRunningRequestCheck
func
(
r
*
http
.
Request
,
requestInfo
*
RequestInfo
)
bool
// RequestContextMapper keeps track of the context associated with a particular request
type
RequestContextMapper
interface
{
// Get returns the context associated with the given request (if any), and true if the request has an associated context, and false if it does not.
...
...
staging/src/k8s.io/apiserver/pkg/server/config.go
View file @
c1bf6e83
...
...
@@ -150,7 +150,7 @@ type Config struct {
// request has to wait.
MaxMutatingRequestsInFlight
int
// Predicate which is true for paths of long-running http requests
LongRunningFunc
genericfilters
.
LongRunningRequestCheck
LongRunningFunc
apirequest
.
LongRunningRequestCheck
//===========================================================================
// values below here are targets for removal
...
...
staging/src/k8s.io/apiserver/pkg/server/filters/longrunning.go
View file @
c1bf6e83
...
...
@@ -23,11 +23,8 @@ import (
apirequest
"k8s.io/apiserver/pkg/endpoints/request"
)
// LongRunningRequestCheck is a predicate which is true for long-running http requests.
type
LongRunningRequestCheck
func
(
r
*
http
.
Request
,
requestInfo
*
apirequest
.
RequestInfo
)
bool
// BasicLongRunningRequestCheck returns true if the given request has one of the specified verbs or one of the specified subresources
func
BasicLongRunningRequestCheck
(
longRunningVerbs
,
longRunningSubresources
sets
.
String
)
LongRunningRequestCheck
{
func
BasicLongRunningRequestCheck
(
longRunningVerbs
,
longRunningSubresources
sets
.
String
)
apirequest
.
LongRunningRequestCheck
{
return
func
(
r
*
http
.
Request
,
requestInfo
*
apirequest
.
RequestInfo
)
bool
{
if
longRunningVerbs
.
Has
(
requestInfo
.
Verb
)
{
return
true
...
...
staging/src/k8s.io/apiserver/pkg/server/filters/maxinflight.go
View file @
c1bf6e83
...
...
@@ -47,7 +47,7 @@ func WithMaxInFlightLimit(
nonMutatingLimit
int
,
mutatingLimit
int
,
requestContextMapper
genericapirequest
.
RequestContextMapper
,
longRunningRequestCheck
LongRunningRequestCheck
,
longRunningRequestCheck
apirequest
.
LongRunningRequestCheck
,
)
http
.
Handler
{
if
nonMutatingLimit
==
0
&&
mutatingLimit
==
0
{
return
handler
...
...
staging/src/k8s.io/apiserver/pkg/server/filters/timeout.go
View file @
c1bf6e83
...
...
@@ -35,7 +35,7 @@ const globalTimeout = time.Minute
var
errConnKilled
=
fmt
.
Errorf
(
"kill connection/stream"
)
// WithTimeoutForNonLongRunningRequests times out non-long-running requests after the time given by globalTimeout.
func
WithTimeoutForNonLongRunningRequests
(
handler
http
.
Handler
,
requestContextMapper
apirequest
.
RequestContextMapper
,
longRunning
LongRunningRequestCheck
)
http
.
Handler
{
func
WithTimeoutForNonLongRunningRequests
(
handler
http
.
Handler
,
requestContextMapper
apirequest
.
RequestContextMapper
,
longRunning
apirequest
.
LongRunningRequestCheck
)
http
.
Handler
{
if
longRunning
==
nil
{
return
handler
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment