diff --git a/pkg/client/clientset_generated/internalclientset/clientset.go b/pkg/client/clientset_generated/internalclientset/clientset.go index ae8c7dbf85..9ae281373a 100644 --- a/pkg/client/clientset_generated/internalclientset/clientset.go +++ b/pkg/client/clientset_generated/internalclientset/clientset.go @@ -26,6 +26,7 @@ import ( unversionedcertificates "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned" unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned" unversionedextensions "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/unversioned" + unversionedpolicy "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned" unversionedrbac "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/rbac/unversioned" unversionedstorage "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/storage/unversioned" restclient "k8s.io/kubernetes/pkg/client/restclient" @@ -45,6 +46,7 @@ type Interface interface { Rbac() unversionedrbac.RbacInterface Storage() unversionedstorage.StorageInterface Apps() unversionedapps.AppsInterface + Policy() unversionedpolicy.PolicyInterface } // Clientset contains the clients for groups. Each group has exactly one @@ -61,6 +63,7 @@ type Clientset struct { *unversionedrbac.RbacClient *unversionedstorage.StorageClient *unversionedapps.AppsClient + *unversionedpolicy.PolicyClient } // Core retrieves the CoreClient @@ -143,6 +146,14 @@ func (c *Clientset) Apps() unversionedapps.AppsInterface { return c.AppsClient } +// Policy retrieves the PolicyClient +func (c *Clientset) Policy() unversionedpolicy.PolicyInterface { + if c == nil { + return nil + } + return c.PolicyClient +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { return c.DiscoveryClient @@ -196,6 +207,10 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) { if err != nil { return nil, err } + clientset.PolicyClient, err = unversionedpolicy.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { @@ -219,6 +234,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset { clientset.RbacClient = unversionedrbac.NewForConfigOrDie(c) clientset.StorageClient = unversionedstorage.NewForConfigOrDie(c) clientset.AppsClient = unversionedapps.NewForConfigOrDie(c) + clientset.PolicyClient = unversionedpolicy.NewForConfigOrDie(c) clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &clientset @@ -237,6 +253,7 @@ func New(c *restclient.RESTClient) *Clientset { clientset.RbacClient = unversionedrbac.New(c) clientset.StorageClient = unversionedstorage.New(c) clientset.AppsClient = unversionedapps.New(c) + clientset.PolicyClient = unversionedpolicy.New(c) clientset.DiscoveryClient = discovery.NewDiscoveryClient(c) return &clientset diff --git a/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go b/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go index fcdc95f367..fc7e36704b 100644 --- a/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go +++ b/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go @@ -36,6 +36,8 @@ import ( 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" + unversionedpolicy "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned" + fakeunversionedpolicy "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/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" unversionedstorage "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/storage/unversioned" @@ -129,3 +131,8 @@ func (c *Clientset) Storage() unversionedstorage.StorageInterface { func (c *Clientset) Apps() unversionedapps.AppsInterface { return &fakeunversionedapps.FakeApps{Fake: &c.Fake} } + +// Policy retrieves the PolicyClient +func (c *Clientset) Policy() unversionedpolicy.PolicyInterface { + return &fakeunversionedpolicy.FakePolicy{Fake: &c.Fake} +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/doc.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/doc.go new file mode 100644 index 0000000000..1e6a8ff827 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/doc.go @@ -0,0 +1,20 @@ +/* +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. +*/ + +// This package is generated by client-gen with the default arguments. + +// This package has the automatically generated typed clients. +package unversioned diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/doc.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/doc.go new file mode 100644 index 0000000000..083f78f3a4 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +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. +*/ + +// This package is generated by client-gen with the default arguments. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_poddisruptionbudget.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_poddisruptionbudget.go new file mode 100644 index 0000000000..9dc63f5e7a --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_poddisruptionbudget.go @@ -0,0 +1,127 @@ +/* +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 ( + api "k8s.io/kubernetes/pkg/api" + unversioned "k8s.io/kubernetes/pkg/api/unversioned" + policy "k8s.io/kubernetes/pkg/apis/policy" + core "k8s.io/kubernetes/pkg/client/testing/core" + labels "k8s.io/kubernetes/pkg/labels" + watch "k8s.io/kubernetes/pkg/watch" +) + +// FakePodDisruptionBudgets implements PodDisruptionBudgetInterface +type FakePodDisruptionBudgets struct { + Fake *FakePolicy + ns string +} + +var poddisruptionbudgetsResource = unversioned.GroupVersionResource{Group: "policy", Version: "", Resource: "poddisruptionbudgets"} + +func (c *FakePodDisruptionBudgets) Create(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(core.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &policy.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policy.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) Update(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(core.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &policy.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policy.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) UpdateStatus(podDisruptionBudget *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) { + obj, err := c.Fake. + Invokes(core.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), &policy.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policy.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) Delete(name string, options *api.DeleteOptions) error { + _, err := c.Fake. + Invokes(core.NewDeleteAction(poddisruptionbudgetsResource, c.ns, name), &policy.PodDisruptionBudget{}) + + return err +} + +func (c *FakePodDisruptionBudgets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + action := core.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &policy.PodDisruptionBudgetList{}) + return err +} + +func (c *FakePodDisruptionBudgets) Get(name string) (result *policy.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(core.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &policy.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policy.PodDisruptionBudget), err +} + +func (c *FakePodDisruptionBudgets) List(opts api.ListOptions) (result *policy.PodDisruptionBudgetList, err error) { + obj, err := c.Fake. + Invokes(core.NewListAction(poddisruptionbudgetsResource, c.ns, opts), &policy.PodDisruptionBudgetList{}) + + if obj == nil { + return nil, err + } + + label := opts.LabelSelector + if label == nil { + label = labels.Everything() + } + list := &policy.PodDisruptionBudgetList{} + for _, item := range obj.(*policy.PodDisruptionBudgetList).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 podDisruptionBudgets. +func (c *FakePodDisruptionBudgets) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(core.NewWatchAction(poddisruptionbudgetsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *FakePodDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *policy.PodDisruptionBudget, err error) { + obj, err := c.Fake. + Invokes(core.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, data, subresources...), &policy.PodDisruptionBudget{}) + + if obj == nil { + return nil, err + } + return obj.(*policy.PodDisruptionBudget), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_policy_client.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_policy_client.go new file mode 100644 index 0000000000..017aa05a2c --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/fake/fake_policy_client.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 ( + unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned" + restclient "k8s.io/kubernetes/pkg/client/restclient" + core "k8s.io/kubernetes/pkg/client/testing/core" +) + +type FakePolicy struct { + *core.Fake +} + +func (c *FakePolicy) PodDisruptionBudgets(namespace string) unversioned.PodDisruptionBudgetInterface { + return &FakePodDisruptionBudgets{c, namespace} +} + +// GetRESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakePolicy) GetRESTClient() *restclient.RESTClient { + return nil +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/generated_expansion.go new file mode 100644 index 0000000000..e0c814fcf8 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/generated_expansion.go @@ -0,0 +1,19 @@ +/* +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 + +type PodDisruptionBudgetExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/poddisruptionbudget.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/poddisruptionbudget.go new file mode 100644 index 0000000000..05dc5ced71 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/poddisruptionbudget.go @@ -0,0 +1,165 @@ +/* +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 ( + api "k8s.io/kubernetes/pkg/api" + policy "k8s.io/kubernetes/pkg/apis/policy" + watch "k8s.io/kubernetes/pkg/watch" +) + +// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. +// A group's client should implement this interface. +type PodDisruptionBudgetsGetter interface { + PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface +} + +// PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. +type PodDisruptionBudgetInterface interface { + Create(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) + Update(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) + UpdateStatus(*policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error) + Delete(name string, options *api.DeleteOptions) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error + Get(name string) (*policy.PodDisruptionBudget, error) + List(opts api.ListOptions) (*policy.PodDisruptionBudgetList, error) + Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *policy.PodDisruptionBudget, err error) + PodDisruptionBudgetExpansion +} + +// podDisruptionBudgets implements PodDisruptionBudgetInterface +type podDisruptionBudgets struct { + client *PolicyClient + ns string +} + +// newPodDisruptionBudgets returns a PodDisruptionBudgets +func newPodDisruptionBudgets(c *PolicyClient, namespace string) *podDisruptionBudgets { + return &podDisruptionBudgets{ + client: c, + ns: namespace, + } +} + +// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Create(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { + result = &policy.PodDisruptionBudget{} + err = c.client.Post(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. +func (c *podDisruptionBudgets) Update(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { + result = &policy.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +func (c *podDisruptionBudgets) UpdateStatus(podDisruptionBudget *policy.PodDisruptionBudget) (result *policy.PodDisruptionBudget, err error) { + result = &policy.PodDisruptionBudget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(podDisruptionBudget.Name). + SubResource("status"). + Body(podDisruptionBudget). + Do(). + Into(result) + return +} + +// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. +func (c *podDisruptionBudgets) Delete(name string, options *api.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podDisruptionBudgets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. +func (c *podDisruptionBudgets) Get(name string) (result *policy.PodDisruptionBudget, err error) { + result = &policy.PodDisruptionBudget{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + Name(name). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *podDisruptionBudgets) List(opts api.ListOptions) (result *policy.PodDisruptionBudgetList, err error) { + result = &policy.PodDisruptionBudgetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. +func (c *podDisruptionBudgets) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched podDisruptionBudget. +func (c *podDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *policy.PodDisruptionBudget, err error) { + result = &policy.PodDisruptionBudget{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/policy_client.go b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/policy_client.go new file mode 100644 index 0000000000..923db44453 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/policy/unversioned/policy_client.go @@ -0,0 +1,99 @@ +/* +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 ( + api "k8s.io/kubernetes/pkg/api" + registered "k8s.io/kubernetes/pkg/apimachinery/registered" + restclient "k8s.io/kubernetes/pkg/client/restclient" +) + +type PolicyInterface interface { + GetRESTClient() *restclient.RESTClient + PodDisruptionBudgetsGetter +} + +// PolicyClient is used to interact with features provided by the Policy group. +type PolicyClient struct { + *restclient.RESTClient +} + +func (c *PolicyClient) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface { + return newPodDisruptionBudgets(c, namespace) +} + +// NewForConfig creates a new PolicyClient for the given config. +func NewForConfig(c *restclient.Config) (*PolicyClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := restclient.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &PolicyClient{client}, nil +} + +// NewForConfigOrDie creates a new PolicyClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *restclient.Config) *PolicyClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new PolicyClient for the given RESTClient. +func New(c *restclient.RESTClient) *PolicyClient { + return &PolicyClient{c} +} + +func setConfigDefaults(config *restclient.Config) error { + // if policy group is not registered, return an error + g, err := registered.Group("policy") + if err != nil { + return err + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = restclient.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group { + copyGroupVersion := g.GroupVersion + config.GroupVersion = ©GroupVersion + } + config.NegotiatedSerializer = api.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + return nil +} + +// GetRESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *PolicyClient) GetRESTClient() *restclient.RESTClient { + if c == nil { + return nil + } + return c.RESTClient +}