mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 01:08:55 +00:00
Add support for fields.
This commit is contained in:
@@ -63,7 +63,14 @@ func (s *ProxyServer) doError(w http.ResponseWriter, err error) {
|
||||
func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
url := r.URL
|
||||
selector := url.Query().Get("labels")
|
||||
result := s.Client.Verb(r.Method).AbsPath(r.URL.Path).ParseSelectorParam("labels", selector).Body(r.Body).Do()
|
||||
fieldSelector := url.Query().Get("fields")
|
||||
result := s.Client.
|
||||
Verb(r.Method).
|
||||
AbsPath(r.URL.Path).
|
||||
ParseSelectorParam("labels", selector).
|
||||
ParseSelectorParam("fields", fieldSelector).
|
||||
Body(r.Body).
|
||||
Do()
|
||||
if result.Error() != nil {
|
||||
s.doError(w, result.Error())
|
||||
return
|
||||
|
Reference in New Issue
Block a user