From 48658ad94d303143d6f2013213c47c45669cd1a7 Mon Sep 17 00:00:00 2001 From: nikhiljindal Date: Wed, 29 Jun 2016 15:07:38 -0700 Subject: [PATCH] Adding namespace expansion files --- .../fake/fake_namespace_expansion.go | 37 +++++++++++++++++++ .../core/unversioned/namespace_expansion.go | 31 ++++++++++++++++ .../core/v1/fake/fake_namespace_expansion.go | 37 +++++++++++++++++++ .../typed/core/v1/namespace_expansion.go | 31 ++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/fake/fake_namespace_expansion.go create mode 100644 federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/namespace_expansion.go create mode 100644 federation/client/clientset_generated/federation_release_1_4/typed/core/v1/fake/fake_namespace_expansion.go create mode 100644 federation/client/clientset_generated/federation_release_1_4/typed/core/v1/namespace_expansion.go diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/fake/fake_namespace_expansion.go b/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/fake/fake_namespace_expansion.go new file mode 100644 index 00000000000..619021772f4 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/fake/fake_namespace_expansion.go @@ -0,0 +1,37 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/client/testing/core" +) + +func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error) { + action := core.CreateActionImpl{} + action.Verb = "create" + action.Resource = namespacesResource + action.Subresource = "finalize" + action.Object = namespace + + obj, err := c.Fake.Invokes(action, namespace) + if obj == nil { + return nil, err + } + + return obj.(*api.Namespace), err +} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/namespace_expansion.go b/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/namespace_expansion.go new file mode 100644 index 00000000000..15049da11fa --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/core/unversioned/namespace_expansion.go @@ -0,0 +1,31 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +import "k8s.io/kubernetes/pkg/api" + +// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. +type NamespaceExpansion interface { + Finalize(item *api.Namespace) (*api.Namespace, error) +} + +// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. +func (c *namespaces) Finalize(namespace *api.Namespace) (result *api.Namespace, err error) { + result = &api.Namespace{} + err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result) + return +} diff --git a/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/fake/fake_namespace_expansion.go b/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/fake/fake_namespace_expansion.go new file mode 100644 index 00000000000..a9e98f50aea --- /dev/null +++ b/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/fake/fake_namespace_expansion.go @@ -0,0 +1,37 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "k8s.io/kubernetes/pkg/api/v1" + "k8s.io/kubernetes/pkg/client/testing/core" +) + +func (c *FakeNamespaces) Finalize(namespace *v1.Namespace) (*v1.Namespace, error) { + action := core.CreateActionImpl{} + action.Verb = "create" + action.Resource = namespacesResource + action.Subresource = "finalize" + action.Object = namespace + + obj, err := c.Fake.Invokes(action, namespace) + if obj == nil { + return nil, err + } + + return obj.(*v1.Namespace), err +} diff --git a/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/namespace_expansion.go b/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/namespace_expansion.go new file mode 100644 index 00000000000..36de2beeaa5 --- /dev/null +++ b/federation/client/clientset_generated/federation_release_1_4/typed/core/v1/namespace_expansion.go @@ -0,0 +1,31 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import "k8s.io/kubernetes/pkg/api/v1" + +// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. +type NamespaceExpansion interface { + Finalize(item *v1.Namespace) (*v1.Namespace, error) +} + +// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. +func (c *namespaces) Finalize(namespace *v1.Namespace) (result *v1.Namespace, err error) { + result = &v1.Namespace{} + err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result) + return +}