Ingress's plural

pull/6/head
Chao Xu 2016-01-20 17:21:48 -08:00
parent ee6f03f55a
commit 030043b5be
5 changed files with 50 additions and 49 deletions

View File

@ -57,6 +57,7 @@ func NameSystems() namer.NameSystems {
pluralExceptions := map[string]string{
"Endpoints": "Endpoints",
"ComponentStatus": "ComponentStatus",
"Ingress": "Ingress",
}
return namer.NameSystems{
"public": namer.NewPublicNamer(0),

View File

@ -26,7 +26,7 @@ type ExtensionsInterface interface {
DaemonSetsGetter
DeploymentsGetter
HorizontalPodAutoscalersGetter
IngressesGetter
IngressGetter
JobsGetter
ScalesGetter
ThirdPartyResourcesGetter
@ -49,8 +49,8 @@ func (c *ExtensionsClient) HorizontalPodAutoscalers(namespace string) Horizontal
return newHorizontalPodAutoscalers(c, namespace)
}
func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface {
return newIngresses(c, namespace)
func (c *ExtensionsClient) Ingress(namespace string) IngressInterface {
return newIngress(c, namespace)
}
func (c *ExtensionsClient) Jobs(namespace string) JobInterface {

View File

@ -37,8 +37,8 @@ func (c *FakeExtensions) HorizontalPodAutoscalers(namespace string) unversioned.
return &FakeHorizontalPodAutoscalers{c, namespace}
}
func (c *FakeExtensions) Ingresses(namespace string) unversioned.IngressInterface {
return &FakeIngresses{c, namespace}
func (c *FakeExtensions) Ingress(namespace string) unversioned.IngressInterface {
return &FakeIngress{c, namespace}
}
func (c *FakeExtensions) Jobs(namespace string) unversioned.JobInterface {

View File

@ -24,15 +24,15 @@ import (
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeIngresses implements IngressInterface
type FakeIngresses struct {
// FakeIngress implements IngressInterface
type FakeIngress struct {
Fake *FakeExtensions
ns string
}
func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
func (c *FakeIngress) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction("ingresses", c.ns, ingress), &extensions.Ingress{})
Invokes(core.NewCreateAction("ingress", c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -40,9 +40,9 @@ func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
func (c *FakeIngress) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction("ingresses", c.ns, ingress), &extensions.Ingress{})
Invokes(core.NewUpdateAction("ingress", c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -50,9 +50,9 @@ func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
func (c *FakeIngress) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction("ingresses", "status", c.ns, ingress), &extensions.Ingress{})
Invokes(core.NewUpdateSubresourceAction("ingress", "status", c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -60,23 +60,23 @@ func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.I
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) Delete(name string, options *api.DeleteOptions) error {
func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction("ingresses", c.ns, name), &extensions.Ingress{})
Invokes(core.NewDeleteAction("ingress", c.ns, name), &extensions.Ingress{})
return err
}
func (c *FakeIngresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *FakeIngress) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction("events", c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.IngressList{})
return err
}
func (c *FakeIngresses) Get(name string) (result *extensions.Ingress, err error) {
func (c *FakeIngress) Get(name string) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction("ingresses", c.ns, name), &extensions.Ingress{})
Invokes(core.NewGetAction("ingress", c.ns, name), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -84,9 +84,9 @@ func (c *FakeIngresses) Get(name string) (result *extensions.Ingress, err error)
return obj.(*extensions.Ingress), err
}
func (c *FakeIngresses) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
func (c *FakeIngress) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction("ingresses", c.ns, opts), &extensions.IngressList{})
Invokes(core.NewListAction("ingress", c.ns, opts), &extensions.IngressList{})
if obj == nil {
return nil, err
@ -105,9 +105,9 @@ func (c *FakeIngresses) List(opts api.ListOptions) (result *extensions.IngressLi
return list, err
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *FakeIngresses) Watch(opts api.ListOptions) (watch.Interface, error) {
// Watch returns a watch.Interface that watches the requested ingress.
func (c *FakeIngress) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction("ingresses", c.ns, opts))
InvokesWatch(core.NewWatchAction("ingress", c.ns, opts))
}

View File

@ -22,10 +22,10 @@ import (
watch "k8s.io/kubernetes/pkg/watch"
)
// IngressesGetter has a method to return a IngressInterface.
// IngressGetter has a method to return a IngressInterface.
// A group's client should implement this interface.
type IngressesGetter interface {
Ingresses(namespace string) IngressInterface
type IngressGetter interface {
Ingress(namespace string) IngressInterface
}
// IngressInterface has methods to work with Ingress resources.
@ -41,26 +41,26 @@ type IngressInterface interface {
IngressExpansion
}
// ingresses implements IngressInterface
type ingresses struct {
// ingress implements IngressInterface
type ingress struct {
client *ExtensionsClient
ns string
}
// newIngresses returns a Ingresses
func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
return &ingresses{
// newIngress returns a Ingress
func newIngress(c *ExtensionsClient, namespace string) *ingress {
return &ingress{
client: c,
ns: namespace,
}
}
// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any.
func (c *ingresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
func (c *ingress) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &extensions.Ingress{}
err = c.client.Post().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
Body(ingress).
Do().
Into(result)
@ -68,11 +68,11 @@ func (c *ingresses) Create(ingress *extensions.Ingress) (result *extensions.Ingr
}
// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any.
func (c *ingresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
func (c *ingress) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &extensions.Ingress{}
err = c.client.Put().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
Name(ingress.Name).
Body(ingress).
Do().
@ -80,11 +80,11 @@ func (c *ingresses) Update(ingress *extensions.Ingress) (result *extensions.Ingr
return
}
func (c *ingresses) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
func (c *ingress) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &extensions.Ingress{}
err = c.client.Put().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
Name(ingress.Name).
SubResource("status").
Body(ingress).
@ -94,10 +94,10 @@ func (c *ingresses) UpdateStatus(ingress *extensions.Ingress) (result *extension
}
// Delete takes name of the ingress and deletes it. Returns an error if one occurs.
func (c *ingresses) Delete(name string, options *api.DeleteOptions) error {
func (c *ingress) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
Name(name).
Body(options).
Do().
@ -105,10 +105,10 @@ func (c *ingresses) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *ingresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *ingress) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
VersionedParams(&listOptions, api.Scheme).
Body(options).
Do().
@ -116,35 +116,35 @@ func (c *ingresses) DeleteCollection(options *api.DeleteOptions, listOptions api
}
// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any.
func (c *ingresses) Get(name string) (result *extensions.Ingress, err error) {
func (c *ingress) Get(name string) (result *extensions.Ingress, err error) {
result = &extensions.Ingress{}
err = c.client.Get().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
Name(name).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
func (c *ingresses) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
// List takes label and field selectors, and returns the list of Ingress that match those selectors.
func (c *ingress) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
result = &extensions.IngressList{}
err = c.client.Get().
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
VersionedParams(&opts, api.Scheme).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *ingresses) Watch(opts api.ListOptions) (watch.Interface, error) {
// Watch returns a watch.Interface that watches the requested ingress.
func (c *ingress) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("ingresses").
Resource("ingress").
VersionedParams(&opts, api.Scheme).
Watch()
}