Support subpath on GET for GetterWithOptions

Allows REST consumers to build paths like:

    /api/v1beta3/namespaces/foo/webhookresource/<name>/<encodedsecretinurl>

Also fixes parameter exposure for subresources (was only fixed for
v1beta3).
This commit is contained in:
Clayton Coleman
2015-04-11 11:13:10 -04:00
parent 7ac4a22f18
commit 0225d76b6a
5 changed files with 124 additions and 39 deletions

View File

@@ -110,6 +110,8 @@ func (r *BindingREST) New() runtime.Object {
return &api.Binding{}
}
var _ = rest.Creater(&BindingREST{})
// Create ensures a pod is bound to a specific host.
func (r *BindingREST) Create(ctx api.Context, obj runtime.Object) (out runtime.Object, err error) {
binding := obj.(*api.Binding)
@@ -197,6 +199,9 @@ type LogREST struct {
kubeletConn client.ConnectionInfoGetter
}
// LogREST implements GetterWithOptions
var _ = rest.GetterWithOptions(&LogREST{})
// New creates a new Pod log options object
func (r *LogREST) New() runtime.Object {
return &api.PodLogOptions{}
@@ -221,6 +226,6 @@ func (r *LogREST) Get(ctx api.Context, name string, opts runtime.Object) (runtim
}
// NewGetOptions creates a new options object
func (r *LogREST) NewGetOptions() runtime.Object {
return &api.PodLogOptions{}
func (r *LogREST) NewGetOptions() (runtime.Object, bool, string) {
return &api.PodLogOptions{}, false, ""
}