Пример #1
0
	"k8s.io/kubernetes/pkg/capabilities"
	genericregistry "k8s.io/kubernetes/pkg/genericapiserver/registry/generic/registry"
	genericrest "k8s.io/kubernetes/pkg/genericapiserver/registry/generic/rest"
	"k8s.io/kubernetes/pkg/genericapiserver/registry/rest"
	"k8s.io/kubernetes/pkg/kubelet/client"
	"k8s.io/kubernetes/pkg/registry/core/pod"
)

// ProxyREST implements the proxy subresource for a Pod
type ProxyREST struct {
	Store          *genericregistry.Store
	ProxyTransport http.RoundTripper
}

// Implement Connecter
var _ = rest.Connecter(&ProxyREST{})

var proxyMethods = []string{"GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS"}

// New returns an empty pod resource
func (r *ProxyREST) New() runtime.Object {
	return &api.Pod{}
}

// ConnectMethods returns the list of HTTP methods that can be proxied
func (r *ProxyREST) ConnectMethods() []string {
	return proxyMethods
}

// NewConnectOptions returns versioned resource that represents proxy parameters
func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string) {
Пример #2
0
	genericregistry "k8s.io/kubernetes/pkg/genericapiserver/registry/generic/registry"
	genericrest "k8s.io/kubernetes/pkg/genericapiserver/registry/generic/rest"
	"k8s.io/kubernetes/pkg/genericapiserver/registry/rest"
	"k8s.io/kubernetes/pkg/kubelet/client"
	"k8s.io/kubernetes/pkg/registry/core/node"
)

// ProxyREST implements the proxy subresource for a Node
type ProxyREST struct {
	Store          *genericregistry.Store
	Connection     client.ConnectionInfoGetter
	ProxyTransport http.RoundTripper
}

// Implement Connecter
var _ = rest.Connecter(&ProxyREST{})

var proxyMethods = []string{"GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS"}

// New returns an empty service resource
func (r *ProxyREST) New() runtime.Object {
	return &api.Node{}
}

// ConnectMethods returns the list of HTTP methods that can be proxied
func (r *ProxyREST) ConnectMethods() []string {
	return proxyMethods
}

// NewConnectOptions returns versioned resource that represents proxy parameters
func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string) {