added short names for resources which are exposed during discovery

This commit is contained in:
p0lyn0mial
2017-02-05 17:44:53 +01:00
parent d4bcf3ede5
commit b2cce0ac8e
50 changed files with 372 additions and 1 deletions

View File

@@ -140,3 +140,8 @@ var _ = rest.Redirector(&REST{})
func (r *REST) ResourceLocation(ctx genericapirequest.Context, id string) (*url.URL, http.RoundTripper, error) {
return node.ResourceLocation(r, r.connection, r.proxyTransport, ctx, id)
}
// ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.
func (r *REST) ShortNames() []string {
return []string{"no"}
}

View File

@@ -150,3 +150,11 @@ func TestWatch(t *testing.T) {
},
)
}
func TestShortNames(t *testing.T) {
storage, server := newStorage(t)
defer server.Terminate(t)
defer storage.Store.DestroyFunc()
expected := []string{"no"}
registrytest.AssertShortNames(t, storage, expected)
}