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.
pull/8/head
Chao Xu 2018-07-30 19:19:21 -07:00
parent 355691d310
commit 64bd0e4589
3 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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