提交 392f7549 编写于 作者: D dlorenc 提交者: GitHub

Merge pull request #382 from jimmidyson/kube-1.3.2

Upgrade to Kubernetes 1.3.2
此差异已折叠。
......@@ -238,10 +238,13 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
if err != nil {
glog.Warningf("Unsuccessful parsing of service CIDR %v: %v", s.ServiceCIDR, err)
}
nodeController := nodecontroller.NewNodeController(cloud, clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "node-controller")),
nodeController, err := nodecontroller.NewNodeController(cloud, clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "node-controller")),
s.PodEvictionTimeout.Duration, flowcontrol.NewTokenBucketRateLimiter(s.DeletingPodsQps, int(s.DeletingPodsBurst)),
flowcontrol.NewTokenBucketRateLimiter(s.DeletingPodsQps, int(s.DeletingPodsBurst)),
s.NodeMonitorGracePeriod.Duration, s.NodeStartupGracePeriod.Duration, s.NodeMonitorPeriod.Duration, clusterCIDR, serviceCIDR, int(s.NodeCIDRMaskSize), s.AllocateNodeCIDRs)
if err != nil {
glog.Fatalf("Failed to initialize nodecontroller: %v", err)
}
nodeController.Run(s.NodeSyncPeriod.Duration)
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
......
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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/apimachinery/registered"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned"
fakeunversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/fake"
unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
fakeunversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned/fake"
unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned"
fakeunversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned/fake"
unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned"
fakeunversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned/fake"
unversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned"
fakeunversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned/fake"
"k8s.io/kubernetes/pkg/client/testing/core"
"k8s.io/kubernetes/pkg/client/typed/discovery"
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/watch"
)
// Clientset returns a clientset that will respond with the provided objects
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjects(api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, registered.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return &fakediscovery.FakeDiscovery{Fake: &c.Fake}
}
var _ clientset.Interface = &Clientset{}
// Core retrieves the CoreClient
func (c *Clientset) Core() unversionedcore.CoreInterface {
return &fakeunversionedcore.FakeCore{Fake: &c.Fake}
}
// Extensions retrieves the ExtensionsClient
func (c *Clientset) Extensions() unversionedextensions.ExtensionsInterface {
return &fakeunversionedextensions.FakeExtensions{Fake: &c.Fake}
}
// Autoscaling retrieves the AutoscalingClient
func (c *Clientset) Autoscaling() unversionedautoscaling.AutoscalingInterface {
return &fakeunversionedautoscaling.FakeAutoscaling{Fake: &c.Fake}
}
// Batch retrieves the BatchClient
func (c *Clientset) Batch() unversionedbatch.BatchInterface {
return &fakeunversionedbatch.FakeBatch{Fake: &c.Fake}
}
// Rbac retrieves the RbacClient
func (c *Clientset) Rbac() unversionedrbac.RbacInterface {
return &fakeunversionedrbac.FakeRbac{Fake: &c.Fake}
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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.
*/
// This package is generated by client-gen with the default arguments.
// This package has the automatically generated fake clientset.
package fake
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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.
*/
// This package is generated by client-gen with the default arguments.
// Package fake has the automatically generated clients.
package fake
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned"
restclient "k8s.io/kubernetes/pkg/client/restclient"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAutoscaling struct {
*core.Fake
}
func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) unversioned.HorizontalPodAutoscalerInterface {
return &FakeHorizontalPodAutoscalers{c, namespace}
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAutoscaling) GetRESTClient() *restclient.RESTClient {
return nil
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
type FakeHorizontalPodAutoscalers struct {
Fake *FakeAutoscaling
ns string
}
var horizontalpodautoscalersResource = unversioned.GroupVersionResource{Group: "autoscaling", Version: "", Resource: "horizontalpodautoscalers"}
func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
return err
}
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &autoscaling.HorizontalPodAutoscalerList{})
return err
}
func (c *FakeHorizontalPodAutoscalers) Get(name string) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) List(opts api.ListOptions) (result *autoscaling.HorizontalPodAutoscalerList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &autoscaling.HorizontalPodAutoscalerList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &autoscaling.HorizontalPodAutoscalerList{}
for _, item := range obj.(*autoscaling.HorizontalPodAutoscalerList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *FakeHorizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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.
*/
// This package is generated by client-gen with the default arguments.
// Package fake has the automatically generated clients.
package fake
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
restclient "k8s.io/kubernetes/pkg/client/restclient"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeBatch struct {
*core.Fake
}
func (c *FakeBatch) Jobs(namespace string) unversioned.JobInterface {
return &FakeJobs{c, namespace}
}
func (c *FakeBatch) ScheduledJobs(namespace string) unversioned.ScheduledJobInterface {
return &FakeScheduledJobs{c, namespace}
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeBatch) GetRESTClient() *restclient.RESTClient {
return nil
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
batch "k8s.io/kubernetes/pkg/apis/batch"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeJobs implements JobInterface
type FakeJobs struct {
Fake *FakeBatch
ns string
}
var jobsResource = unversioned.GroupVersionResource{Group: "batch", Version: "", Resource: "jobs"}
func (c *FakeJobs) Create(job *batch.Job) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(jobsResource, c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
}
return obj.(*batch.Job), err
}
func (c *FakeJobs) Update(job *batch.Job) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(jobsResource, c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
}
return obj.(*batch.Job), err
}
func (c *FakeJobs) UpdateStatus(job *batch.Job) (*batch.Job, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
}
return obj.(*batch.Job), err
}
func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(jobsResource, c.ns, name), &batch.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &batch.JobList{})
return err
}
func (c *FakeJobs) Get(name string) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(jobsResource, c.ns, name), &batch.Job{})
if obj == nil {
return nil, err
}
return obj.(*batch.Job), err
}
func (c *FakeJobs) List(opts api.ListOptions) (result *batch.JobList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(jobsResource, c.ns, opts), &batch.JobList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &batch.JobList{}
for _, item := range obj.(*batch.JobList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(jobsResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
batch "k8s.io/kubernetes/pkg/apis/batch"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeScheduledJobs implements ScheduledJobInterface
type FakeScheduledJobs struct {
Fake *FakeBatch
ns string
}
var scheduledjobsResource = unversioned.GroupVersionResource{Group: "batch", Version: "", Resource: "scheduledjobs"}
func (c *FakeScheduledJobs) Create(scheduledJob *batch.ScheduledJob) (result *batch.ScheduledJob, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(scheduledjobsResource, c.ns, scheduledJob), &batch.ScheduledJob{})
if obj == nil {
return nil, err
}
return obj.(*batch.ScheduledJob), err
}
func (c *FakeScheduledJobs) Update(scheduledJob *batch.ScheduledJob) (result *batch.ScheduledJob, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(scheduledjobsResource, c.ns, scheduledJob), &batch.ScheduledJob{})
if obj == nil {
return nil, err
}
return obj.(*batch.ScheduledJob), err
}
func (c *FakeScheduledJobs) UpdateStatus(scheduledJob *batch.ScheduledJob) (*batch.ScheduledJob, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(scheduledjobsResource, "status", c.ns, scheduledJob), &batch.ScheduledJob{})
if obj == nil {
return nil, err
}
return obj.(*batch.ScheduledJob), err
}
func (c *FakeScheduledJobs) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(scheduledjobsResource, c.ns, name), &batch.ScheduledJob{})
return err
}
func (c *FakeScheduledJobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(scheduledjobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &batch.ScheduledJobList{})
return err
}
func (c *FakeScheduledJobs) Get(name string) (result *batch.ScheduledJob, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(scheduledjobsResource, c.ns, name), &batch.ScheduledJob{})
if obj == nil {
return nil, err
}
return obj.(*batch.ScheduledJob), err
}
func (c *FakeScheduledJobs) List(opts api.ListOptions) (result *batch.ScheduledJobList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(scheduledjobsResource, c.ns, opts), &batch.ScheduledJobList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &batch.ScheduledJobList{}
for _, item := range obj.(*batch.ScheduledJobList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested scheduledJobs.
func (c *FakeScheduledJobs) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(scheduledjobsResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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.
*/
// This package is generated by client-gen with the default arguments.
// Package fake has the automatically generated clients.
package fake
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeComponentStatuses implements ComponentStatusInterface
type FakeComponentStatuses struct {
Fake *FakeCore
}
var componentstatusesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "componentstatuses"}
func (c *FakeComponentStatuses) Create(componentStatus *api.ComponentStatus) (result *api.ComponentStatus, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(componentstatusesResource, componentStatus), &api.ComponentStatus{})
if obj == nil {
return nil, err
}
return obj.(*api.ComponentStatus), err
}
func (c *FakeComponentStatuses) Update(componentStatus *api.ComponentStatus) (result *api.ComponentStatus, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(componentstatusesResource, componentStatus), &api.ComponentStatus{})
if obj == nil {
return nil, err
}
return obj.(*api.ComponentStatus), err
}
func (c *FakeComponentStatuses) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(componentstatusesResource, name), &api.ComponentStatus{})
return err
}
func (c *FakeComponentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewRootDeleteCollectionAction(componentstatusesResource, listOptions)
_, err := c.Fake.Invokes(action, &api.ComponentStatusList{})
return err
}
func (c *FakeComponentStatuses) Get(name string) (result *api.ComponentStatus, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(componentstatusesResource, name), &api.ComponentStatus{})
if obj == nil {
return nil, err
}
return obj.(*api.ComponentStatus), err
}
func (c *FakeComponentStatuses) List(opts api.ListOptions) (result *api.ComponentStatusList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(componentstatusesResource, opts), &api.ComponentStatusList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.ComponentStatusList{}
for _, item := range obj.(*api.ComponentStatusList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested componentStatuses.
func (c *FakeComponentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(componentstatusesResource, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeConfigMaps implements ConfigMapInterface
type FakeConfigMaps struct {
Fake *FakeCore
ns string
}
var configmapsResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "configmaps"}
func (c *FakeConfigMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
if obj == nil {
return nil, err
}
return obj.(*api.ConfigMap), err
}
func (c *FakeConfigMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
if obj == nil {
return nil, err
}
return obj.(*api.ConfigMap), err
}
func (c *FakeConfigMaps) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(configmapsResource, c.ns, name), &api.ConfigMap{})
return err
}
func (c *FakeConfigMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.ConfigMapList{})
return err
}
func (c *FakeConfigMaps) Get(name string) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(configmapsResource, c.ns, name), &api.ConfigMap{})
if obj == nil {
return nil, err
}
return obj.(*api.ConfigMap), err
}
func (c *FakeConfigMaps) List(opts api.ListOptions) (result *api.ConfigMapList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(configmapsResource, c.ns, opts), &api.ConfigMapList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.ConfigMapList{}
for _, item := range obj.(*api.ConfigMapList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *FakeConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(configmapsResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned"
restclient "k8s.io/kubernetes/pkg/client/restclient"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeCore struct {
*core.Fake
}
func (c *FakeCore) ComponentStatuses() unversioned.ComponentStatusInterface {
return &FakeComponentStatuses{c}
}
func (c *FakeCore) ConfigMaps(namespace string) unversioned.ConfigMapInterface {
return &FakeConfigMaps{c, namespace}
}
func (c *FakeCore) Endpoints(namespace string) unversioned.EndpointsInterface {
return &FakeEndpoints{c, namespace}
}
func (c *FakeCore) Events(namespace string) unversioned.EventInterface {
return &FakeEvents{c, namespace}
}
func (c *FakeCore) LimitRanges(namespace string) unversioned.LimitRangeInterface {
return &FakeLimitRanges{c, namespace}
}
func (c *FakeCore) Namespaces() unversioned.NamespaceInterface {
return &FakeNamespaces{c}
}
func (c *FakeCore) Nodes() unversioned.NodeInterface {
return &FakeNodes{c}
}
func (c *FakeCore) PersistentVolumes() unversioned.PersistentVolumeInterface {
return &FakePersistentVolumes{c}
}
func (c *FakeCore) PersistentVolumeClaims(namespace string) unversioned.PersistentVolumeClaimInterface {
return &FakePersistentVolumeClaims{c, namespace}
}
func (c *FakeCore) Pods(namespace string) unversioned.PodInterface {
return &FakePods{c, namespace}
}
func (c *FakeCore) PodTemplates(namespace string) unversioned.PodTemplateInterface {
return &FakePodTemplates{c, namespace}
}
func (c *FakeCore) ReplicationControllers(namespace string) unversioned.ReplicationControllerInterface {
return &FakeReplicationControllers{c, namespace}
}
func (c *FakeCore) ResourceQuotas(namespace string) unversioned.ResourceQuotaInterface {
return &FakeResourceQuotas{c, namespace}
}
func (c *FakeCore) Secrets(namespace string) unversioned.SecretInterface {
return &FakeSecrets{c, namespace}
}
func (c *FakeCore) Services(namespace string) unversioned.ServiceInterface {
return &FakeServices{c, namespace}
}
func (c *FakeCore) ServiceAccounts(namespace string) unversioned.ServiceAccountInterface {
return &FakeServiceAccounts{c, namespace}
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCore) GetRESTClient() *restclient.RESTClient {
return nil
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeEndpoints implements EndpointsInterface
type FakeEndpoints struct {
Fake *FakeCore
ns string
}
var endpointsResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "endpoints"}
func (c *FakeEndpoints) Create(endpoints *api.Endpoints) (result *api.Endpoints, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(endpointsResource, c.ns, endpoints), &api.Endpoints{})
if obj == nil {
return nil, err
}
return obj.(*api.Endpoints), err
}
func (c *FakeEndpoints) Update(endpoints *api.Endpoints) (result *api.Endpoints, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(endpointsResource, c.ns, endpoints), &api.Endpoints{})
if obj == nil {
return nil, err
}
return obj.(*api.Endpoints), err
}
func (c *FakeEndpoints) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(endpointsResource, c.ns, name), &api.Endpoints{})
return err
}
func (c *FakeEndpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(endpointsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.EndpointsList{})
return err
}
func (c *FakeEndpoints) Get(name string) (result *api.Endpoints, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(endpointsResource, c.ns, name), &api.Endpoints{})
if obj == nil {
return nil, err
}
return obj.(*api.Endpoints), err
}
func (c *FakeEndpoints) List(opts api.ListOptions) (result *api.EndpointsList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(endpointsResource, c.ns, opts), &api.EndpointsList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.EndpointsList{}
for _, item := range obj.(*api.EndpointsList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested endpoints.
func (c *FakeEndpoints) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(endpointsResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeEvents implements EventInterface
type FakeEvents struct {
Fake *FakeCore
ns string
}
var eventsResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "events"}
func (c *FakeEvents) Create(event *api.Event) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(eventsResource, c.ns, event), &api.Event{})
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
func (c *FakeEvents) Update(event *api.Event) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(eventsResource, c.ns, event), &api.Event{})
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
func (c *FakeEvents) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(eventsResource, c.ns, name), &api.Event{})
return err
}
func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.EventList{})
return err
}
func (c *FakeEvents) Get(name string) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(eventsResource, c.ns, name), &api.Event{})
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
func (c *FakeEvents) List(opts api.ListOptions) (result *api.EventList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(eventsResource, c.ns, opts), &api.EventList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.EventList{}
for _, item := range obj.(*api.EventList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested events.
func (c *FakeEvents) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(eventsResource, c.ns, opts))
}
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
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"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/runtime"
)
func (c *FakeEvents) CreateWithEventNamespace(event *api.Event) (*api.Event, error) {
action := core.NewRootCreateAction(eventsResource, event)
if c.ns != "" {
action = core.NewCreateAction(eventsResource, c.ns, event)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
// Update replaces an existing event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) UpdateWithEventNamespace(event *api.Event) (*api.Event, error) {
action := core.NewRootUpdateAction(eventsResource, event)
if c.ns != "" {
action = core.NewUpdateAction(eventsResource, c.ns, event)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
// Patch patches an existing event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) Patch(event *api.Event, data []byte) (*api.Event, error) {
action := core.NewRootPatchAction(eventsResource, event)
if c.ns != "" {
action = core.NewPatchAction(eventsResource, c.ns, event)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*api.Event), err
}
// Search returns a list of events matching the specified object.
func (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error) {
action := core.NewRootListAction(eventsResource, api.ListOptions{})
if c.ns != "" {
action = core.NewListAction(eventsResource, c.ns, api.ListOptions{})
}
obj, err := c.Fake.Invokes(action, &api.EventList{})
if obj == nil {
return nil, err
}
return obj.(*api.EventList), err
}
func (c *FakeEvents) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector {
action := core.GenericActionImpl{}
action.Verb = "get-field-selector"
action.Resource = eventsResource
c.Fake.Invokes(action, nil)
return fields.Everything()
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeLimitRanges implements LimitRangeInterface
type FakeLimitRanges struct {
Fake *FakeCore
ns string
}
var limitrangesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "limitranges"}
func (c *FakeLimitRanges) Create(limitRange *api.LimitRange) (result *api.LimitRange, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(limitrangesResource, c.ns, limitRange), &api.LimitRange{})
if obj == nil {
return nil, err
}
return obj.(*api.LimitRange), err
}
func (c *FakeLimitRanges) Update(limitRange *api.LimitRange) (result *api.LimitRange, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(limitrangesResource, c.ns, limitRange), &api.LimitRange{})
if obj == nil {
return nil, err
}
return obj.(*api.LimitRange), err
}
func (c *FakeLimitRanges) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(limitrangesResource, c.ns, name), &api.LimitRange{})
return err
}
func (c *FakeLimitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(limitrangesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.LimitRangeList{})
return err
}
func (c *FakeLimitRanges) Get(name string) (result *api.LimitRange, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(limitrangesResource, c.ns, name), &api.LimitRange{})
if obj == nil {
return nil, err
}
return obj.(*api.LimitRange), err
}
func (c *FakeLimitRanges) List(opts api.ListOptions) (result *api.LimitRangeList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(limitrangesResource, c.ns, opts), &api.LimitRangeList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.LimitRangeList{}
for _, item := range obj.(*api.LimitRangeList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested limitRanges.
func (c *FakeLimitRanges) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(limitrangesResource, c.ns, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeNamespaces implements NamespaceInterface
type FakeNamespaces struct {
Fake *FakeCore
}
var namespacesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "namespaces"}
func (c *FakeNamespaces) Create(namespace *api.Namespace) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(namespacesResource, namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*api.Namespace), err
}
func (c *FakeNamespaces) Update(namespace *api.Namespace) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(namespacesResource, namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*api.Namespace), err
}
func (c *FakeNamespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*api.Namespace), err
}
func (c *FakeNamespaces) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(namespacesResource, name), &api.Namespace{})
return err
}
func (c *FakeNamespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewRootDeleteCollectionAction(namespacesResource, listOptions)
_, err := c.Fake.Invokes(action, &api.NamespaceList{})
return err
}
func (c *FakeNamespaces) Get(name string) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(namespacesResource, name), &api.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*api.Namespace), err
}
func (c *FakeNamespaces) List(opts api.ListOptions) (result *api.NamespaceList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(namespacesResource, opts), &api.NamespaceList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.NamespaceList{}
for _, item := range obj.(*api.NamespaceList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *FakeNamespaces) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(namespacesResource, opts))
}
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
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
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakeNodes implements NodeInterface
type FakeNodes struct {
Fake *FakeCore
}
var nodesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "nodes"}
func (c *FakeNodes) Create(node *api.Node) (result *api.Node, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(nodesResource, node), &api.Node{})
if obj == nil {
return nil, err
}
return obj.(*api.Node), err
}
func (c *FakeNodes) Update(node *api.Node) (result *api.Node, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(nodesResource, node), &api.Node{})
if obj == nil {
return nil, err
}
return obj.(*api.Node), err
}
func (c *FakeNodes) UpdateStatus(node *api.Node) (*api.Node, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(nodesResource, "status", node), &api.Node{})
if obj == nil {
return nil, err
}
return obj.(*api.Node), err
}
func (c *FakeNodes) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(nodesResource, name), &api.Node{})
return err
}
func (c *FakeNodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewRootDeleteCollectionAction(nodesResource, listOptions)
_, err := c.Fake.Invokes(action, &api.NodeList{})
return err
}
func (c *FakeNodes) Get(name string) (result *api.Node, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(nodesResource, name), &api.Node{})
if obj == nil {
return nil, err
}
return obj.(*api.Node), err
}
func (c *FakeNodes) List(opts api.ListOptions) (result *api.NodeList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(nodesResource, opts), &api.NodeList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.NodeList{}
for _, item := range obj.(*api.NodeList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested nodes.
func (c *FakeNodes) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(nodesResource, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 *FakeNodes) PatchStatus(nodeName string, data []byte) (*api.Node, error) {
obj, err := c.Fake.Invokes(
core.NewPatchSubresourceAction(nodesResource, "status"), &api.Node{})
if obj == nil {
return nil, err
}
return obj.(*api.Node), err
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakePersistentVolumes implements PersistentVolumeInterface
type FakePersistentVolumes struct {
Fake *FakeCore
}
var persistentvolumesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "persistentvolumes"}
func (c *FakePersistentVolumes) Create(persistentVolume *api.PersistentVolume) (result *api.PersistentVolume, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(persistentvolumesResource, persistentVolume), &api.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolume), err
}
func (c *FakePersistentVolumes) Update(persistentVolume *api.PersistentVolume) (result *api.PersistentVolume, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(persistentvolumesResource, persistentVolume), &api.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolume), err
}
func (c *FakePersistentVolumes) UpdateStatus(persistentVolume *api.PersistentVolume) (*api.PersistentVolume, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(persistentvolumesResource, "status", persistentVolume), &api.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolume), err
}
func (c *FakePersistentVolumes) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(persistentvolumesResource, name), &api.PersistentVolume{})
return err
}
func (c *FakePersistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewRootDeleteCollectionAction(persistentvolumesResource, listOptions)
_, err := c.Fake.Invokes(action, &api.PersistentVolumeList{})
return err
}
func (c *FakePersistentVolumes) Get(name string) (result *api.PersistentVolume, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(persistentvolumesResource, name), &api.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolume), err
}
func (c *FakePersistentVolumes) List(opts api.ListOptions) (result *api.PersistentVolumeList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(persistentvolumesResource, opts), &api.PersistentVolumeList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.PersistentVolumeList{}
for _, item := range obj.(*api.PersistentVolumeList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested persistentVolumes.
func (c *FakePersistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(persistentvolumesResource, opts))
}
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
core "k8s.io/kubernetes/pkg/client/testing/core"
labels "k8s.io/kubernetes/pkg/labels"
watch "k8s.io/kubernetes/pkg/watch"
)
// FakePersistentVolumeClaims implements PersistentVolumeClaimInterface
type FakePersistentVolumeClaims struct {
Fake *FakeCore
ns string
}
var persistentvolumeclaimsResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "persistentvolumeclaims"}
func (c *FakePersistentVolumeClaims) Create(persistentVolumeClaim *api.PersistentVolumeClaim) (result *api.PersistentVolumeClaim, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &api.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) Update(persistentVolumeClaim *api.PersistentVolumeClaim) (result *api.PersistentVolumeClaim, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &api.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) UpdateStatus(persistentVolumeClaim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim), &api.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(persistentvolumeclaimsResource, c.ns, name), &api.PersistentVolumeClaim{})
return err
}
func (c *FakePersistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := core.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.PersistentVolumeClaimList{})
return err
}
func (c *FakePersistentVolumeClaims) Get(name string) (result *api.PersistentVolumeClaim, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(persistentvolumeclaimsResource, c.ns, name), &api.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*api.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) List(opts api.ListOptions) (result *api.PersistentVolumeClaimList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(persistentvolumeclaimsResource, c.ns, opts), &api.PersistentVolumeClaimList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &api.PersistentVolumeClaimList{}
for _, item := range obj.(*api.PersistentVolumeClaimList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested persistentVolumeClaims.
func (c *FakePersistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(persistentvolumeclaimsResource, c.ns, opts))
}
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
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/restclient"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakePods) Bind(binding *api.Binding) error {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Resource = podsResource
action.Subresource = "bindings"
action.Object = binding
_, err := c.Fake.Invokes(action, binding)
return err
}
func (c *FakePods) GetLogs(name string, opts *api.PodLogOptions) *restclient.Request {
action := core.GenericActionImpl{}
action.Verb = "get"
action.Namespace = c.ns
action.Resource = podsResource
action.Subresource = "logs"
action.Value = opts
_, _ = c.Fake.Invokes(action, &api.Pod{})
return &restclient.Request{}
}
......@@ -21,7 +21,6 @@ import (
"net/http"
"reflect"
"strconv"
"strings"
"sync"
"time"
......@@ -408,7 +407,7 @@ func filterFunction(key string, keyFunc func(runtime.Object) (string, error), fi
glog.Errorf("invalid object for filter: %v", obj)
return false
}
if !strings.HasPrefix(objKey, key) {
if !hasPathPrefix(objKey, key) {
return false
}
return filter(obj)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册