From 1bd660c370aca1113ae0b4fa2e814e9ea337e4d7 Mon Sep 17 00:00:00 2001 From: zryfish Date: Thu, 14 May 2020 13:22:30 +0800 Subject: [PATCH] fix proxy bug (#2070) --- pkg/kapis/generic/generic.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/kapis/generic/generic.go b/pkg/kapis/generic/generic.go index 9a9bf211..2ea52059 100644 --- a/pkg/kapis/generic/generic.go +++ b/pkg/kapis/generic/generic.go @@ -41,6 +41,8 @@ func NewGenericProxy(endpoint string, groupName string, version string) (*generi }, nil } +// currently, we only support proxy GET/PUT/POST/DELETE/PATCH. +// Maybe we can try another way to implement proxy. func (g *genericProxy) AddToContainer(container *restful.Container) error { webservice := runtime.NewWebService(schema.GroupVersion{ Group: g.GroupName, @@ -63,6 +65,10 @@ func (g *genericProxy) AddToContainer(container *restful.Container) error { To(g.handler). Returns(http.StatusOK, api.StatusOK, nil)) + webservice.Route(webservice.PATCH("/{path:*}"). + To(g.handler). + Returns(http.StatusOK, api.StatusOK, nil)) + container.Add(webservice) return nil -- GitLab