Skip to content

Commit

Permalink
server/config: override BasicLongRunningRequestCheck to add tunnel su…
Browse files Browse the repository at this point in the history
…bresource
  • Loading branch information
jmprusi committed Mar 14, 2023
1 parent c7108fa commit 000d703
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"k8s.io/apiserver/pkg/informerfactoryhack"
"k8s.io/apiserver/pkg/quota/v1/generic"
genericapiserver "k8s.io/apiserver/pkg/server"
genericfilters "k8s.io/apiserver/pkg/server/filters"
serverstorage "k8s.io/apiserver/pkg/server/storage"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
Expand Down Expand Up @@ -360,6 +361,13 @@ func NewConfig(opts kcpserveroptions.CompletedOptions) (*Config, error) {
// Make sure to set our RequestInfoResolver that is capable of populating a RequestInfo even for /services/... URLs.
c.GenericConfig.RequestInfoResolver = requestinfo.NewKCPRequestInfoResolver()

if kcpfeatures.DefaultFeatureGate.Enabled(kcpfeatures.SyncerTunnel) {
c.GenericConfig.LongRunningFunc = genericfilters.BasicLongRunningRequestCheck(
sets.NewString("watch", "proxy"),
sets.NewString("attach", "exec", "proxy", "log", "portforward", "tunnel"),
)
}

// preHandlerChainMux is called before the actual handler chain. Note that BuildHandlerChainFunc below
// is called multiple times, but only one of the handler chain will actually be used. Hence, we wrap it
// to give handlers below one mux.Handle func to call.
Expand Down

0 comments on commit 000d703

Please sign in to comment.