Commit 64bd0e45 authored by Chao Xu's avatar Chao Xu

Fix scope.Kind of CONNECT subresources.

Make scope.Kind of pod/attach, pod/exec, pod/portforward, node/proxy, service/proxy to their respective subresource Kind, instead of the parent Kind. The kind is used by the admission webhook controller to determine how to convert the object.
parent 355691d3
......@@ -45,9 +45,9 @@ var _ = rest.Connecter(&ProxyREST{})
var proxyMethods = []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}
// New returns an empty service resource
// New returns an empty nodeProxyOptions object.
func (r *ProxyREST) New() runtime.Object {
return &api.Node{}
return &api.NodeProxyOptions{}
}
// ConnectMethods returns the list of HTTP methods that can be proxied
......
......@@ -46,9 +46,9 @@ var _ = rest.Connecter(&ProxyREST{})
var proxyMethods = []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}
// New returns an empty pod resource
// New returns an empty podProxyOptions object.
func (r *ProxyREST) New() runtime.Object {
return &api.Pod{}
return &api.PodProxyOptions{}
}
// ConnectMethods returns the list of HTTP methods that can be proxied
......@@ -88,9 +88,9 @@ type AttachREST struct {
// Implement Connecter
var _ = rest.Connecter(&AttachREST{})
// New creates a new Pod object
// New creates a new podAttachOptions object.
func (r *AttachREST) New() runtime.Object {
return &api.Pod{}
return &api.PodAttachOptions{}
}
// Connect returns a handler for the pod exec proxy
......@@ -125,9 +125,9 @@ type ExecREST struct {
// Implement Connecter
var _ = rest.Connecter(&ExecREST{})
// New creates a new Pod object
// New creates a new podExecOptions object.
func (r *ExecREST) New() runtime.Object {
return &api.Pod{}
return &api.PodExecOptions{}
}
// Connect returns a handler for the pod exec proxy
......@@ -162,9 +162,9 @@ type PortForwardREST struct {
// Implement Connecter
var _ = rest.Connecter(&PortForwardREST{})
// New returns an empty pod object
// New returns an empty podPortForwardOptions object
func (r *PortForwardREST) New() runtime.Object {
return &api.Pod{}
return &api.PodPortForwardOptions{}
}
// NewConnectOptions returns the versioned object that represents the
......
......@@ -43,7 +43,7 @@ var proxyMethods = []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OP
// New returns an empty service resource
func (r *ProxyREST) New() runtime.Object {
return &api.Service{}
return &api.ServiceProxyOptions{}
}
// ConnectMethods returns the list of HTTP methods that can be proxied
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment