File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,15 @@ import (
19
19
"github.com/oam-dev/cluster-gateway/pkg/metrics"
20
20
"github.com/oam-dev/cluster-gateway/pkg/options"
21
21
"github.com/oam-dev/cluster-gateway/pkg/util/singleton"
22
+ "k8s.io/apimachinery/pkg/util/sets"
23
+ "k8s.io/apiserver/pkg/endpoints/request"
24
+ "k8s.io/apiserver/pkg/server"
22
25
"k8s.io/klog/v2"
26
+ "net/http"
23
27
"sigs.k8s.io/apiserver-runtime/pkg/builder"
24
28
// +kubebuilder:scaffold:resource-imports
25
29
clusterv1alpha1 "github.com/oam-dev/cluster-gateway/pkg/apis/cluster/v1alpha1"
30
+ genericfilters "k8s.io/apiserver/pkg/server/filters"
26
31
27
32
_ "github.com/oam-dev/cluster-gateway/pkg/featuregates"
28
33
)
@@ -39,6 +44,15 @@ func main() {
39
44
ExposeLoopbackMasterClientConfig ().
40
45
ExposeLoopbackAuthorizer ().
41
46
WithoutEtcd ().
47
+ WithConfigFns (func (config * server.RecommendedConfig ) * server.RecommendedConfig {
48
+ config .LongRunningFunc = func (r * http.Request , requestInfo * request.RequestInfo ) bool {
49
+ if requestInfo .Resource == "clustergateways" && requestInfo .Subresource == "proxy" {
50
+ return true
51
+ }
52
+ return genericfilters .BasicLongRunningRequestCheck (sets .NewString ("watch" ), sets .NewString ())(r , requestInfo )
53
+ }
54
+ return config
55
+ }).
42
56
WithOptionsFns (func (options * builder.ServerOptions ) * builder.ServerOptions {
43
57
if err := config .ValidateSecret (); err != nil {
44
58
klog .Fatal (err )
You can’t perform that action at this time.
0 commit comments