1
0
Fork 0

Upgrade k8s.io/client-go to version 2

This commit is contained in:
Ed Robinson 2017-04-07 11:49:53 +01:00
parent a3b95f798b
commit 6f4c5dd4ce
No known key found for this signature in database
GPG key ID: EC501FCA6421CCF0
675 changed files with 109006 additions and 90744 deletions

202
vendor/k8s.io/client-go/1.5/LICENSE generated vendored
View file

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2014 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.

View file

@ -1,261 +0,0 @@
/*
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 kubernetes
import (
"github.com/golang/glog"
discovery "k8s.io/client-go/1.5/discovery"
v1alpha1apps "k8s.io/client-go/1.5/kubernetes/typed/apps/v1alpha1"
v1beta1authentication "k8s.io/client-go/1.5/kubernetes/typed/authentication/v1beta1"
v1beta1authorization "k8s.io/client-go/1.5/kubernetes/typed/authorization/v1beta1"
v1autoscaling "k8s.io/client-go/1.5/kubernetes/typed/autoscaling/v1"
v1batch "k8s.io/client-go/1.5/kubernetes/typed/batch/v1"
v1alpha1certificates "k8s.io/client-go/1.5/kubernetes/typed/certificates/v1alpha1"
v1core "k8s.io/client-go/1.5/kubernetes/typed/core/v1"
v1beta1extensions "k8s.io/client-go/1.5/kubernetes/typed/extensions/v1beta1"
v1alpha1policy "k8s.io/client-go/1.5/kubernetes/typed/policy/v1alpha1"
v1alpha1rbac "k8s.io/client-go/1.5/kubernetes/typed/rbac/v1alpha1"
v1beta1storage "k8s.io/client-go/1.5/kubernetes/typed/storage/v1beta1"
"k8s.io/client-go/1.5/pkg/util/flowcontrol"
_ "k8s.io/client-go/1.5/plugin/pkg/client/auth"
rest "k8s.io/client-go/1.5/rest"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
Core() v1core.CoreInterface
Apps() v1alpha1apps.AppsInterface
Authentication() v1beta1authentication.AuthenticationInterface
Authorization() v1beta1authorization.AuthorizationInterface
Autoscaling() v1autoscaling.AutoscalingInterface
Batch() v1batch.BatchInterface
Certificates() v1alpha1certificates.CertificatesInterface
Extensions() v1beta1extensions.ExtensionsInterface
Policy() v1alpha1policy.PolicyInterface
Rbac() v1alpha1rbac.RbacInterface
Storage() v1beta1storage.StorageInterface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
*v1core.CoreClient
*v1alpha1apps.AppsClient
*v1beta1authentication.AuthenticationClient
*v1beta1authorization.AuthorizationClient
*v1autoscaling.AutoscalingClient
*v1batch.BatchClient
*v1alpha1certificates.CertificatesClient
*v1beta1extensions.ExtensionsClient
*v1alpha1policy.PolicyClient
*v1alpha1rbac.RbacClient
*v1beta1storage.StorageClient
}
// Core retrieves the CoreClient
func (c *Clientset) Core() v1core.CoreInterface {
if c == nil {
return nil
}
return c.CoreClient
}
// Apps retrieves the AppsClient
func (c *Clientset) Apps() v1alpha1apps.AppsInterface {
if c == nil {
return nil
}
return c.AppsClient
}
// Authentication retrieves the AuthenticationClient
func (c *Clientset) Authentication() v1beta1authentication.AuthenticationInterface {
if c == nil {
return nil
}
return c.AuthenticationClient
}
// Authorization retrieves the AuthorizationClient
func (c *Clientset) Authorization() v1beta1authorization.AuthorizationInterface {
if c == nil {
return nil
}
return c.AuthorizationClient
}
// Autoscaling retrieves the AutoscalingClient
func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingInterface {
if c == nil {
return nil
}
return c.AutoscalingClient
}
// Batch retrieves the BatchClient
func (c *Clientset) Batch() v1batch.BatchInterface {
if c == nil {
return nil
}
return c.BatchClient
}
// Certificates retrieves the CertificatesClient
func (c *Clientset) Certificates() v1alpha1certificates.CertificatesInterface {
if c == nil {
return nil
}
return c.CertificatesClient
}
// Extensions retrieves the ExtensionsClient
func (c *Clientset) Extensions() v1beta1extensions.ExtensionsInterface {
if c == nil {
return nil
}
return c.ExtensionsClient
}
// Policy retrieves the PolicyClient
func (c *Clientset) Policy() v1alpha1policy.PolicyInterface {
if c == nil {
return nil
}
return c.PolicyClient
}
// Rbac retrieves the RbacClient
func (c *Clientset) Rbac() v1alpha1rbac.RbacInterface {
if c == nil {
return nil
}
return c.RbacClient
}
// Storage retrieves the StorageClient
func (c *Clientset) Storage() v1beta1storage.StorageInterface {
if c == nil {
return nil
}
return c.StorageClient
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var clientset Clientset
var err error
clientset.CoreClient, err = v1core.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AppsClient, err = v1alpha1apps.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AuthenticationClient, err = v1beta1authentication.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AuthorizationClient, err = v1beta1authorization.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AutoscalingClient, err = v1autoscaling.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.BatchClient, err = v1batch.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.CertificatesClient, err = v1alpha1certificates.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.ExtensionsClient, err = v1beta1extensions.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.PolicyClient, err = v1alpha1policy.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.RbacClient, err = v1alpha1rbac.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.StorageClient, err = v1beta1storage.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
glog.Errorf("failed to create the DiscoveryClient: %v", err)
return nil, err
}
return &clientset, nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var clientset Clientset
clientset.CoreClient = v1core.NewForConfigOrDie(c)
clientset.AppsClient = v1alpha1apps.NewForConfigOrDie(c)
clientset.AuthenticationClient = v1beta1authentication.NewForConfigOrDie(c)
clientset.AuthorizationClient = v1beta1authorization.NewForConfigOrDie(c)
clientset.AutoscalingClient = v1autoscaling.NewForConfigOrDie(c)
clientset.BatchClient = v1batch.NewForConfigOrDie(c)
clientset.CertificatesClient = v1alpha1certificates.NewForConfigOrDie(c)
clientset.ExtensionsClient = v1beta1extensions.NewForConfigOrDie(c)
clientset.PolicyClient = v1alpha1policy.NewForConfigOrDie(c)
clientset.RbacClient = v1alpha1rbac.NewForConfigOrDie(c)
clientset.StorageClient = v1beta1storage.NewForConfigOrDie(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &clientset
}
// New creates a new Clientset for the given RESTClient.
func New(c *rest.RESTClient) *Clientset {
var clientset Clientset
clientset.CoreClient = v1core.New(c)
clientset.AppsClient = v1alpha1apps.New(c)
clientset.AuthenticationClient = v1beta1authentication.New(c)
clientset.AuthorizationClient = v1beta1authorization.New(c)
clientset.AutoscalingClient = v1autoscaling.New(c)
clientset.BatchClient = v1batch.New(c)
clientset.CertificatesClient = v1alpha1certificates.New(c)
clientset.ExtensionsClient = v1beta1extensions.New(c)
clientset.PolicyClient = v1alpha1policy.New(c)
clientset.RbacClient = v1alpha1rbac.New(c)
clientset.StorageClient = v1beta1storage.New(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &clientset
}

View file

@ -1,96 +0,0 @@
/*
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 v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type AppsInterface interface {
GetRESTClient() *rest.RESTClient
PetSetsGetter
}
// AppsClient is used to interact with features provided by the Apps group.
type AppsClient struct {
*rest.RESTClient
}
func (c *AppsClient) PetSets(namespace string) PetSetInterface {
return newPetSets(c, namespace)
}
// NewForConfig creates a new AppsClient for the given config.
func NewForConfig(c *rest.Config) (*AppsClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AppsClient{client}, nil
}
// NewForConfigOrDie creates a new AppsClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AppsClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AppsClient for the given RESTClient.
func New(c *rest.RESTClient) *AppsClient {
return &AppsClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if apps group is not registered, return an error
g, err := registered.Group("apps")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AppsClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,165 +0,0 @@
/*
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 v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1alpha1 "k8s.io/client-go/1.5/pkg/apis/apps/v1alpha1"
watch "k8s.io/client-go/1.5/pkg/watch"
)
// PetSetsGetter has a method to return a PetSetInterface.
// A group's client should implement this interface.
type PetSetsGetter interface {
PetSets(namespace string) PetSetInterface
}
// PetSetInterface has methods to work with PetSet resources.
type PetSetInterface interface {
Create(*v1alpha1.PetSet) (*v1alpha1.PetSet, error)
Update(*v1alpha1.PetSet) (*v1alpha1.PetSet, error)
UpdateStatus(*v1alpha1.PetSet) (*v1alpha1.PetSet, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1alpha1.PetSet, error)
List(opts api.ListOptions) (*v1alpha1.PetSetList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PetSet, err error)
PetSetExpansion
}
// petSets implements PetSetInterface
type petSets struct {
client *AppsClient
ns string
}
// newPetSets returns a PetSets
func newPetSets(c *AppsClient, namespace string) *petSets {
return &petSets{
client: c,
ns: namespace,
}
}
// Create takes the representation of a petSet and creates it. Returns the server's representation of the petSet, and an error, if there is any.
func (c *petSets) Create(petSet *v1alpha1.PetSet) (result *v1alpha1.PetSet, err error) {
result = &v1alpha1.PetSet{}
err = c.client.Post().
Namespace(c.ns).
Resource("petsets").
Body(petSet).
Do().
Into(result)
return
}
// Update takes the representation of a petSet and updates it. Returns the server's representation of the petSet, and an error, if there is any.
func (c *petSets) Update(petSet *v1alpha1.PetSet) (result *v1alpha1.PetSet, err error) {
result = &v1alpha1.PetSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("petsets").
Name(petSet.Name).
Body(petSet).
Do().
Into(result)
return
}
func (c *petSets) UpdateStatus(petSet *v1alpha1.PetSet) (result *v1alpha1.PetSet, err error) {
result = &v1alpha1.PetSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("petsets").
Name(petSet.Name).
SubResource("status").
Body(petSet).
Do().
Into(result)
return
}
// Delete takes name of the petSet and deletes it. Returns an error if one occurs.
func (c *petSets) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("petsets").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *petSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("petsets").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the petSet, and returns the corresponding petSet object, and an error if there is any.
func (c *petSets) Get(name string) (result *v1alpha1.PetSet, err error) {
result = &v1alpha1.PetSet{}
err = c.client.Get().
Namespace(c.ns).
Resource("petsets").
Name(name).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of PetSets that match those selectors.
func (c *petSets) List(opts api.ListOptions) (result *v1alpha1.PetSetList, err error) {
result = &v1alpha1.PetSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("petsets").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested petSets.
func (c *petSets) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("petsets").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched petSet.
func (c *petSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PetSet, err error) {
result = &v1alpha1.PetSet{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("petsets").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View file

@ -1,96 +0,0 @@
/*
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 v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type AuthenticationInterface interface {
GetRESTClient() *rest.RESTClient
TokenReviewsGetter
}
// AuthenticationClient is used to interact with features provided by the Authentication group.
type AuthenticationClient struct {
*rest.RESTClient
}
func (c *AuthenticationClient) TokenReviews() TokenReviewInterface {
return newTokenReviews(c)
}
// NewForConfig creates a new AuthenticationClient for the given config.
func NewForConfig(c *rest.Config) (*AuthenticationClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AuthenticationClient{client}, nil
}
// NewForConfigOrDie creates a new AuthenticationClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AuthenticationClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AuthenticationClient for the given RESTClient.
func New(c *rest.RESTClient) *AuthenticationClient {
return &AuthenticationClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if authentication group is not registered, return an error
g, err := registered.Group("authentication.k8s.io")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AuthenticationClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,106 +0,0 @@
/*
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 v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type AuthorizationInterface interface {
GetRESTClient() *rest.RESTClient
LocalSubjectAccessReviewsGetter
SelfSubjectAccessReviewsGetter
SubjectAccessReviewsGetter
}
// AuthorizationClient is used to interact with features provided by the Authorization group.
type AuthorizationClient struct {
*rest.RESTClient
}
func (c *AuthorizationClient) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface {
return newLocalSubjectAccessReviews(c, namespace)
}
func (c *AuthorizationClient) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface {
return newSelfSubjectAccessReviews(c)
}
func (c *AuthorizationClient) SubjectAccessReviews() SubjectAccessReviewInterface {
return newSubjectAccessReviews(c)
}
// NewForConfig creates a new AuthorizationClient for the given config.
func NewForConfig(c *rest.Config) (*AuthorizationClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AuthorizationClient{client}, nil
}
// NewForConfigOrDie creates a new AuthorizationClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AuthorizationClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AuthorizationClient for the given RESTClient.
func New(c *rest.RESTClient) *AuthorizationClient {
return &AuthorizationClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if authorization group is not registered, return an error
g, err := registered.Group("authorization.k8s.io")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AuthorizationClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,96 +0,0 @@
/*
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 (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type AutoscalingInterface interface {
GetRESTClient() *rest.RESTClient
HorizontalPodAutoscalersGetter
}
// AutoscalingClient is used to interact with features provided by the Autoscaling group.
type AutoscalingClient struct {
*rest.RESTClient
}
func (c *AutoscalingClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface {
return newHorizontalPodAutoscalers(c, namespace)
}
// NewForConfig creates a new AutoscalingClient for the given config.
func NewForConfig(c *rest.Config) (*AutoscalingClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AutoscalingClient{client}, nil
}
// NewForConfigOrDie creates a new AutoscalingClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AutoscalingClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AutoscalingClient for the given RESTClient.
func New(c *rest.RESTClient) *AutoscalingClient {
return &AutoscalingClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if autoscaling group is not registered, return an error
g, err := registered.Group("autoscaling")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AutoscalingClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,96 +0,0 @@
/*
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 (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type BatchInterface interface {
GetRESTClient() *rest.RESTClient
JobsGetter
}
// BatchClient is used to interact with features provided by the Batch group.
type BatchClient struct {
*rest.RESTClient
}
func (c *BatchClient) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
// NewForConfig creates a new BatchClient for the given config.
func NewForConfig(c *rest.Config) (*BatchClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &BatchClient{client}, nil
}
// NewForConfigOrDie creates a new BatchClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *BatchClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new BatchClient for the given RESTClient.
func New(c *rest.RESTClient) *BatchClient {
return &BatchClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if batch group is not registered, return an error
g, err := registered.Group("batch")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *BatchClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,96 +0,0 @@
/*
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 v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type CertificatesInterface interface {
GetRESTClient() *rest.RESTClient
CertificateSigningRequestsGetter
}
// CertificatesClient is used to interact with features provided by the Certificates group.
type CertificatesClient struct {
*rest.RESTClient
}
func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface {
return newCertificateSigningRequests(c)
}
// NewForConfig creates a new CertificatesClient for the given config.
func NewForConfig(c *rest.Config) (*CertificatesClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CertificatesClient{client}, nil
}
// NewForConfigOrDie creates a new CertificatesClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CertificatesClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CertificatesClient for the given RESTClient.
func New(c *rest.RESTClient) *CertificatesClient {
return &CertificatesClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if certificates group is not registered, return an error
g, err := registered.Group("certificates.k8s.io")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CertificatesClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,19 +0,0 @@
/*
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 v1alpha1
type CertificateSigningRequestExpansion interface{}

View file

@ -1,171 +0,0 @@
/*
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 (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type CoreInterface interface {
GetRESTClient() *rest.RESTClient
ComponentStatusesGetter
ConfigMapsGetter
EndpointsGetter
EventsGetter
LimitRangesGetter
NamespacesGetter
NodesGetter
PersistentVolumesGetter
PersistentVolumeClaimsGetter
PodsGetter
PodTemplatesGetter
ReplicationControllersGetter
ResourceQuotasGetter
SecretsGetter
ServicesGetter
ServiceAccountsGetter
}
// CoreClient is used to interact with features provided by the Core group.
type CoreClient struct {
*rest.RESTClient
}
func (c *CoreClient) ComponentStatuses() ComponentStatusInterface {
return newComponentStatuses(c)
}
func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface {
return newConfigMaps(c, namespace)
}
func (c *CoreClient) Endpoints(namespace string) EndpointsInterface {
return newEndpoints(c, namespace)
}
func (c *CoreClient) Events(namespace string) EventInterface {
return newEvents(c, namespace)
}
func (c *CoreClient) LimitRanges(namespace string) LimitRangeInterface {
return newLimitRanges(c, namespace)
}
func (c *CoreClient) Namespaces() NamespaceInterface {
return newNamespaces(c)
}
func (c *CoreClient) Nodes() NodeInterface {
return newNodes(c)
}
func (c *CoreClient) PersistentVolumes() PersistentVolumeInterface {
return newPersistentVolumes(c)
}
func (c *CoreClient) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface {
return newPersistentVolumeClaims(c, namespace)
}
func (c *CoreClient) Pods(namespace string) PodInterface {
return newPods(c, namespace)
}
func (c *CoreClient) PodTemplates(namespace string) PodTemplateInterface {
return newPodTemplates(c, namespace)
}
func (c *CoreClient) ReplicationControllers(namespace string) ReplicationControllerInterface {
return newReplicationControllers(c, namespace)
}
func (c *CoreClient) ResourceQuotas(namespace string) ResourceQuotaInterface {
return newResourceQuotas(c, namespace)
}
func (c *CoreClient) Secrets(namespace string) SecretInterface {
return newSecrets(c, namespace)
}
func (c *CoreClient) Services(namespace string) ServiceInterface {
return newServices(c, namespace)
}
func (c *CoreClient) ServiceAccounts(namespace string) ServiceAccountInterface {
return newServiceAccounts(c, namespace)
}
// NewForConfig creates a new CoreClient for the given config.
func NewForConfig(c *rest.Config) (*CoreClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CoreClient{client}, nil
}
// NewForConfigOrDie creates a new CoreClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CoreClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CoreClient for the given RESTClient.
func New(c *rest.RESTClient) *CoreClient {
return &CoreClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if core group is not registered, return an error
g, err := registered.Group("")
if err != nil {
return err
}
config.APIPath = "/api"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CoreClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,131 +0,0 @@
/*
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 v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type ExtensionsInterface interface {
GetRESTClient() *rest.RESTClient
DaemonSetsGetter
DeploymentsGetter
IngressesGetter
JobsGetter
PodSecurityPoliciesGetter
ReplicaSetsGetter
ScalesGetter
ThirdPartyResourcesGetter
}
// ExtensionsClient is used to interact with features provided by the Extensions group.
type ExtensionsClient struct {
*rest.RESTClient
}
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
return newDaemonSets(c, namespace)
}
func (c *ExtensionsClient) Deployments(namespace string) DeploymentInterface {
return newDeployments(c, namespace)
}
func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface {
return newIngresses(c, namespace)
}
func (c *ExtensionsClient) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
func (c *ExtensionsClient) PodSecurityPolicies() PodSecurityPolicyInterface {
return newPodSecurityPolicies(c)
}
func (c *ExtensionsClient) ReplicaSets(namespace string) ReplicaSetInterface {
return newReplicaSets(c, namespace)
}
func (c *ExtensionsClient) Scales(namespace string) ScaleInterface {
return newScales(c, namespace)
}
func (c *ExtensionsClient) ThirdPartyResources() ThirdPartyResourceInterface {
return newThirdPartyResources(c)
}
// NewForConfig creates a new ExtensionsClient for the given config.
func NewForConfig(c *rest.Config) (*ExtensionsClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &ExtensionsClient{client}, nil
}
// NewForConfigOrDie creates a new ExtensionsClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *ExtensionsClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new ExtensionsClient for the given RESTClient.
func New(c *rest.RESTClient) *ExtensionsClient {
return &ExtensionsClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if extensions group is not registered, return an error
g, err := registered.Group("extensions")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *ExtensionsClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,96 +0,0 @@
/*
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 v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type PolicyInterface interface {
GetRESTClient() *rest.RESTClient
PodDisruptionBudgetsGetter
}
// PolicyClient is used to interact with features provided by the Policy group.
type PolicyClient struct {
*rest.RESTClient
}
func (c *PolicyClient) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface {
return newPodDisruptionBudgets(c, namespace)
}
// NewForConfig creates a new PolicyClient for the given config.
func NewForConfig(c *rest.Config) (*PolicyClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.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 *rest.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 *rest.RESTClient) *PolicyClient {
return &PolicyClient{c}
}
func setConfigDefaults(config *rest.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 = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *PolicyClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,20 +0,0 @@
/*
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 arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1alpha1

View file

@ -1,111 +0,0 @@
/*
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 v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type RbacInterface interface {
GetRESTClient() *rest.RESTClient
ClusterRolesGetter
ClusterRoleBindingsGetter
RolesGetter
RoleBindingsGetter
}
// RbacClient is used to interact with features provided by the Rbac group.
type RbacClient struct {
*rest.RESTClient
}
func (c *RbacClient) ClusterRoles() ClusterRoleInterface {
return newClusterRoles(c)
}
func (c *RbacClient) ClusterRoleBindings() ClusterRoleBindingInterface {
return newClusterRoleBindings(c)
}
func (c *RbacClient) Roles(namespace string) RoleInterface {
return newRoles(c, namespace)
}
func (c *RbacClient) RoleBindings(namespace string) RoleBindingInterface {
return newRoleBindings(c, namespace)
}
// NewForConfig creates a new RbacClient for the given config.
func NewForConfig(c *rest.Config) (*RbacClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &RbacClient{client}, nil
}
// NewForConfigOrDie creates a new RbacClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *RbacClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new RbacClient for the given RESTClient.
func New(c *rest.RESTClient) *RbacClient {
return &RbacClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if rbac group is not registered, return an error
g, err := registered.Group("rbac.authorization.k8s.io")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *RbacClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,96 +0,0 @@
/*
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 v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
registered "k8s.io/client-go/1.5/pkg/apimachinery/registered"
serializer "k8s.io/client-go/1.5/pkg/runtime/serializer"
rest "k8s.io/client-go/1.5/rest"
)
type StorageInterface interface {
GetRESTClient() *rest.RESTClient
StorageClassesGetter
}
// StorageClient is used to interact with features provided by the Storage group.
type StorageClient struct {
*rest.RESTClient
}
func (c *StorageClient) StorageClasses() StorageClassInterface {
return newStorageClasses(c)
}
// NewForConfig creates a new StorageClient for the given config.
func NewForConfig(c *rest.Config) (*StorageClient, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &StorageClient{client}, nil
}
// NewForConfigOrDie creates a new StorageClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *StorageClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new StorageClient for the given RESTClient.
func New(c *rest.RESTClient) *StorageClient {
return &StorageClient{c}
}
func setConfigDefaults(config *rest.Config) error {
// if storage group is not registered, return an error
g, err := registered.Group("storage.k8s.io")
if err != nil {
return err
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *StorageClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.RESTClient
}

View file

@ -1,69 +0,0 @@
/*
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.
*/
// Code generated by protoc-gen-gogo.
// source: k8s.io/kubernetes/pkg/api/resource/generated.proto
// DO NOT EDIT!
/*
Package resource is a generated protocol buffer package.
It is generated from these files:
k8s.io/kubernetes/pkg/api/resource/generated.proto
It has these top-level messages:
Quantity
*/
package resource
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
func (m *Quantity) Reset() { *m = Quantity{} }
func (*Quantity) ProtoMessage() {}
func (*Quantity) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
func init() {
proto.RegisterType((*Quantity)(nil), "k8s.io.client-go.1.5.pkg.api.resource.Quantity")
}
var fileDescriptorGenerated = []byte{
// 222 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0xca, 0xb6, 0x28, 0xd6,
0xcb, 0xcc, 0xd7, 0xcf, 0x2e, 0x4d, 0x4a, 0x2d, 0xca, 0x4b, 0x2d, 0x49, 0x2d, 0xd6, 0x2f, 0xc8,
0x4e, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x4f,
0x4f, 0xcd, 0x4b, 0x2d, 0x4a, 0x2c, 0x49, 0x4d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52,
0x82, 0xe8, 0xd1, 0x43, 0xe8, 0xd1, 0x03, 0xea, 0xd1, 0x03, 0xea, 0xd1, 0x83, 0xe9, 0x91, 0xd2,
0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7,
0x07, 0x6b, 0x4d, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0xa4, 0x94, 0x21, 0x76,
0x67, 0x94, 0x96, 0x64, 0xe6, 0xe8, 0x67, 0xe6, 0x95, 0x14, 0x97, 0x14, 0xa1, 0xbb, 0x42, 0xc9,
0x82, 0x8b, 0x23, 0xb0, 0x34, 0x31, 0xaf, 0x24, 0xb3, 0xa4, 0x52, 0x48, 0x8c, 0x8b, 0x0d, 0xa8,
0x24, 0x33, 0x2f, 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xca, 0xb3, 0x12, 0x99, 0xb1,
0x40, 0x9e, 0xa1, 0x63, 0xa1, 0x3c, 0xc3, 0x04, 0x20, 0x5e, 0x00, 0xc4, 0x0d, 0x77, 0x14, 0x18,
0x9c, 0xb4, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0x00, 0xc4, 0x37, 0x80, 0xb8, 0xe1, 0x91, 0x1c, 0xe3,
0x09, 0x20, 0xbe, 0x00, 0xc4, 0x0f, 0x80, 0x78, 0xc2, 0x63, 0x39, 0x86, 0x28, 0x0e, 0x98, 0x3f,
0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x1c, 0x7f, 0xff, 0x20, 0x01, 0x00, 0x00,
}

View file

@ -1,30 +0,0 @@
/*
Copyright 2015 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
const (
// If you add a new topology domain here, also consider adding it to the set of default values
// for the scheduler's --failure-domain command-line argument.
LabelHostname = "kubernetes.io/hostname"
LabelZoneFailureDomain = "failure-domain.beta.kubernetes.io/zone"
LabelZoneRegion = "failure-domain.beta.kubernetes.io/region"
LabelInstanceType = "beta.kubernetes.io/instance-type"
LabelOS = "beta.kubernetes.io/os"
LabelArch = "beta.kubernetes.io/arch"
)

View file

@ -1,71 +0,0 @@
/*
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 v1alpha1
// This file contains a collection of methods that can be used from go-restful to
// generate Swagger API documentation for its models. Please read this PR for more
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
//
// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
// they are on one line! For multiple line or blocks that you want to ignore use ---.
// Any context after a --- is ignored.
//
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
// AUTO-GENERATED FUNCTIONS START HERE
var map_PetSet = map[string]string{
"": "PetSet represents a set of pods with consistent identities. Identities are defined as:\n - Network: A single stable DNS and hostname.\n - Storage: As many VolumeClaims as requested.\nThe PetSet guarantees that a given network identity will always map to the same storage identity. PetSet is currently in alpha and subject to change without notice.",
"spec": "Spec defines the desired identities of pets in this set.",
"status": "Status is the current status of Pets in this PetSet. This data may be out of date by some window of time.",
}
func (PetSet) SwaggerDoc() map[string]string {
return map_PetSet
}
var map_PetSetList = map[string]string{
"": "PetSetList is a collection of PetSets.",
}
func (PetSetList) SwaggerDoc() map[string]string {
return map_PetSetList
}
var map_PetSetSpec = map[string]string{
"": "A PetSetSpec is the specification of a PetSet.",
"replicas": "Replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1.",
"selector": "Selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors",
"template": "Template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the PetSet will fulfill this Template, but have a unique identity from the rest of the PetSet.",
"volumeClaimTemplates": "VolumeClaimTemplates is a list of claims that pets are allowed to reference. The PetSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pet. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.",
"serviceName": "ServiceName is the name of the service that governs this PetSet. This service must exist before the PetSet, and is responsible for the network identity of the set. Pets get DNS/hostnames that follow the pattern: pet-specific-string.serviceName.default.svc.cluster.local where \"pet-specific-string\" is managed by the PetSet controller.",
}
func (PetSetSpec) SwaggerDoc() map[string]string {
return map_PetSetSpec
}
var map_PetSetStatus = map[string]string{
"": "PetSetStatus represents the current state of a PetSet.",
"observedGeneration": "most recent generation observed by this autoscaler.",
"replicas": "Replicas is the number of actual replicas.",
}
func (PetSetStatus) SwaggerDoc() map[string]string {
return map_PetSetStatus
}
// AUTO-GENERATED FUNCTIONS END HERE

View file

@ -1,205 +0,0 @@
// +build !ignore_autogenerated
/*
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 file was autogenerated by conversion-gen. Do not edit it manually!
package v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
apps "k8s.io/client-go/1.5/pkg/apis/apps"
conversion "k8s.io/client-go/1.5/pkg/conversion"
runtime "k8s.io/client-go/1.5/pkg/runtime"
)
func init() {
SchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1alpha1_PetSet_To_apps_PetSet,
Convert_apps_PetSet_To_v1alpha1_PetSet,
Convert_v1alpha1_PetSetList_To_apps_PetSetList,
Convert_apps_PetSetList_To_v1alpha1_PetSetList,
Convert_v1alpha1_PetSetSpec_To_apps_PetSetSpec,
Convert_apps_PetSetSpec_To_v1alpha1_PetSetSpec,
Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus,
Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus,
)
}
func autoConvert_v1alpha1_PetSet_To_apps_PetSet(in *PetSet, out *apps.PetSet, s conversion.Scope) error {
SetDefaults_PetSet(in)
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v1alpha1_PetSetSpec_To_apps_PetSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v1alpha1_PetSet_To_apps_PetSet(in *PetSet, out *apps.PetSet, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSet_To_apps_PetSet(in, out, s)
}
func autoConvert_apps_PetSet_To_v1alpha1_PetSet(in *apps.PetSet, out *PetSet, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_apps_PetSetSpec_To_v1alpha1_PetSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_apps_PetSet_To_v1alpha1_PetSet(in *apps.PetSet, out *PetSet, s conversion.Scope) error {
return autoConvert_apps_PetSet_To_v1alpha1_PetSet(in, out, s)
}
func autoConvert_v1alpha1_PetSetList_To_apps_PetSetList(in *PetSetList, out *apps.PetSetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]apps.PetSet, len(*in))
for i := range *in {
if err := Convert_v1alpha1_PetSet_To_apps_PetSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v1alpha1_PetSetList_To_apps_PetSetList(in *PetSetList, out *apps.PetSetList, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSetList_To_apps_PetSetList(in, out, s)
}
func autoConvert_apps_PetSetList_To_v1alpha1_PetSetList(in *apps.PetSetList, out *PetSetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PetSet, len(*in))
for i := range *in {
if err := Convert_apps_PetSet_To_v1alpha1_PetSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_apps_PetSetList_To_v1alpha1_PetSetList(in *apps.PetSetList, out *PetSetList, s conversion.Scope) error {
return autoConvert_apps_PetSetList_To_v1alpha1_PetSetList(in, out, s)
}
func autoConvert_v1alpha1_PetSetSpec_To_apps_PetSetSpec(in *PetSetSpec, out *apps.PetSetSpec, s conversion.Scope) error {
// WARNING: in.Replicas requires manual conversion: inconvertible types (*int32 vs int)
out.Selector = in.Selector
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]api.PersistentVolumeClaim, len(*in))
for i := range *in {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {
return err
}
}
} else {
out.VolumeClaimTemplates = nil
}
out.ServiceName = in.ServiceName
return nil
}
func autoConvert_apps_PetSetSpec_To_v1alpha1_PetSetSpec(in *apps.PetSetSpec, out *PetSetSpec, s conversion.Scope) error {
// WARNING: in.Replicas requires manual conversion: inconvertible types (int vs *int32)
out.Selector = in.Selector
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]v1.PersistentVolumeClaim, len(*in))
for i := range *in {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {
return err
}
}
} else {
out.VolumeClaimTemplates = nil
}
out.ServiceName = in.ServiceName
return nil
}
func autoConvert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in *PetSetStatus, out *apps.PetSetStatus, s conversion.Scope) error {
out.ObservedGeneration = in.ObservedGeneration
out.Replicas = int(in.Replicas)
return nil
}
func Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in *PetSetStatus, out *apps.PetSetStatus, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in, out, s)
}
func autoConvert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in *apps.PetSetStatus, out *PetSetStatus, s conversion.Scope) error {
out.ObservedGeneration = in.ObservedGeneration
out.Replicas = int32(in.Replicas)
return nil
}
func Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in *apps.PetSetStatus, out *PetSetStatus, s conversion.Scope) error {
return autoConvert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in, out, s)
}

View file

@ -1,334 +0,0 @@
// +build !ignore_autogenerated
/*
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 file was autogenerated by conversion-gen. Do not edit it manually!
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
unversioned "k8s.io/client-go/1.5/pkg/api/unversioned"
api_v1 "k8s.io/client-go/1.5/pkg/api/v1"
batch "k8s.io/client-go/1.5/pkg/apis/batch"
conversion "k8s.io/client-go/1.5/pkg/conversion"
runtime "k8s.io/client-go/1.5/pkg/runtime"
)
func init() {
SchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1_Job_To_batch_Job,
Convert_batch_Job_To_v1_Job,
Convert_v1_JobCondition_To_batch_JobCondition,
Convert_batch_JobCondition_To_v1_JobCondition,
Convert_v1_JobList_To_batch_JobList,
Convert_batch_JobList_To_v1_JobList,
Convert_v1_JobSpec_To_batch_JobSpec,
Convert_batch_JobSpec_To_v1_JobSpec,
Convert_v1_JobStatus_To_batch_JobStatus,
Convert_batch_JobStatus_To_v1_JobStatus,
Convert_v1_LabelSelector_To_unversioned_LabelSelector,
Convert_unversioned_LabelSelector_To_v1_LabelSelector,
Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement,
Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement,
)
}
func autoConvert_v1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error {
SetDefaults_Job(in)
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1_JobStatus_To_batch_JobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error {
return autoConvert_v1_Job_To_batch_Job(in, out, s)
}
func autoConvert_batch_Job_To_v1_Job(in *batch.Job, out *Job, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_batch_JobSpec_To_v1_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_batch_JobStatus_To_v1_JobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_batch_Job_To_v1_Job(in *batch.Job, out *Job, s conversion.Scope) error {
return autoConvert_batch_Job_To_v1_Job(in, out, s)
}
func autoConvert_v1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error {
out.Type = batch.JobConditionType(in.Type)
out.Status = api.ConditionStatus(in.Status)
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
return err
}
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
return err
}
out.Reason = in.Reason
out.Message = in.Message
return nil
}
func Convert_v1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error {
return autoConvert_v1_JobCondition_To_batch_JobCondition(in, out, s)
}
func autoConvert_batch_JobCondition_To_v1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error {
out.Type = JobConditionType(in.Type)
out.Status = api_v1.ConditionStatus(in.Status)
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
return err
}
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
return err
}
out.Reason = in.Reason
out.Message = in.Message
return nil
}
func Convert_batch_JobCondition_To_v1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error {
return autoConvert_batch_JobCondition_To_v1_JobCondition(in, out, s)
}
func autoConvert_v1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]batch.Job, len(*in))
for i := range *in {
if err := Convert_v1_Job_To_batch_Job(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error {
return autoConvert_v1_JobList_To_batch_JobList(in, out, s)
}
func autoConvert_batch_JobList_To_v1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Job, len(*in))
for i := range *in {
if err := Convert_batch_Job_To_v1_Job(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_batch_JobList_To_v1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error {
return autoConvert_batch_JobList_To_v1_JobList(in, out, s)
}
func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := Convert_v1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector
if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v1_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector
if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func autoConvert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error {
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]batch.JobCondition, len(*in))
for i := range *in {
if err := Convert_v1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
out.StartTime = in.StartTime
out.CompletionTime = in.CompletionTime
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
func Convert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error {
return autoConvert_v1_JobStatus_To_batch_JobStatus(in, out, s)
}
func autoConvert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error {
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]JobCondition, len(*in))
for i := range *in {
if err := Convert_batch_JobCondition_To_v1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
out.StartTime = in.StartTime
out.CompletionTime = in.CompletionTime
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
func Convert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error {
return autoConvert_batch_JobStatus_To_v1_JobStatus(in, out, s)
}
func autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]unversioned.LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
return autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in, out, s)
}
func autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in, out, s)
}
func autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = unversioned.LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s)
}
func autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in, out, s)
}

View file

@ -1,577 +0,0 @@
// +build !ignore_autogenerated
/*
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 file was autogenerated by conversion-gen. Do not edit it manually!
package v2alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
unversioned "k8s.io/client-go/1.5/pkg/api/unversioned"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
batch "k8s.io/client-go/1.5/pkg/apis/batch"
conversion "k8s.io/client-go/1.5/pkg/conversion"
runtime "k8s.io/client-go/1.5/pkg/runtime"
)
func init() {
SchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v2alpha1_Job_To_batch_Job,
Convert_batch_Job_To_v2alpha1_Job,
Convert_v2alpha1_JobCondition_To_batch_JobCondition,
Convert_batch_JobCondition_To_v2alpha1_JobCondition,
Convert_v2alpha1_JobList_To_batch_JobList,
Convert_batch_JobList_To_v2alpha1_JobList,
Convert_v2alpha1_JobSpec_To_batch_JobSpec,
Convert_batch_JobSpec_To_v2alpha1_JobSpec,
Convert_v2alpha1_JobStatus_To_batch_JobStatus,
Convert_batch_JobStatus_To_v2alpha1_JobStatus,
Convert_v2alpha1_JobTemplate_To_batch_JobTemplate,
Convert_batch_JobTemplate_To_v2alpha1_JobTemplate,
Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec,
Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec,
Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector,
Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector,
Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement,
Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement,
Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob,
Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob,
Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList,
Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList,
Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec,
Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec,
Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus,
Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus,
)
}
func autoConvert_v2alpha1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error {
SetDefaults_Job(in)
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v2alpha1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v2alpha1_JobStatus_To_batch_JobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v2alpha1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error {
return autoConvert_v2alpha1_Job_To_batch_Job(in, out, s)
}
func autoConvert_batch_Job_To_v2alpha1_Job(in *batch.Job, out *Job, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_batch_JobSpec_To_v2alpha1_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_batch_JobStatus_To_v2alpha1_JobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_batch_Job_To_v2alpha1_Job(in *batch.Job, out *Job, s conversion.Scope) error {
return autoConvert_batch_Job_To_v2alpha1_Job(in, out, s)
}
func autoConvert_v2alpha1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error {
out.Type = batch.JobConditionType(in.Type)
out.Status = api.ConditionStatus(in.Status)
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
return err
}
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
return err
}
out.Reason = in.Reason
out.Message = in.Message
return nil
}
func Convert_v2alpha1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error {
return autoConvert_v2alpha1_JobCondition_To_batch_JobCondition(in, out, s)
}
func autoConvert_batch_JobCondition_To_v2alpha1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error {
out.Type = JobConditionType(in.Type)
out.Status = v1.ConditionStatus(in.Status)
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
return err
}
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
return err
}
out.Reason = in.Reason
out.Message = in.Message
return nil
}
func Convert_batch_JobCondition_To_v2alpha1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error {
return autoConvert_batch_JobCondition_To_v2alpha1_JobCondition(in, out, s)
}
func autoConvert_v2alpha1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]batch.Job, len(*in))
for i := range *in {
if err := Convert_v2alpha1_Job_To_batch_Job(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v2alpha1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error {
return autoConvert_v2alpha1_JobList_To_batch_JobList(in, out, s)
}
func autoConvert_batch_JobList_To_v2alpha1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Job, len(*in))
for i := range *in {
if err := Convert_batch_Job_To_v2alpha1_Job(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_batch_JobList_To_v2alpha1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error {
return autoConvert_batch_JobList_To_v2alpha1_JobList(in, out, s)
}
func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector
if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error {
out.Parallelism = in.Parallelism
out.Completions = in.Completions
out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(LabelSelector)
if err := Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(*in, *out, s); err != nil {
return err
}
} else {
out.Selector = nil
}
out.ManualSelector = in.ManualSelector
if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func autoConvert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error {
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]batch.JobCondition, len(*in))
for i := range *in {
if err := Convert_v2alpha1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
out.StartTime = in.StartTime
out.CompletionTime = in.CompletionTime
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
func Convert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error {
return autoConvert_v2alpha1_JobStatus_To_batch_JobStatus(in, out, s)
}
func autoConvert_batch_JobStatus_To_v2alpha1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error {
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]JobCondition, len(*in))
for i := range *in {
if err := Convert_batch_JobCondition_To_v2alpha1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
out.StartTime = in.StartTime
out.CompletionTime = in.CompletionTime
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
func Convert_batch_JobStatus_To_v2alpha1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error {
return autoConvert_batch_JobStatus_To_v2alpha1_JobStatus(in, out, s)
}
func autoConvert_v2alpha1_JobTemplate_To_batch_JobTemplate(in *JobTemplate, out *batch.JobTemplate, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func Convert_v2alpha1_JobTemplate_To_batch_JobTemplate(in *JobTemplate, out *batch.JobTemplate, s conversion.Scope) error {
return autoConvert_v2alpha1_JobTemplate_To_batch_JobTemplate(in, out, s)
}
func autoConvert_batch_JobTemplate_To_v2alpha1_JobTemplate(in *batch.JobTemplate, out *JobTemplate, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
return nil
}
func Convert_batch_JobTemplate_To_v2alpha1_JobTemplate(in *batch.JobTemplate, out *JobTemplate, s conversion.Scope) error {
return autoConvert_batch_JobTemplate_To_v2alpha1_JobTemplate(in, out, s)
}
func autoConvert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in *JobTemplateSpec, out *batch.JobTemplateSpec, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v2alpha1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
func Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in *JobTemplateSpec, out *batch.JobTemplateSpec, s conversion.Scope) error {
return autoConvert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in, out, s)
}
func autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemplateSpec, out *JobTemplateSpec, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_batch_JobSpec_To_v2alpha1_JobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
func Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemplateSpec, out *JobTemplateSpec, s conversion.Scope) error {
return autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in, out, s)
}
func autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]unversioned.LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error {
return autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in, out, s)
}
func autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
out.MatchLabels = in.MatchLabels
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
func Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in, out, s)
}
func autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = unversioned.LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s)
}
func autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
out.Key = in.Key
out.Operator = LabelSelectorOperator(in.Operator)
out.Values = in.Values
return nil
}
func Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error {
return autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in, out, s)
}
func autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error {
SetDefaults_ScheduledJob(in)
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error {
return autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in, out, s)
}
func autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, s conversion.Scope) error {
return autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in, out, s)
}
func autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]batch.ScheduledJob, len(*in))
for i := range *in {
if err := Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, s conversion.Scope) error {
return autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in, out, s)
}
func autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ScheduledJob, len(*in))
for i := range *in {
if err := Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, s conversion.Scope) error {
return autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in, out, s)
}
func autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error {
out.Schedule = in.Schedule
out.StartingDeadlineSeconds = in.StartingDeadlineSeconds
out.ConcurrencyPolicy = batch.ConcurrencyPolicy(in.ConcurrencyPolicy)
out.Suspend = in.Suspend
if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err
}
return nil
}
func Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error {
return autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in, out, s)
}
func autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error {
out.Schedule = in.Schedule
out.StartingDeadlineSeconds = in.StartingDeadlineSeconds
out.ConcurrencyPolicy = ConcurrencyPolicy(in.ConcurrencyPolicy)
out.Suspend = in.Suspend
if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err
}
return nil
}
func Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error {
return autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in, out, s)
}
func autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error {
if in.Active != nil {
in, out := &in.Active, &out.Active
*out = make([]api.ObjectReference, len(*in))
for i := range *in {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {
return err
}
}
} else {
out.Active = nil
}
out.LastScheduleTime = in.LastScheduleTime
return nil
}
func Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error {
return autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in, out, s)
}
func autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error {
if in.Active != nil {
in, out := &in.Active, &out.Active
*out = make([]v1.ObjectReference, len(*in))
for i := range *in {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {
return err
}
}
} else {
out.Active = nil
}
out.LastScheduleTime = in.LastScheduleTime
return nil
}
func Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error {
return autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in, out, s)
}

View file

@ -1,240 +0,0 @@
// +build !ignore_autogenerated
/*
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 file was autogenerated by conversion-gen. Do not edit it manually!
package v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
policy "k8s.io/client-go/1.5/pkg/apis/policy"
conversion "k8s.io/client-go/1.5/pkg/conversion"
runtime "k8s.io/client-go/1.5/pkg/runtime"
)
func init() {
SchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1alpha1_Eviction_To_policy_Eviction,
Convert_policy_Eviction_To_v1alpha1_Eviction,
Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget,
Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget,
Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList,
Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList,
Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec,
Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec,
Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus,
Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus,
)
}
func autoConvert_v1alpha1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if in.DeleteOptions != nil {
in, out := &in.DeleteOptions, &out.DeleteOptions
*out = new(api.DeleteOptions)
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(*in, *out, 0); err != nil {
return err
}
} else {
out.DeleteOptions = nil
}
return nil
}
func Convert_v1alpha1_Eviction_To_policy_Eviction(in *Eviction, out *policy.Eviction, s conversion.Scope) error {
return autoConvert_v1alpha1_Eviction_To_policy_Eviction(in, out, s)
}
func autoConvert_policy_Eviction_To_v1alpha1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if in.DeleteOptions != nil {
in, out := &in.DeleteOptions, &out.DeleteOptions
*out = new(v1.DeleteOptions)
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(*in, *out, 0); err != nil {
return err
}
} else {
out.DeleteOptions = nil
}
return nil
}
func Convert_policy_Eviction_To_v1alpha1_Eviction(in *policy.Eviction, out *Eviction, s conversion.Scope) error {
return autoConvert_policy_Eviction_To_v1alpha1_Eviction(in, out, s)
}
func autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error {
return autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in, out, s)
}
func autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error {
return autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in, out, s)
}
func autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]policy.PodDisruptionBudget, len(*in))
for i := range *in {
if err := Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error {
return autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in, out, s)
}
func autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PodDisruptionBudget, len(*in))
for i := range *in {
if err := Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error {
return autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in, out, s)
}
func autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error {
if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.MinAvailable, &out.MinAvailable, s); err != nil {
return err
}
out.Selector = in.Selector
return nil
}
func Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error {
return autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in, out, s)
}
func autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error {
if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.MinAvailable, &out.MinAvailable, s); err != nil {
return err
}
out.Selector = in.Selector
return nil
}
func Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error {
return autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in, out, s)
}
func autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error {
out.PodDisruptionAllowed = in.PodDisruptionAllowed
out.CurrentHealthy = in.CurrentHealthy
out.DesiredHealthy = in.DesiredHealthy
out.ExpectedPods = in.ExpectedPods
return nil
}
func Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error {
return autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in, out, s)
}
func autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error {
out.PodDisruptionAllowed = in.PodDisruptionAllowed
out.CurrentHealthy = in.CurrentHealthy
out.DesiredHealthy = in.DesiredHealthy
out.ExpectedPods = in.ExpectedPods
return nil
}
func Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error {
return autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in, out, s)
}

View file

@ -1,56 +0,0 @@
/*
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 serializer
import (
"k8s.io/client-go/1.5/pkg/runtime"
)
// TODO: We should figure out what happens when someone asks
// encoder for version and it conflicts with the raw serializer.
type negotiatedSerializerWrapper struct {
info runtime.SerializerInfo
streamInfo runtime.StreamSerializerInfo
}
func NegotiatedSerializerWrapper(info runtime.SerializerInfo, streamInfo runtime.StreamSerializerInfo) runtime.NegotiatedSerializer {
return &negotiatedSerializerWrapper{info, streamInfo}
}
func (n *negotiatedSerializerWrapper) SupportedMediaTypes() []string {
return []string{}
}
func (n *negotiatedSerializerWrapper) SerializerForMediaType(mediaType string, options map[string]string) (runtime.SerializerInfo, bool) {
return n.info, true
}
func (n *negotiatedSerializerWrapper) SupportedStreamingMediaTypes() []string {
return []string{}
}
func (n *negotiatedSerializerWrapper) StreamingSerializerForMediaType(mediaType string, options map[string]string) (runtime.StreamSerializerInfo, bool) {
return n.streamInfo, true
}
func (n *negotiatedSerializerWrapper) EncoderForVersion(e runtime.Encoder, _ runtime.GroupVersioner) runtime.Encoder {
return e
}
func (n *negotiatedSerializerWrapper) DecoderToVersion(d runtime.Decoder, _gv runtime.GroupVersioner) runtime.Decoder {
return d
}

View file

@ -1,56 +0,0 @@
/*
Copyright 2014 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 util
// StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not.
type StringFlag struct {
// If Set has been invoked this value is true
provided bool
// The exact value provided on the flag
value string
}
func NewStringFlag(defaultVal string) StringFlag {
return StringFlag{value: defaultVal}
}
func (f *StringFlag) Default(value string) {
f.value = value
}
func (f StringFlag) String() string {
return f.value
}
func (f StringFlag) Value() string {
return f.value
}
func (f *StringFlag) Set(value string) error {
f.value = value
f.provided = true
return nil
}
func (f StringFlag) Provided() bool {
return f.provided
}
func (f *StringFlag) Type() string {
return "string"
}

View file

@ -1,105 +0,0 @@
/*
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 gcp
import (
"net/http"
"time"
"github.com/golang/glog"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"k8s.io/client-go/1.5/rest"
)
func init() {
if err := rest.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil {
glog.Fatalf("Failed to register gcp auth plugin: %v", err)
}
}
type gcpAuthProvider struct {
tokenSource oauth2.TokenSource
persister rest.AuthProviderConfigPersister
}
func newGCPAuthProvider(_ string, gcpConfig map[string]string, persister rest.AuthProviderConfigPersister) (rest.AuthProvider, error) {
ts, err := newCachedTokenSource(gcpConfig["access-token"], gcpConfig["expiry"], persister)
if err != nil {
return nil, err
}
return &gcpAuthProvider{ts, persister}, nil
}
func (g *gcpAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper {
return &oauth2.Transport{
Source: g.tokenSource,
Base: rt,
}
}
func (g *gcpAuthProvider) Login() error { return nil }
type cachedTokenSource struct {
source oauth2.TokenSource
accessToken string
expiry time.Time
persister rest.AuthProviderConfigPersister
}
func newCachedTokenSource(accessToken, expiry string, persister rest.AuthProviderConfigPersister) (*cachedTokenSource, error) {
var expiryTime time.Time
if parsedTime, err := time.Parse(time.RFC3339Nano, expiry); err == nil {
expiryTime = parsedTime
}
ts, err := google.DefaultTokenSource(context.Background(), "https://www.googleapis.com/auth/cloud-platform")
if err != nil {
return nil, err
}
return &cachedTokenSource{
source: ts,
accessToken: accessToken,
expiry: expiryTime,
persister: persister,
}, nil
}
func (t *cachedTokenSource) Token() (*oauth2.Token, error) {
tok := &oauth2.Token{
AccessToken: t.accessToken,
TokenType: "Bearer",
Expiry: t.expiry,
}
if tok.Valid() && !tok.Expiry.IsZero() {
return tok, nil
}
tok, err := t.source.Token()
if err != nil {
return nil, err
}
if t.persister != nil {
cached := map[string]string{
"access-token": tok.AccessToken,
"expiry": tok.Expiry.Format(time.RFC3339Nano),
}
if err := t.persister.Persist(cached); err != nil {
glog.V(4).Infof("Failed to persist token: %v", err)
}
}
return tok, nil
}

View file

@ -1,270 +0,0 @@
/*
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 oidc
import (
"encoding/base64"
"errors"
"fmt"
"net/http"
"strings"
"time"
"github.com/coreos/go-oidc/jose"
"github.com/coreos/go-oidc/oauth2"
"github.com/coreos/go-oidc/oidc"
"github.com/golang/glog"
"k8s.io/client-go/1.5/pkg/util/wait"
"k8s.io/client-go/1.5/rest"
)
const (
cfgIssuerUrl = "idp-issuer-url"
cfgClientID = "client-id"
cfgClientSecret = "client-secret"
cfgCertificateAuthority = "idp-certificate-authority"
cfgCertificateAuthorityData = "idp-certificate-authority-data"
cfgExtraScopes = "extra-scopes"
cfgIDToken = "id-token"
cfgRefreshToken = "refresh-token"
)
var (
backoff = wait.Backoff{
Duration: 1 * time.Second,
Factor: 2,
Jitter: .1,
Steps: 5,
}
)
func init() {
if err := rest.RegisterAuthProviderPlugin("oidc", newOIDCAuthProvider); err != nil {
glog.Fatalf("Failed to register oidc auth plugin: %v", err)
}
}
func newOIDCAuthProvider(_ string, cfg map[string]string, persister rest.AuthProviderConfigPersister) (rest.AuthProvider, error) {
issuer := cfg[cfgIssuerUrl]
if issuer == "" {
return nil, fmt.Errorf("Must provide %s", cfgIssuerUrl)
}
clientID := cfg[cfgClientID]
if clientID == "" {
return nil, fmt.Errorf("Must provide %s", cfgClientID)
}
clientSecret := cfg[cfgClientSecret]
if clientSecret == "" {
return nil, fmt.Errorf("Must provide %s", cfgClientSecret)
}
var certAuthData []byte
var err error
if cfg[cfgCertificateAuthorityData] != "" {
certAuthData, err = base64.StdEncoding.DecodeString(cfg[cfgCertificateAuthorityData])
if err != nil {
return nil, err
}
}
clientConfig := rest.Config{
TLSClientConfig: rest.TLSClientConfig{
CAFile: cfg[cfgCertificateAuthority],
CAData: certAuthData,
},
}
trans, err := rest.TransportFor(&clientConfig)
if err != nil {
return nil, err
}
hc := &http.Client{Transport: trans}
providerCfg, err := oidc.FetchProviderConfig(hc, issuer)
if err != nil {
return nil, fmt.Errorf("error fetching provider config: %v", err)
}
scopes := strings.Split(cfg[cfgExtraScopes], ",")
oidcCfg := oidc.ClientConfig{
HTTPClient: hc,
Credentials: oidc.ClientCredentials{
ID: clientID,
Secret: clientSecret,
},
ProviderConfig: providerCfg,
Scope: append(scopes, oidc.DefaultScope...),
}
client, err := oidc.NewClient(oidcCfg)
if err != nil {
return nil, fmt.Errorf("error creating OIDC Client: %v", err)
}
oClient := &oidcClient{client}
var initialIDToken jose.JWT
if cfg[cfgIDToken] != "" {
initialIDToken, err = jose.ParseJWT(cfg[cfgIDToken])
if err != nil {
return nil, err
}
}
return &oidcAuthProvider{
initialIDToken: initialIDToken,
refresher: &idTokenRefresher{
client: oClient,
cfg: cfg,
persister: persister,
},
}, nil
}
type oidcAuthProvider struct {
refresher *idTokenRefresher
initialIDToken jose.JWT
}
func (g *oidcAuthProvider) WrapTransport(rt http.RoundTripper) http.RoundTripper {
at := &oidc.AuthenticatedTransport{
TokenRefresher: g.refresher,
RoundTripper: rt,
}
at.SetJWT(g.initialIDToken)
return &roundTripper{
wrapped: at,
refresher: g.refresher,
}
}
func (g *oidcAuthProvider) Login() error {
return errors.New("not yet implemented")
}
type OIDCClient interface {
refreshToken(rt string) (oauth2.TokenResponse, error)
verifyJWT(jwt jose.JWT) error
}
type roundTripper struct {
refresher *idTokenRefresher
wrapped *oidc.AuthenticatedTransport
}
func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
var res *http.Response
var err error
firstTime := true
wait.ExponentialBackoff(backoff, func() (bool, error) {
if !firstTime {
var jwt jose.JWT
jwt, err = r.refresher.Refresh()
if err != nil {
return true, nil
}
r.wrapped.SetJWT(jwt)
} else {
firstTime = false
}
res, err = r.wrapped.RoundTrip(req)
if err != nil {
return true, nil
}
if res.StatusCode == http.StatusUnauthorized {
return false, nil
}
return true, nil
})
return res, err
}
type idTokenRefresher struct {
cfg map[string]string
client OIDCClient
persister rest.AuthProviderConfigPersister
intialIDToken jose.JWT
}
func (r *idTokenRefresher) Verify(jwt jose.JWT) error {
claims, err := jwt.Claims()
if err != nil {
return err
}
now := time.Now()
exp, ok, err := claims.TimeClaim("exp")
switch {
case err != nil:
return fmt.Errorf("failed to parse 'exp' claim: %v", err)
case !ok:
return errors.New("missing required 'exp' claim")
case exp.Before(now):
return fmt.Errorf("token already expired at: %v", exp)
}
return nil
}
func (r *idTokenRefresher) Refresh() (jose.JWT, error) {
rt, ok := r.cfg[cfgRefreshToken]
if !ok {
return jose.JWT{}, errors.New("No valid id-token, and cannot refresh without refresh-token")
}
tokens, err := r.client.refreshToken(rt)
if err != nil {
return jose.JWT{}, fmt.Errorf("could not refresh token: %v", err)
}
jwt, err := jose.ParseJWT(tokens.IDToken)
if err != nil {
return jose.JWT{}, err
}
if tokens.RefreshToken != "" && tokens.RefreshToken != rt {
r.cfg[cfgRefreshToken] = tokens.RefreshToken
}
r.cfg[cfgIDToken] = jwt.Encode()
err = r.persister.Persist(r.cfg)
if err != nil {
return jose.JWT{}, fmt.Errorf("could not perist new tokens: %v", err)
}
return jwt, r.client.verifyJWT(jwt)
}
type oidcClient struct {
client *oidc.Client
}
func (o *oidcClient) refreshToken(rt string) (oauth2.TokenResponse, error) {
oac, err := o.client.OAuthClient()
if err != nil {
return oauth2.TokenResponse{}, err
}
return oac.RequestToken(oauth2.GrantTypeRefreshToken, rt)
}
func (o *oidcClient) verifyJWT(jwt jose.JWT) error {
return o.client.VerifyJWT(jwt)
}

View file

@ -1,668 +0,0 @@
/*
Copyright 2014 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 cache
import (
"fmt"
"github.com/golang/glog"
"k8s.io/client-go/1.5/pkg/api"
"k8s.io/client-go/1.5/pkg/api/errors"
"k8s.io/client-go/1.5/pkg/api/meta"
"k8s.io/client-go/1.5/pkg/api/unversioned"
"k8s.io/client-go/1.5/pkg/apis/apps"
"k8s.io/client-go/1.5/pkg/apis/batch"
"k8s.io/client-go/1.5/pkg/apis/certificates"
"k8s.io/client-go/1.5/pkg/apis/extensions"
"k8s.io/client-go/1.5/pkg/apis/policy"
"k8s.io/client-go/1.5/pkg/labels"
)
// AppendFunc is used to add a matching item to whatever list the caller is using
type AppendFunc func(interface{})
func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error {
for _, m := range store.List() {
metadata, err := meta.Accessor(m)
if err != nil {
return err
}
if selector.Matches(labels.Set(metadata.GetLabels())) {
appendFn(m)
}
}
return nil
}
func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selector, appendFn AppendFunc) error {
if namespace == api.NamespaceAll {
for _, m := range indexer.List() {
metadata, err := meta.Accessor(m)
if err != nil {
return err
}
if selector.Matches(labels.Set(metadata.GetLabels())) {
appendFn(m)
}
}
return nil
}
items, err := indexer.Index(NamespaceIndex, api.ObjectMeta{Namespace: namespace})
if err != nil {
// Ignore error; do slow search without index.
glog.Warningf("can not retrieve list of objects using index : %v", err)
for _, m := range indexer.List() {
metadata, err := meta.Accessor(m)
if err != nil {
return err
}
if metadata.GetNamespace() == namespace && selector.Matches(labels.Set(metadata.GetLabels())) {
appendFn(m)
}
}
return nil
}
for _, m := range items {
metadata, err := meta.Accessor(m)
if err != nil {
return err
}
if selector.Matches(labels.Set(metadata.GetLabels())) {
appendFn(m)
}
}
return nil
}
// TODO: generate these classes and methods for all resources of interest using
// a script. Can use "go generate" once 1.4 is supported by all users.
// NodeConditionPredicate is a function that indicates whether the given node's conditions meet
// some set of criteria defined by the function.
type NodeConditionPredicate func(node *api.Node) bool
// StoreToNodeLister makes a Store have the List method of the client.NodeInterface
// The Store must contain (only) Nodes.
type StoreToNodeLister struct {
Store
}
func (s *StoreToNodeLister) List() (machines api.NodeList, err error) {
for _, m := range s.Store.List() {
machines.Items = append(machines.Items, *(m.(*api.Node)))
}
return machines, nil
}
// NodeCondition returns a storeToNodeConditionLister
func (s *StoreToNodeLister) NodeCondition(predicate NodeConditionPredicate) storeToNodeConditionLister {
// TODO: Move this filtering server side. Currently our selectors don't facilitate searching through a list so we
// have the reflector filter out the Unschedulable field and sift through node conditions in the lister.
return storeToNodeConditionLister{s.Store, predicate}
}
// storeToNodeConditionLister filters and returns nodes matching the given type and status from the store.
type storeToNodeConditionLister struct {
store Store
predicate NodeConditionPredicate
}
// List returns a list of nodes that match the conditions defined by the predicate functions in the storeToNodeConditionLister.
func (s storeToNodeConditionLister) List() (nodes []*api.Node, err error) {
for _, m := range s.store.List() {
node := m.(*api.Node)
if s.predicate(node) {
nodes = append(nodes, node)
} else {
glog.V(5).Infof("Node %s matches none of the conditions", node.Name)
}
}
return
}
// StoreToDeploymentLister gives a store List and Exists methods. The store must contain only Deployments.
type StoreToDeploymentLister struct {
Indexer
}
// Exists checks if the given deployment exists in the store.
func (s *StoreToDeploymentLister) Exists(deployment *extensions.Deployment) (bool, error) {
_, exists, err := s.Indexer.Get(deployment)
if err != nil {
return false, err
}
return exists, nil
}
// StoreToDeploymentLister lists all deployments in the store.
// TODO: converge on the interface in pkg/client
func (s *StoreToDeploymentLister) List() (deployments []extensions.Deployment, err error) {
for _, c := range s.Indexer.List() {
deployments = append(deployments, *(c.(*extensions.Deployment)))
}
return deployments, nil
}
// GetDeploymentsForReplicaSet returns a list of deployments managing a replica set. Returns an error only if no matching deployments are found.
func (s *StoreToDeploymentLister) GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) (deployments []extensions.Deployment, err error) {
if len(rs.Labels) == 0 {
err = fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name)
return
}
// TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label
dList, err := s.Deployments(rs.Namespace).List(labels.Everything())
if err != nil {
return
}
for _, d := range dList {
selector, err := unversioned.LabelSelectorAsSelector(d.Spec.Selector)
if err != nil {
return nil, fmt.Errorf("invalid label selector: %v", err)
}
// If a deployment with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) {
continue
}
deployments = append(deployments, d)
}
if len(deployments) == 0 {
err = fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels)
}
return
}
type storeToDeploymentNamespacer struct {
indexer Indexer
namespace string
}
// storeToDeploymentNamespacer lists deployments under its namespace in the store.
func (s storeToDeploymentNamespacer) List(selector labels.Selector) (deployments []extensions.Deployment, err error) {
if s.namespace == api.NamespaceAll {
for _, m := range s.indexer.List() {
d := *(m.(*extensions.Deployment))
if selector.Matches(labels.Set(d.Labels)) {
deployments = append(deployments, d)
}
}
return
}
key := &extensions.Deployment{ObjectMeta: api.ObjectMeta{Namespace: s.namespace}}
items, err := s.indexer.Index(NamespaceIndex, key)
if err != nil {
// Ignore error; do slow search without index.
glog.Warningf("can not retrieve list of objects using index : %v", err)
for _, m := range s.indexer.List() {
d := *(m.(*extensions.Deployment))
if s.namespace == d.Namespace && selector.Matches(labels.Set(d.Labels)) {
deployments = append(deployments, d)
}
}
return deployments, nil
}
for _, m := range items {
d := *(m.(*extensions.Deployment))
if selector.Matches(labels.Set(d.Labels)) {
deployments = append(deployments, d)
}
}
return
}
func (s *StoreToDeploymentLister) Deployments(namespace string) storeToDeploymentNamespacer {
return storeToDeploymentNamespacer{s.Indexer, namespace}
}
// GetDeploymentsForPods returns a list of deployments managing a pod. Returns an error only if no matching deployments are found.
func (s *StoreToDeploymentLister) GetDeploymentsForPod(pod *api.Pod) (deployments []extensions.Deployment, err error) {
if len(pod.Labels) == 0 {
err = fmt.Errorf("no deployments found for Pod %v because it has no labels", pod.Name)
return
}
if len(pod.Labels[extensions.DefaultDeploymentUniqueLabelKey]) == 0 {
return
}
dList, err := s.Deployments(pod.Namespace).List(labels.Everything())
if err != nil {
return
}
for _, d := range dList {
selector, err := unversioned.LabelSelectorAsSelector(d.Spec.Selector)
if err != nil {
return nil, fmt.Errorf("invalid label selector: %v", err)
}
// If a deployment with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
deployments = append(deployments, d)
}
if len(deployments) == 0 {
err = fmt.Errorf("could not find deployments set for Pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}
// StoreToReplicaSetLister gives a store List and Exists methods. The store must contain only ReplicaSets.
type StoreToReplicaSetLister struct {
Store
}
// Exists checks if the given ReplicaSet exists in the store.
func (s *StoreToReplicaSetLister) Exists(rs *extensions.ReplicaSet) (bool, error) {
_, exists, err := s.Store.Get(rs)
if err != nil {
return false, err
}
return exists, nil
}
// List lists all ReplicaSets in the store.
// TODO: converge on the interface in pkg/client
func (s *StoreToReplicaSetLister) List() (rss []extensions.ReplicaSet, err error) {
for _, rs := range s.Store.List() {
rss = append(rss, *(rs.(*extensions.ReplicaSet)))
}
return rss, nil
}
type storeReplicaSetsNamespacer struct {
store Store
namespace string
}
func (s storeReplicaSetsNamespacer) List(selector labels.Selector) (rss []extensions.ReplicaSet, err error) {
for _, c := range s.store.List() {
rs := *(c.(*extensions.ReplicaSet))
if s.namespace == api.NamespaceAll || s.namespace == rs.Namespace {
if selector.Matches(labels.Set(rs.Labels)) {
rss = append(rss, rs)
}
}
}
return
}
func (s storeReplicaSetsNamespacer) Get(name string) (*extensions.ReplicaSet, error) {
obj, exists, err := s.store.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(extensions.Resource("replicaset"), name)
}
return obj.(*extensions.ReplicaSet), nil
}
func (s *StoreToReplicaSetLister) ReplicaSets(namespace string) storeReplicaSetsNamespacer {
return storeReplicaSetsNamespacer{s.Store, namespace}
}
// GetPodReplicaSets returns a list of ReplicaSets managing a pod. Returns an error only if no matching ReplicaSets are found.
func (s *StoreToReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error) {
var selector labels.Selector
var rs extensions.ReplicaSet
if len(pod.Labels) == 0 {
err = fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name)
return
}
for _, m := range s.Store.List() {
rs = *m.(*extensions.ReplicaSet)
if rs.Namespace != pod.Namespace {
continue
}
selector, err = unversioned.LabelSelectorAsSelector(rs.Spec.Selector)
if err != nil {
err = fmt.Errorf("invalid selector: %v", err)
return
}
// If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
rss = append(rss, rs)
}
if len(rss) == 0 {
err = fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}
// StoreToDaemonSetLister gives a store List and Exists methods. The store must contain only DaemonSets.
type StoreToDaemonSetLister struct {
Store
}
// Exists checks if the given daemon set exists in the store.
func (s *StoreToDaemonSetLister) Exists(ds *extensions.DaemonSet) (bool, error) {
_, exists, err := s.Store.Get(ds)
if err != nil {
return false, err
}
return exists, nil
}
// List lists all daemon sets in the store.
// TODO: converge on the interface in pkg/client
func (s *StoreToDaemonSetLister) List() (dss extensions.DaemonSetList, err error) {
for _, c := range s.Store.List() {
dss.Items = append(dss.Items, *(c.(*extensions.DaemonSet)))
}
return dss, nil
}
// GetPodDaemonSets returns a list of daemon sets managing a pod.
// Returns an error if and only if no matching daemon sets are found.
func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []extensions.DaemonSet, err error) {
var selector labels.Selector
var daemonSet extensions.DaemonSet
if len(pod.Labels) == 0 {
err = fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name)
return
}
for _, m := range s.Store.List() {
daemonSet = *m.(*extensions.DaemonSet)
if daemonSet.Namespace != pod.Namespace {
continue
}
selector, err = unversioned.LabelSelectorAsSelector(daemonSet.Spec.Selector)
if err != nil {
// this should not happen if the DaemonSet passed validation
return nil, err
}
// If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
daemonSets = append(daemonSets, daemonSet)
}
if len(daemonSets) == 0 {
err = fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}
// StoreToEndpointsLister makes a Store that lists endpoints.
type StoreToEndpointsLister struct {
Store
}
// List lists all endpoints in the store.
func (s *StoreToEndpointsLister) List() (services api.EndpointsList, err error) {
for _, m := range s.Store.List() {
services.Items = append(services.Items, *(m.(*api.Endpoints)))
}
return services, nil
}
// GetServiceEndpoints returns the endpoints of a service, matched on service name.
func (s *StoreToEndpointsLister) GetServiceEndpoints(svc *api.Service) (ep api.Endpoints, err error) {
for _, m := range s.Store.List() {
ep = *m.(*api.Endpoints)
if svc.Name == ep.Name && svc.Namespace == ep.Namespace {
return ep, nil
}
}
err = fmt.Errorf("could not find endpoints for service: %v", svc.Name)
return
}
// StoreToJobLister gives a store List and Exists methods. The store must contain only Jobs.
type StoreToJobLister struct {
Store
}
// Exists checks if the given job exists in the store.
func (s *StoreToJobLister) Exists(job *batch.Job) (bool, error) {
_, exists, err := s.Store.Get(job)
if err != nil {
return false, err
}
return exists, nil
}
// StoreToJobLister lists all jobs in the store.
func (s *StoreToJobLister) List() (jobs batch.JobList, err error) {
for _, c := range s.Store.List() {
jobs.Items = append(jobs.Items, *(c.(*batch.Job)))
}
return jobs, nil
}
// GetPodJobs returns a list of jobs managing a pod. Returns an error only if no matching jobs are found.
func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []batch.Job, err error) {
var selector labels.Selector
var job batch.Job
if len(pod.Labels) == 0 {
err = fmt.Errorf("no jobs found for pod %v because it has no labels", pod.Name)
return
}
for _, m := range s.Store.List() {
job = *m.(*batch.Job)
if job.Namespace != pod.Namespace {
continue
}
selector, _ = unversioned.LabelSelectorAsSelector(job.Spec.Selector)
if !selector.Matches(labels.Set(pod.Labels)) {
continue
}
jobs = append(jobs, job)
}
if len(jobs) == 0 {
err = fmt.Errorf("could not find jobs for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}
// Typed wrapper around a store of PersistentVolumes
type StoreToPVFetcher struct {
Store
}
// GetPersistentVolumeInfo returns cached data for the PersistentVolume 'id'.
func (s *StoreToPVFetcher) GetPersistentVolumeInfo(id string) (*api.PersistentVolume, error) {
o, exists, err := s.Get(&api.PersistentVolume{ObjectMeta: api.ObjectMeta{Name: id}})
if err != nil {
return nil, fmt.Errorf("error retrieving PersistentVolume '%v' from cache: %v", id, err)
}
if !exists {
return nil, fmt.Errorf("PersistentVolume '%v' not found", id)
}
return o.(*api.PersistentVolume), nil
}
// Typed wrapper around a store of PersistentVolumeClaims
type StoreToPVCFetcher struct {
Store
}
// GetPersistentVolumeClaimInfo returns cached data for the PersistentVolumeClaim 'id'.
func (s *StoreToPVCFetcher) GetPersistentVolumeClaimInfo(namespace string, id string) (*api.PersistentVolumeClaim, error) {
o, exists, err := s.Get(&api.PersistentVolumeClaim{ObjectMeta: api.ObjectMeta{Namespace: namespace, Name: id}})
if err != nil {
return nil, fmt.Errorf("error retrieving PersistentVolumeClaim '%s/%s' from cache: %v", namespace, id, err)
}
if !exists {
return nil, fmt.Errorf("PersistentVolumeClaim '%s/%s' not found", namespace, id)
}
return o.(*api.PersistentVolumeClaim), nil
}
// StoreToPetSetLister gives a store List and Exists methods. The store must contain only PetSets.
type StoreToPetSetLister struct {
Store
}
// Exists checks if the given PetSet exists in the store.
func (s *StoreToPetSetLister) Exists(ps *apps.PetSet) (bool, error) {
_, exists, err := s.Store.Get(ps)
if err != nil {
return false, err
}
return exists, nil
}
// List lists all PetSets in the store.
func (s *StoreToPetSetLister) List() (psList []apps.PetSet, err error) {
for _, ps := range s.Store.List() {
psList = append(psList, *(ps.(*apps.PetSet)))
}
return psList, nil
}
type storePetSetsNamespacer struct {
store Store
namespace string
}
func (s *StoreToPetSetLister) PetSets(namespace string) storePetSetsNamespacer {
return storePetSetsNamespacer{s.Store, namespace}
}
// GetPodPetSets returns a list of PetSets managing a pod. Returns an error only if no matching PetSets are found.
func (s *StoreToPetSetLister) GetPodPetSets(pod *api.Pod) (psList []apps.PetSet, err error) {
var selector labels.Selector
var ps apps.PetSet
if len(pod.Labels) == 0 {
err = fmt.Errorf("no PetSets found for pod %v because it has no labels", pod.Name)
return
}
for _, m := range s.Store.List() {
ps = *m.(*apps.PetSet)
if ps.Namespace != pod.Namespace {
continue
}
selector, err = unversioned.LabelSelectorAsSelector(ps.Spec.Selector)
if err != nil {
err = fmt.Errorf("invalid selector: %v", err)
return
}
// If a PetSet with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
psList = append(psList, ps)
}
if len(psList) == 0 {
err = fmt.Errorf("could not find PetSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}
// StoreToCertificateRequestLister gives a store List and Exists methods. The store must contain only CertificateRequests.
type StoreToCertificateRequestLister struct {
Store
}
// Exists checks if the given csr exists in the store.
func (s *StoreToCertificateRequestLister) Exists(csr *certificates.CertificateSigningRequest) (bool, error) {
_, exists, err := s.Store.Get(csr)
if err != nil {
return false, err
}
return exists, nil
}
// StoreToCertificateRequestLister lists all csrs in the store.
func (s *StoreToCertificateRequestLister) List() (csrs certificates.CertificateSigningRequestList, err error) {
for _, c := range s.Store.List() {
csrs.Items = append(csrs.Items, *(c.(*certificates.CertificateSigningRequest)))
}
return csrs, nil
}
// IndexerToNamespaceLister gives an Indexer List method
type IndexerToNamespaceLister struct {
Indexer
}
// List returns a list of namespaces
func (i *IndexerToNamespaceLister) List(selector labels.Selector) (namespaces []*api.Namespace, err error) {
for _, m := range i.Indexer.List() {
namespace := m.(*api.Namespace)
if selector.Matches(labels.Set(namespace.Labels)) {
namespaces = append(namespaces, namespace)
}
}
return namespaces, nil
}
type StoreToPodDisruptionBudgetLister struct {
Store
}
// GetPodPodDisruptionBudgets returns a list of PodDisruptionBudgets matching a pod. Returns an error only if no matching PodDisruptionBudgets are found.
func (s *StoreToPodDisruptionBudgetLister) GetPodPodDisruptionBudgets(pod *api.Pod) (pdbList []policy.PodDisruptionBudget, err error) {
var selector labels.Selector
if len(pod.Labels) == 0 {
err = fmt.Errorf("no PodDisruptionBudgets found for pod %v because it has no labels", pod.Name)
return
}
for _, m := range s.Store.List() {
pdb, ok := m.(*policy.PodDisruptionBudget)
if !ok {
glog.Errorf("Unexpected: %v is not a PodDisruptionBudget", m)
continue
}
if pdb.Namespace != pod.Namespace {
continue
}
selector, err = unversioned.LabelSelectorAsSelector(pdb.Spec.Selector)
if err != nil {
glog.Warningf("invalid selector: %v", err)
// TODO(mml): add an event to the PDB
continue
}
// If a PDB with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
pdbList = append(pdbList, *pdb)
}
if len(pdbList) == 0 {
err = fmt.Errorf("could not find PodDisruptionBudget for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return
}

View file

@ -25,25 +25,35 @@ import (
"github.com/emicklei/go-restful/swagger"
"k8s.io/client-go/1.5/pkg/api"
"k8s.io/client-go/1.5/pkg/api/errors"
"k8s.io/client-go/1.5/pkg/api/unversioned"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/pkg/runtime"
"k8s.io/client-go/1.5/pkg/runtime/serializer"
"k8s.io/client-go/1.5/pkg/version"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/pkg/runtime/serializer"
"k8s.io/client-go/pkg/version"
"k8s.io/client-go/rest"
)
// DiscoveryInterface holds the methods that discover server-supported API groups,
// versions and resources.
type DiscoveryInterface interface {
RESTClient() rest.Interface
ServerGroupsInterface
ServerResourcesInterface
ServerVersionInterface
SwaggerSchemaInterface
}
// CachedDiscoveryInterface is a DiscoveryInterface with cache invalidation and freshness.
type CachedDiscoveryInterface interface {
DiscoveryInterface
// Fresh returns true if no cached data was used that had been retrieved before the instantiation.
Fresh() bool
// Invalidate enforces that no cached data is used in the future that is older than the current time.
Invalidate()
}
// ServerGroupsInterface has methods for obtaining supported groups on the API server
type ServerGroupsInterface interface {
// ServerGroups returns the supported groups, with information like supported versions and the
@ -80,7 +90,7 @@ type SwaggerSchemaInterface interface {
// DiscoveryClient implements the functions that discover server-supported API groups,
// versions and resources.
type DiscoveryClient struct {
*rest.RESTClient
restClient rest.Interface
LegacyPrefix string
}
@ -107,7 +117,7 @@ func apiVersionsToAPIGroup(apiVersions *unversioned.APIVersions) (apiGroup unver
func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList, err error) {
// Get the groupVersions exposed at /api
v := &unversioned.APIVersions{}
err = d.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
apiGroup := unversioned.APIGroup{}
if err == nil {
apiGroup = apiVersionsToAPIGroup(v)
@ -118,7 +128,7 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList
// Get the groupVersions exposed at /apis
apiGroupList = &unversioned.APIGroupList{}
err = d.Get().AbsPath("/apis").Do().Into(apiGroupList)
err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList)
if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
return nil, err
}
@ -144,7 +154,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r
url.Path = "/apis/" + groupVersion
}
resources = &unversioned.APIResourceList{}
err = d.Get().AbsPath(url.String()).Do().Into(resources)
err = d.restClient.Get().AbsPath(url.String()).Do().Into(resources)
if err != nil {
// ignore 403 or 404 error to be compatible with an v1.0 server.
if groupVersion == "v1" && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
@ -199,39 +209,63 @@ func IsGroupDiscoveryFailedError(err error) bool {
// serverPreferredResources returns the supported resources with the version preferred by the
// server. If namespaced is true, only namespaced resources will be returned.
func (d *DiscoveryClient) serverPreferredResources(namespaced bool) ([]unversioned.GroupVersionResource, error) {
results := []unversioned.GroupVersionResource{}
serverGroupList, err := d.ServerGroups()
if err != nil {
return results, err
}
// retry in case the groups supported by the server change after ServerGroup() returns.
const maxRetries = 2
var failedGroups map[unversioned.GroupVersion]error
for _, apiGroup := range serverGroupList.Groups {
preferredVersion := apiGroup.PreferredVersion
groupVersion := unversioned.GroupVersion{Group: apiGroup.Name, Version: preferredVersion.Version}
apiResourceList, err := d.ServerResourcesForGroupVersion(preferredVersion.GroupVersion)
var results []unversioned.GroupVersionResource
var resources map[unversioned.GroupResource]string
RetrieveGroups:
for i := 0; i < maxRetries; i++ {
results = []unversioned.GroupVersionResource{}
resources = map[unversioned.GroupResource]string{}
failedGroups = make(map[unversioned.GroupVersion]error)
serverGroupList, err := d.ServerGroups()
if err != nil {
if failedGroups == nil {
failedGroups = make(map[unversioned.GroupVersion]error)
}
failedGroups[groupVersion] = err
continue
return results, err
}
for _, apiResource := range apiResourceList.APIResources {
// ignore the root scoped resources if "namespaced" is true.
if namespaced && !apiResource.Namespaced {
continue
for _, apiGroup := range serverGroupList.Groups {
versions := apiGroup.Versions
for _, version := range versions {
groupVersion := unversioned.GroupVersion{Group: apiGroup.Name, Version: version.Version}
apiResourceList, err := d.ServerResourcesForGroupVersion(version.GroupVersion)
if err != nil {
if i < maxRetries-1 {
continue RetrieveGroups
}
failedGroups[groupVersion] = err
continue
}
for _, apiResource := range apiResourceList.APIResources {
// ignore the root scoped resources if "namespaced" is true.
if namespaced && !apiResource.Namespaced {
continue
}
if strings.Contains(apiResource.Name, "/") {
continue
}
gvr := groupVersion.WithResource(apiResource.Name)
if _, ok := resources[gvr.GroupResource()]; ok {
if gvr.Version != apiGroup.PreferredVersion.Version {
continue
}
// remove previous entry, because it will be replaced with a preferred one
for i := range results {
if results[i].GroupResource() == gvr.GroupResource() {
results = append(results[:i], results[i+1:]...)
}
}
}
resources[gvr.GroupResource()] = gvr.Version
results = append(results, gvr)
}
}
if strings.Contains(apiResource.Name, "/") {
continue
}
results = append(results, groupVersion.WithResource(apiResource.Name))
}
if len(failedGroups) == 0 {
return results, nil
}
}
if len(failedGroups) > 0 {
return results, &ErrGroupDiscoveryFailed{Groups: failedGroups}
}
return results, nil
return results, &ErrGroupDiscoveryFailed{Groups: failedGroups}
}
// ServerPreferredResources returns the supported resources with the version preferred by the
@ -248,7 +282,7 @@ func (d *DiscoveryClient) ServerPreferredNamespacedResources() ([]unversioned.Gr
// ServerVersion retrieves and parses the server's version (git version).
func (d *DiscoveryClient) ServerVersion() (*version.Info, error) {
body, err := d.Get().AbsPath("/version").Do().Raw()
body, err := d.restClient.Get().AbsPath("/version").Do().Raw()
if err != nil {
return nil, err
}
@ -282,7 +316,7 @@ func (d *DiscoveryClient) SwaggerSchema(version unversioned.GroupVersion) (*swag
path = "/swaggerapi/apis/" + version.Group + "/" + version.Version
}
body, err := d.Get().AbsPath(path).Do().Raw()
body, err := d.restClient.Get().AbsPath(path).Do().Raw()
if err != nil {
return nil, err
}
@ -298,10 +332,7 @@ func setDiscoveryDefaults(config *rest.Config) error {
config.APIPath = ""
config.GroupVersion = nil
codec := runtime.NoopEncoder{Decoder: api.Codecs.UniversalDecoder()}
config.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(
runtime.SerializerInfo{Serializer: codec},
runtime.StreamSerializerInfo{},
)
config.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec})
if len(config.UserAgent) == 0 {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
@ -316,7 +347,7 @@ func NewDiscoveryClientForConfig(c *rest.Config) (*DiscoveryClient, error) {
return nil, err
}
client, err := rest.UnversionedRESTClientFor(&config)
return &DiscoveryClient{RESTClient: client, LegacyPrefix: "/api"}, err
return &DiscoveryClient{restClient: client, LegacyPrefix: "/api"}, err
}
// NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. If
@ -331,8 +362,8 @@ func NewDiscoveryClientForConfigOrDie(c *rest.Config) *DiscoveryClient {
}
// New creates a new DiscoveryClient for the given RESTClient.
func NewDiscoveryClient(c *rest.RESTClient) *DiscoveryClient {
return &DiscoveryClient{RESTClient: c, LegacyPrefix: "/api"}
func NewDiscoveryClient(c rest.Interface) *DiscoveryClient {
return &DiscoveryClient{restClient: c, LegacyPrefix: "/api"}
}
func stringDoesntExistIn(str string, slice []string) bool {
@ -343,3 +374,12 @@ func stringDoesntExistIn(str string, slice []string) bool {
}
return true
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *DiscoveryClient) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

109
vendor/k8s.io/client-go/discovery/helper.go generated vendored Normal file
View file

@ -0,0 +1,109 @@
/*
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 discovery
import (
"fmt"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/util/sets"
"k8s.io/client-go/pkg/version"
// Import solely to initialize client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth"
)
// MatchesServerVersion queries the server to compares the build version
// (git hash) of the client with the server's build version. It returns an error
// if it failed to contact the server or if the versions are not an exact match.
func MatchesServerVersion(client DiscoveryInterface) error {
cVer := version.Get()
sVer, err := client.ServerVersion()
if err != nil {
return fmt.Errorf("couldn't read version from server: %v\n", err)
}
// GitVersion includes GitCommit and GitTreeState, but best to be safe?
if cVer.GitVersion != sVer.GitVersion || cVer.GitCommit != sVer.GitCommit || cVer.GitTreeState != sVer.GitTreeState {
return fmt.Errorf("server version (%#v) differs from client version (%#v)!\n", sVer, cVer)
}
return nil
}
// NegotiateVersion queries the server's supported api versions to find
// a version that both client and server support.
// - If no version is provided, try registered client versions in order of
// preference.
// - If version is provided and the server does not support it,
// return an error.
func NegotiateVersion(client DiscoveryInterface, requiredGV *unversioned.GroupVersion, clientRegisteredGVs []unversioned.GroupVersion) (*unversioned.GroupVersion, error) {
clientVersions := sets.String{}
for _, gv := range clientRegisteredGVs {
clientVersions.Insert(gv.String())
}
groups, err := client.ServerGroups()
if err != nil {
// This is almost always a connection error, and higher level code should treat this as a generic error,
// not a negotiation specific error.
return nil, err
}
versions := unversioned.ExtractGroupVersions(groups)
serverVersions := sets.String{}
for _, v := range versions {
serverVersions.Insert(v)
}
// If version explicitly requested verify that both client and server support it.
// If server does not support warn, but try to negotiate a lower version.
if requiredGV != nil {
if !clientVersions.Has(requiredGV.String()) {
return nil, fmt.Errorf("client does not support API version %q; client supported API versions: %v", requiredGV, clientVersions)
}
// If the server supports no versions, then we should just use the preferredGV
// This can happen because discovery fails due to 403 Forbidden errors
if len(serverVersions) == 0 {
return requiredGV, nil
}
if serverVersions.Has(requiredGV.String()) {
return requiredGV, nil
}
// If we are using an explicit config version the server does not support, fail.
return nil, fmt.Errorf("server does not support API version %q", requiredGV)
}
for _, clientGV := range clientRegisteredGVs {
if serverVersions.Has(clientGV.String()) {
// Version was not explicitly requested in command config (--api-version).
// Ok to fall back to a supported version with a warning.
// TODO: caesarxuchao: enable the warning message when we have
// proper fix. Please refer to issue #14895.
// if len(version) != 0 {
// glog.Warningf("Server does not support API version '%s'. Falling back to '%s'.", version, clientVersion)
// }
t := clientGV
return &t, nil
}
}
// if we have no server versions and we have no required version, choose the first clientRegisteredVersion
if len(serverVersions) == 0 && len(clientRegisteredGVs) > 0 {
return &clientRegisteredGVs[0], nil
}
return nil, fmt.Errorf("failed to negotiate an api version; server supports: %v, client supports: %v",
serverVersions, clientVersions)
}

View file

@ -20,9 +20,11 @@ import (
"fmt"
"sync"
"k8s.io/client-go/1.5/pkg/api/errors"
"k8s.io/client-go/1.5/pkg/api/meta"
"k8s.io/client-go/1.5/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/errors"
"k8s.io/client-go/pkg/api/meta"
"k8s.io/client-go/pkg/api/unversioned"
"github.com/golang/glog"
)
// APIGroupResources is an API group with a mapping of versions to
@ -35,7 +37,7 @@ type APIGroupResources struct {
}
// NewRESTMapper returns a PriorityRESTMapper based on the discovered
// groups and resourced passed in.
// groups and resources passed in.
func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.VersionInterfacesFunc) meta.RESTMapper {
unionMapper := meta.MultiRESTMapper{}
@ -47,8 +49,8 @@ func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.V
groupPriority = append(groupPriority, group.Group.Name)
if len(group.Group.PreferredVersion.Version) != 0 {
preffered := group.Group.PreferredVersion.Version
if _, ok := group.VersionedResources[preffered]; ok {
preferred := group.Group.PreferredVersion.Version
if _, ok := group.VersionedResources[preferred]; ok {
resourcePriority = append(resourcePriority, unversioned.GroupVersionResource{
Group: group.Group.Name,
Version: group.Group.PreferredVersion.Version,
@ -141,14 +143,14 @@ func GetAPIGroupResources(cl DiscoveryInterface) ([]*APIGroupResources, error) {
type DeferredDiscoveryRESTMapper struct {
initMu sync.Mutex
delegate meta.RESTMapper
cl DiscoveryInterface
cl CachedDiscoveryInterface
versionInterface meta.VersionInterfacesFunc
}
// NewDeferredDiscoveryRESTMapper returns a
// DeferredDiscoveryRESTMapper that will lazily query the provided
// client for discovery information to do REST mappings.
func NewDeferredDiscoveryRESTMapper(cl DiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper {
func NewDeferredDiscoveryRESTMapper(cl CachedDiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper {
return &DeferredDiscoveryRESTMapper{
cl: cl,
versionInterface: versionInterface,
@ -175,79 +177,118 @@ func (d *DeferredDiscoveryRESTMapper) getDelegate() (meta.RESTMapper, error) {
// Reset resets the internally cached Discovery information and will
// cause the next mapping request to re-discover.
func (d *DeferredDiscoveryRESTMapper) Reset() {
glog.V(5).Info("Invalidating discovery information")
d.initMu.Lock()
defer d.initMu.Unlock()
d.cl.Invalidate()
d.delegate = nil
d.initMu.Unlock()
}
// KindFor takes a partial resource and returns back the single match.
// It returns an error if there are multiple matches.
func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error) {
func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (gvk unversioned.GroupVersionKind, err error) {
del, err := d.getDelegate()
if err != nil {
return unversioned.GroupVersionKind{}, err
}
return del.KindFor(resource)
gvk, err = del.KindFor(resource)
if err != nil && !d.cl.Fresh() {
d.Reset()
gvk, err = d.KindFor(resource)
}
return
}
// KindsFor takes a partial resource and returns back the list of
// potential kinds in priority order.
func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error) {
func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) (gvks []unversioned.GroupVersionKind, err error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
return del.KindsFor(resource)
gvks, err = del.KindsFor(resource)
if len(gvks) == 0 && !d.cl.Fresh() {
d.Reset()
gvks, err = d.KindsFor(resource)
}
return
}
// ResourceFor takes a partial resource and returns back the single
// match. It returns an error if there are multiple matches.
func (d *DeferredDiscoveryRESTMapper) ResourceFor(input unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error) {
func (d *DeferredDiscoveryRESTMapper) ResourceFor(input unversioned.GroupVersionResource) (gvr unversioned.GroupVersionResource, err error) {
del, err := d.getDelegate()
if err != nil {
return unversioned.GroupVersionResource{}, err
}
return del.ResourceFor(input)
gvr, err = del.ResourceFor(input)
if err != nil && !d.cl.Fresh() {
d.Reset()
gvr, err = d.ResourceFor(input)
}
return
}
// ResourcesFor takes a partial resource and returns back the list of
// potential resource in priority order.
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error) {
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) (gvrs []unversioned.GroupVersionResource, err error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
return del.ResourcesFor(input)
gvrs, err = del.ResourcesFor(input)
if len(gvrs) == 0 && !d.cl.Fresh() {
d.Reset()
gvrs, err = d.ResourcesFor(input)
}
return
}
// RESTMapping identifies a preferred resource mapping for the
// provided group kind.
func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error) {
func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (m *meta.RESTMapping, err error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
return del.RESTMapping(gk, versions...)
m, err = del.RESTMapping(gk, versions...)
if err != nil && !d.cl.Fresh() {
d.Reset()
m, err = d.RESTMapping(gk, versions...)
}
return
}
// RESTMappings returns the RESTMappings for the provided group kind
// in a rough internal preferred order. If no kind is found, it will
// return a NoResourceMatchError.
func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*meta.RESTMapping, error) {
func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) (ms []*meta.RESTMapping, err error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
return del.RESTMappings(gk)
ms, err = del.RESTMappings(gk)
if len(ms) == 0 && !d.cl.Fresh() {
d.Reset()
ms, err = d.RESTMappings(gk)
}
return
}
// AliasesForResource returns whether a resource has an alias or not.
func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) ([]string, bool) {
func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) (as []string, ok bool) {
del, err := d.getDelegate()
if err != nil {
return nil, false
}
return del.AliasesForResource(resource)
as, ok = del.AliasesForResource(resource)
if len(as) == 0 && !d.cl.Fresh() {
d.Reset()
as, ok = d.AliasesForResource(resource)
}
return
}
// ResourceSingularizer converts a resource name from plural to
@ -257,7 +298,12 @@ func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (sin
if err != nil {
return resource, err
}
return del.ResourceSingularizer(resource)
singular, err = del.ResourceSingularizer(resource)
if err != nil && !d.cl.Fresh() {
d.Reset()
singular, err = d.ResourceSingularizer(resource)
}
return
}
func (d *DeferredDiscoveryRESTMapper) String() string {

View file

@ -19,8 +19,8 @@ package discovery
import (
"fmt"
"k8s.io/client-go/1.5/pkg/api/unversioned"
"k8s.io/client-go/1.5/pkg/runtime"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/runtime"
)
// UnstructuredObjectTyper provides a runtime.ObjectTyper implmentation for

View file

@ -1,88 +0,0 @@
/*
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 main
import (
"encoding/json"
"flag"
"log"
"os"
"strings"
)
var (
godepsFile = flag.String("godeps-file", "", "absolute path to Godeps.json")
clientRepoImportPath = flag.String("client-go-import-path", "", "import path to a version of client-go, e.g., k8s.io/client-go/1.4")
)
type Dependency struct {
ImportPath string
Comment string `json:",omitempty"`
Rev string
}
type Godeps struct {
ImportPath string
GoVersion string
GodepVersion string
Packages []string `json:",omitempty"` // Arguments to save, if any.
Deps []Dependency
}
// rewrites the Godeps.ImportPath, removes the Deps whose ImportPath contains "k8s.io/kubernetes"
func main() {
flag.Parse()
var g Godeps
if len(*godepsFile) == 0 {
log.Fatalf("absolute ath to Godeps.json is required")
}
if len(*clientRepoImportPath) == 0 {
log.Fatalf("import path to a version of client-go is required")
}
f, err := os.OpenFile(*godepsFile, os.O_RDWR, 0666)
if err != nil {
log.Fatalf("cannot open file %q: %v", *godepsFile, err)
}
defer f.Close()
err = json.NewDecoder(f).Decode(&g)
if err != nil {
log.Fatalf("Unable to parse %q: %v", *godepsFile, err)
}
// rewrites the Godeps.ImportPath
g.ImportPath = *clientRepoImportPath
// removes the Deps whose ImportPath contains "k8s.io/kubernetes"
i := 0
for _, dep := range g.Deps {
if strings.Contains(dep.ImportPath, "k8s.io/kubernetes") {
continue
}
g.Deps[i] = dep
i++
}
g.Deps = g.Deps[:i]
b, err := json.MarshalIndent(g, "", "\t")
if err != nil {
log.Fatal(err)
}
n, err := f.WriteAt(append(b, '\n'), 0)
if err != nil {
log.Fatal(err)
}
if err := f.Truncate(int64(n)); err != nil {
log.Fatal(err)
}
}

400
vendor/k8s.io/client-go/kubernetes/clientset.go generated vendored Normal file
View file

@ -0,0 +1,400 @@
/*
Copyright 2017 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 kubernetes
import (
"github.com/golang/glog"
discovery "k8s.io/client-go/discovery"
v1beta1apps "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
v1beta1authentication "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
v1beta1authorization "k8s.io/client-go/kubernetes/typed/authorization/v1beta1"
v1autoscaling "k8s.io/client-go/kubernetes/typed/autoscaling/v1"
v1batch "k8s.io/client-go/kubernetes/typed/batch/v1"
v2alpha1batch "k8s.io/client-go/kubernetes/typed/batch/v2alpha1"
v1alpha1certificates "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
v1beta1extensions "k8s.io/client-go/kubernetes/typed/extensions/v1beta1"
v1beta1policy "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
v1alpha1rbac "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
v1beta1storage "k8s.io/client-go/kubernetes/typed/storage/v1beta1"
"k8s.io/client-go/pkg/util/flowcontrol"
_ "k8s.io/client-go/plugin/pkg/client/auth"
rest "k8s.io/client-go/rest"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
CoreV1() v1core.CoreV1Interface
// Deprecated: please explicitly pick a version if possible.
Core() v1core.CoreV1Interface
AppsV1beta1() v1beta1apps.AppsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Apps() v1beta1apps.AppsV1beta1Interface
AuthenticationV1beta1() v1beta1authentication.AuthenticationV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Authentication() v1beta1authentication.AuthenticationV1beta1Interface
AuthorizationV1beta1() v1beta1authorization.AuthorizationV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Authorization() v1beta1authorization.AuthorizationV1beta1Interface
AutoscalingV1() v1autoscaling.AutoscalingV1Interface
// Deprecated: please explicitly pick a version if possible.
Autoscaling() v1autoscaling.AutoscalingV1Interface
BatchV1() v1batch.BatchV1Interface
// Deprecated: please explicitly pick a version if possible.
Batch() v1batch.BatchV1Interface
BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface
CertificatesV1alpha1() v1alpha1certificates.CertificatesV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Certificates() v1alpha1certificates.CertificatesV1alpha1Interface
ExtensionsV1beta1() v1beta1extensions.ExtensionsV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Extensions() v1beta1extensions.ExtensionsV1beta1Interface
PolicyV1beta1() v1beta1policy.PolicyV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Policy() v1beta1policy.PolicyV1beta1Interface
RbacV1alpha1() v1alpha1rbac.RbacV1alpha1Interface
// Deprecated: please explicitly pick a version if possible.
Rbac() v1alpha1rbac.RbacV1alpha1Interface
StorageV1beta1() v1beta1storage.StorageV1beta1Interface
// Deprecated: please explicitly pick a version if possible.
Storage() v1beta1storage.StorageV1beta1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
*v1core.CoreV1Client
*v1beta1apps.AppsV1beta1Client
*v1beta1authentication.AuthenticationV1beta1Client
*v1beta1authorization.AuthorizationV1beta1Client
*v1autoscaling.AutoscalingV1Client
*v1batch.BatchV1Client
*v2alpha1batch.BatchV2alpha1Client
*v1alpha1certificates.CertificatesV1alpha1Client
*v1beta1extensions.ExtensionsV1beta1Client
*v1beta1policy.PolicyV1beta1Client
*v1alpha1rbac.RbacV1alpha1Client
*v1beta1storage.StorageV1beta1Client
}
// CoreV1 retrieves the CoreV1Client
func (c *Clientset) CoreV1() v1core.CoreV1Interface {
if c == nil {
return nil
}
return c.CoreV1Client
}
// Deprecated: Core retrieves the default version of CoreClient.
// Please explicitly pick a version.
func (c *Clientset) Core() v1core.CoreV1Interface {
if c == nil {
return nil
}
return c.CoreV1Client
}
// AppsV1beta1 retrieves the AppsV1beta1Client
func (c *Clientset) AppsV1beta1() v1beta1apps.AppsV1beta1Interface {
if c == nil {
return nil
}
return c.AppsV1beta1Client
}
// Deprecated: Apps retrieves the default version of AppsClient.
// Please explicitly pick a version.
func (c *Clientset) Apps() v1beta1apps.AppsV1beta1Interface {
if c == nil {
return nil
}
return c.AppsV1beta1Client
}
// AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client
func (c *Clientset) AuthenticationV1beta1() v1beta1authentication.AuthenticationV1beta1Interface {
if c == nil {
return nil
}
return c.AuthenticationV1beta1Client
}
// Deprecated: Authentication retrieves the default version of AuthenticationClient.
// Please explicitly pick a version.
func (c *Clientset) Authentication() v1beta1authentication.AuthenticationV1beta1Interface {
if c == nil {
return nil
}
return c.AuthenticationV1beta1Client
}
// AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client
func (c *Clientset) AuthorizationV1beta1() v1beta1authorization.AuthorizationV1beta1Interface {
if c == nil {
return nil
}
return c.AuthorizationV1beta1Client
}
// Deprecated: Authorization retrieves the default version of AuthorizationClient.
// Please explicitly pick a version.
func (c *Clientset) Authorization() v1beta1authorization.AuthorizationV1beta1Interface {
if c == nil {
return nil
}
return c.AuthorizationV1beta1Client
}
// AutoscalingV1 retrieves the AutoscalingV1Client
func (c *Clientset) AutoscalingV1() v1autoscaling.AutoscalingV1Interface {
if c == nil {
return nil
}
return c.AutoscalingV1Client
}
// Deprecated: Autoscaling retrieves the default version of AutoscalingClient.
// Please explicitly pick a version.
func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingV1Interface {
if c == nil {
return nil
}
return c.AutoscalingV1Client
}
// BatchV1 retrieves the BatchV1Client
func (c *Clientset) BatchV1() v1batch.BatchV1Interface {
if c == nil {
return nil
}
return c.BatchV1Client
}
// Deprecated: Batch retrieves the default version of BatchClient.
// Please explicitly pick a version.
func (c *Clientset) Batch() v1batch.BatchV1Interface {
if c == nil {
return nil
}
return c.BatchV1Client
}
// BatchV2alpha1 retrieves the BatchV2alpha1Client
func (c *Clientset) BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface {
if c == nil {
return nil
}
return c.BatchV2alpha1Client
}
// CertificatesV1alpha1 retrieves the CertificatesV1alpha1Client
func (c *Clientset) CertificatesV1alpha1() v1alpha1certificates.CertificatesV1alpha1Interface {
if c == nil {
return nil
}
return c.CertificatesV1alpha1Client
}
// Deprecated: Certificates retrieves the default version of CertificatesClient.
// Please explicitly pick a version.
func (c *Clientset) Certificates() v1alpha1certificates.CertificatesV1alpha1Interface {
if c == nil {
return nil
}
return c.CertificatesV1alpha1Client
}
// ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client
func (c *Clientset) ExtensionsV1beta1() v1beta1extensions.ExtensionsV1beta1Interface {
if c == nil {
return nil
}
return c.ExtensionsV1beta1Client
}
// Deprecated: Extensions retrieves the default version of ExtensionsClient.
// Please explicitly pick a version.
func (c *Clientset) Extensions() v1beta1extensions.ExtensionsV1beta1Interface {
if c == nil {
return nil
}
return c.ExtensionsV1beta1Client
}
// PolicyV1beta1 retrieves the PolicyV1beta1Client
func (c *Clientset) PolicyV1beta1() v1beta1policy.PolicyV1beta1Interface {
if c == nil {
return nil
}
return c.PolicyV1beta1Client
}
// Deprecated: Policy retrieves the default version of PolicyClient.
// Please explicitly pick a version.
func (c *Clientset) Policy() v1beta1policy.PolicyV1beta1Interface {
if c == nil {
return nil
}
return c.PolicyV1beta1Client
}
// RbacV1alpha1 retrieves the RbacV1alpha1Client
func (c *Clientset) RbacV1alpha1() v1alpha1rbac.RbacV1alpha1Interface {
if c == nil {
return nil
}
return c.RbacV1alpha1Client
}
// Deprecated: Rbac retrieves the default version of RbacClient.
// Please explicitly pick a version.
func (c *Clientset) Rbac() v1alpha1rbac.RbacV1alpha1Interface {
if c == nil {
return nil
}
return c.RbacV1alpha1Client
}
// StorageV1beta1 retrieves the StorageV1beta1Client
func (c *Clientset) StorageV1beta1() v1beta1storage.StorageV1beta1Interface {
if c == nil {
return nil
}
return c.StorageV1beta1Client
}
// Deprecated: Storage retrieves the default version of StorageClient.
// Please explicitly pick a version.
func (c *Clientset) Storage() v1beta1storage.StorageV1beta1Interface {
if c == nil {
return nil
}
return c.StorageV1beta1Client
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return c.DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var clientset Clientset
var err error
clientset.CoreV1Client, err = v1core.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AppsV1beta1Client, err = v1beta1apps.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AuthenticationV1beta1Client, err = v1beta1authentication.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AuthorizationV1beta1Client, err = v1beta1authorization.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.AutoscalingV1Client, err = v1autoscaling.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.BatchV1Client, err = v1batch.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.BatchV2alpha1Client, err = v2alpha1batch.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.CertificatesV1alpha1Client, err = v1alpha1certificates.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.ExtensionsV1beta1Client, err = v1beta1extensions.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.PolicyV1beta1Client, err = v1beta1policy.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.RbacV1alpha1Client, err = v1alpha1rbac.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.StorageV1beta1Client, err = v1beta1storage.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
glog.Errorf("failed to create the DiscoveryClient: %v", err)
return nil, err
}
return &clientset, nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var clientset Clientset
clientset.CoreV1Client = v1core.NewForConfigOrDie(c)
clientset.AppsV1beta1Client = v1beta1apps.NewForConfigOrDie(c)
clientset.AuthenticationV1beta1Client = v1beta1authentication.NewForConfigOrDie(c)
clientset.AuthorizationV1beta1Client = v1beta1authorization.NewForConfigOrDie(c)
clientset.AutoscalingV1Client = v1autoscaling.NewForConfigOrDie(c)
clientset.BatchV1Client = v1batch.NewForConfigOrDie(c)
clientset.BatchV2alpha1Client = v2alpha1batch.NewForConfigOrDie(c)
clientset.CertificatesV1alpha1Client = v1alpha1certificates.NewForConfigOrDie(c)
clientset.ExtensionsV1beta1Client = v1beta1extensions.NewForConfigOrDie(c)
clientset.PolicyV1beta1Client = v1beta1policy.NewForConfigOrDie(c)
clientset.RbacV1alpha1Client = v1alpha1rbac.NewForConfigOrDie(c)
clientset.StorageV1beta1Client = v1beta1storage.NewForConfigOrDie(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &clientset
}
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var clientset Clientset
clientset.CoreV1Client = v1core.New(c)
clientset.AppsV1beta1Client = v1beta1apps.New(c)
clientset.AuthenticationV1beta1Client = v1beta1authentication.New(c)
clientset.AuthorizationV1beta1Client = v1beta1authorization.New(c)
clientset.AutoscalingV1Client = v1autoscaling.New(c)
clientset.BatchV1Client = v1batch.New(c)
clientset.BatchV2alpha1Client = v2alpha1batch.New(c)
clientset.CertificatesV1alpha1Client = v1alpha1certificates.New(c)
clientset.ExtensionsV1beta1Client = v1beta1extensions.New(c)
clientset.PolicyV1beta1Client = v1beta1policy.New(c)
clientset.RbacV1alpha1Client = v1alpha1rbac.New(c)
clientset.StorageV1beta1Client = v1beta1storage.New(c)
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &clientset
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated clientset.
package kubernetes

View file

@ -20,18 +20,18 @@ package kubernetes
import (
"fmt"
_ "k8s.io/client-go/1.5/pkg/api/install"
"k8s.io/client-go/1.5/pkg/apimachinery/registered"
_ "k8s.io/client-go/1.5/pkg/apis/apps/install"
_ "k8s.io/client-go/1.5/pkg/apis/authentication/install"
_ "k8s.io/client-go/1.5/pkg/apis/authorization/install"
_ "k8s.io/client-go/1.5/pkg/apis/autoscaling/install"
_ "k8s.io/client-go/1.5/pkg/apis/batch/install"
_ "k8s.io/client-go/1.5/pkg/apis/certificates/install"
_ "k8s.io/client-go/1.5/pkg/apis/extensions/install"
_ "k8s.io/client-go/1.5/pkg/apis/policy/install"
_ "k8s.io/client-go/1.5/pkg/apis/rbac/install"
_ "k8s.io/client-go/1.5/pkg/apis/storage/install"
_ "k8s.io/client-go/pkg/api/install"
"k8s.io/client-go/pkg/apimachinery/registered"
_ "k8s.io/client-go/pkg/apis/apps/install"
_ "k8s.io/client-go/pkg/apis/authentication/install"
_ "k8s.io/client-go/pkg/apis/authorization/install"
_ "k8s.io/client-go/pkg/apis/autoscaling/install"
_ "k8s.io/client-go/pkg/apis/batch/install"
_ "k8s.io/client-go/pkg/apis/certificates/install"
_ "k8s.io/client-go/pkg/apis/extensions/install"
_ "k8s.io/client-go/pkg/apis/policy/install"
_ "k8s.io/client-go/pkg/apis/rbac/install"
_ "k8s.io/client-go/pkg/apis/storage/install"
)
func init() {

View file

@ -0,0 +1,98 @@
/*
Copyright 2017 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 v1beta1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type AppsV1beta1Interface interface {
RESTClient() rest.Interface
StatefulSetsGetter
}
// AppsV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type AppsV1beta1Client struct {
restClient rest.Interface
}
func (c *AppsV1beta1Client) StatefulSets(namespace string) StatefulSetInterface {
return newStatefulSets(c, namespace)
}
// NewForConfig creates a new AppsV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*AppsV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AppsV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new AppsV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AppsV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AppsV1beta1Client for the given RESTClient.
func New(c rest.Interface) *AppsV1beta1Client {
return &AppsV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("apps/v1beta1")
if err != nil {
return err
}
// if apps/v1beta1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("apps/v1beta1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AppsV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1beta1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -16,4 +16,4 @@ limitations under the License.
package v1beta1
type TokenReviewExpansion interface{}
type StatefulSetExpansion interface{}

View file

@ -0,0 +1,167 @@
/*
Copyright 2017 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 v1beta1
import (
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1beta1 "k8s.io/client-go/pkg/apis/apps/v1beta1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
// A group's client should implement this interface.
type StatefulSetsGetter interface {
StatefulSets(namespace string) StatefulSetInterface
}
// StatefulSetInterface has methods to work with StatefulSet resources.
type StatefulSetInterface interface {
Create(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error)
Update(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error)
UpdateStatus(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1beta1.StatefulSet, error)
List(opts v1.ListOptions) (*v1beta1.StatefulSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error)
StatefulSetExpansion
}
// statefulSets implements StatefulSetInterface
type statefulSets struct {
client rest.Interface
ns string
}
// newStatefulSets returns a StatefulSets
func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets {
return &statefulSets{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *statefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) {
result = &v1beta1.StatefulSet{}
err = c.client.Post().
Namespace(c.ns).
Resource("statefulsets").
Body(statefulSet).
Do().
Into(result)
return
}
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *statefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) {
result = &v1beta1.StatefulSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSet.Name).
Body(statefulSet).
Do().
Into(result)
return
}
func (c *statefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) {
result = &v1beta1.StatefulSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSet.Name).
SubResource("status").
Body(statefulSet).
Do().
Into(result)
return
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
func (c *statefulSets) Get(name string) (result *v1beta1.StatefulSet, err error) {
result = &v1beta1.StatefulSet{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
Name(name).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
result = &v1beta1.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched statefulSet.
func (c *statefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) {
result = &v1beta1.StatefulSet{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("statefulsets").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View file

@ -0,0 +1,98 @@
/*
Copyright 2017 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 v1beta1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type AuthenticationV1beta1Interface interface {
RESTClient() rest.Interface
TokenReviewsGetter
}
// AuthenticationV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type AuthenticationV1beta1Client struct {
restClient rest.Interface
}
func (c *AuthenticationV1beta1Client) TokenReviews() TokenReviewInterface {
return newTokenReviews(c)
}
// NewForConfig creates a new AuthenticationV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*AuthenticationV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AuthenticationV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new AuthenticationV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AuthenticationV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AuthenticationV1beta1Client for the given RESTClient.
func New(c rest.Interface) *AuthenticationV1beta1Client {
return &AuthenticationV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("authentication.k8s.io/v1beta1")
if err != nil {
return err
}
// if authentication.k8s.io/v1beta1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("authentication.k8s.io/v1beta1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AuthenticationV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1beta1

View file

@ -0,0 +1,17 @@
/*
Copyright 2017 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 v1beta1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -16,6 +16,10 @@ limitations under the License.
package v1beta1
import (
rest "k8s.io/client-go/rest"
)
// TokenReviewsGetter has a method to return a TokenReviewInterface.
// A group's client should implement this interface.
type TokenReviewsGetter interface {
@ -29,12 +33,12 @@ type TokenReviewInterface interface {
// tokenReviews implements TokenReviewInterface
type tokenReviews struct {
client *AuthenticationClient
client rest.Interface
}
// newTokenReviews returns a TokenReviews
func newTokenReviews(c *AuthenticationClient) *tokenReviews {
func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews {
return &tokenReviews{
client: c,
client: c.RESTClient(),
}
}

View file

@ -16,6 +16,20 @@ limitations under the License.
package v1beta1
type LocalSubjectAccessReviewExpansion interface{}
import (
authenticationapi "k8s.io/client-go/pkg/apis/authentication/v1beta1"
)
type SelfSubjectAccessReviewExpansion interface{}
type TokenReviewExpansion interface {
Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error)
}
func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
result = &authenticationapi.TokenReview{}
err = c.client.Post().
Resource("tokenreviews").
Body(tokenReview).
Do().
Into(result)
return
}

View file

@ -0,0 +1,108 @@
/*
Copyright 2017 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 v1beta1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type AuthorizationV1beta1Interface interface {
RESTClient() rest.Interface
LocalSubjectAccessReviewsGetter
SelfSubjectAccessReviewsGetter
SubjectAccessReviewsGetter
}
// AuthorizationV1beta1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type AuthorizationV1beta1Client struct {
restClient rest.Interface
}
func (c *AuthorizationV1beta1Client) LocalSubjectAccessReviews(namespace string) LocalSubjectAccessReviewInterface {
return newLocalSubjectAccessReviews(c, namespace)
}
func (c *AuthorizationV1beta1Client) SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface {
return newSelfSubjectAccessReviews(c)
}
func (c *AuthorizationV1beta1Client) SubjectAccessReviews() SubjectAccessReviewInterface {
return newSubjectAccessReviews(c)
}
// NewForConfig creates a new AuthorizationV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*AuthorizationV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AuthorizationV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new AuthorizationV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AuthorizationV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AuthorizationV1beta1Client for the given RESTClient.
func New(c rest.Interface) *AuthorizationV1beta1Client {
return &AuthorizationV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("authorization.k8s.io/v1beta1")
if err != nil {
return err
}
// if authorization.k8s.io/v1beta1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("authorization.k8s.io/v1beta1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1beta1

View file

@ -0,0 +1,17 @@
/*
Copyright 2017 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 v1beta1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -16,6 +16,10 @@ limitations under the License.
package v1beta1
import (
rest "k8s.io/client-go/rest"
)
// LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface.
// A group's client should implement this interface.
type LocalSubjectAccessReviewsGetter interface {
@ -29,14 +33,14 @@ type LocalSubjectAccessReviewInterface interface {
// localSubjectAccessReviews implements LocalSubjectAccessReviewInterface
type localSubjectAccessReviews struct {
client *AuthorizationClient
client rest.Interface
ns string
}
// newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews
func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews {
func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace string) *localSubjectAccessReviews {
return &localSubjectAccessReviews{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}

View file

@ -0,0 +1,36 @@
/*
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 v1beta1
import (
authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1"
)
type LocalSubjectAccessReviewExpansion interface {
Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error)
}
func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) {
result = &authorizationapi.LocalSubjectAccessReview{}
err = c.client.Post().
Namespace(c.ns).
Resource("localsubjectaccessreviews").
Body(sar).
Do().
Into(result)
return
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -16,6 +16,10 @@ limitations under the License.
package v1beta1
import (
rest "k8s.io/client-go/rest"
)
// SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface.
// A group's client should implement this interface.
type SelfSubjectAccessReviewsGetter interface {
@ -29,12 +33,12 @@ type SelfSubjectAccessReviewInterface interface {
// selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface
type selfSubjectAccessReviews struct {
client *AuthorizationClient
client rest.Interface
}
// newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews
func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews {
func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAccessReviews {
return &selfSubjectAccessReviews{
client: c,
client: c.RESTClient(),
}
}

View file

@ -0,0 +1,35 @@
/*
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 v1beta1
import (
authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1"
)
type SelfSubjectAccessReviewExpansion interface {
Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error)
}
func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) {
result = &authorizationapi.SelfSubjectAccessReview{}
err = c.client.Post().
Resource("selfsubjectaccessreviews").
Body(sar).
Do().
Into(result)
return
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -16,6 +16,10 @@ limitations under the License.
package v1beta1
import (
rest "k8s.io/client-go/rest"
)
// SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface.
// A group's client should implement this interface.
type SubjectAccessReviewsGetter interface {
@ -29,12 +33,12 @@ type SubjectAccessReviewInterface interface {
// subjectAccessReviews implements SubjectAccessReviewInterface
type subjectAccessReviews struct {
client *AuthorizationClient
client rest.Interface
}
// newSubjectAccessReviews returns a SubjectAccessReviews
func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews {
func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReviews {
return &subjectAccessReviews{
client: c,
client: c.RESTClient(),
}
}

View file

@ -17,7 +17,7 @@ limitations under the License.
package v1beta1
import (
authorizationapi "k8s.io/client-go/1.5/pkg/apis/authorization/v1beta1"
authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1"
)
// The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface.

View file

@ -0,0 +1,98 @@
/*
Copyright 2017 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 (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type AutoscalingV1Interface interface {
RESTClient() rest.Interface
HorizontalPodAutoscalersGetter
}
// AutoscalingV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type AutoscalingV1Client struct {
restClient rest.Interface
}
func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface {
return newHorizontalPodAutoscalers(c, namespace)
}
// NewForConfig creates a new AutoscalingV1Client for the given config.
func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &AutoscalingV1Client{client}, nil
}
// NewForConfigOrDie creates a new AutoscalingV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *AutoscalingV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new AutoscalingV1Client for the given RESTClient.
func New(c rest.Interface) *AutoscalingV1Client {
return &AutoscalingV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("autoscaling/v1")
if err != nil {
return err
}
// if autoscaling/v1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("autoscaling/v1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *AutoscalingV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,11 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/apis/autoscaling/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
api_v1 "k8s.io/client-go/pkg/api/v1"
v1 "k8s.io/client-go/pkg/apis/autoscaling/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@ -33,25 +35,25 @@ type HorizontalPodAutoscalerInterface interface {
Create(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error)
Update(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error)
UpdateStatus(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *api_v1.DeleteOptions) error
DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error
Get(name string) (*v1.HorizontalPodAutoscaler, error)
List(opts api.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts api_v1.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(opts api_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error)
HorizontalPodAutoscalerExpansion
}
// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
type horizontalPodAutoscalers struct {
client *AutoscalingClient
client rest.Interface
ns string
}
// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers
func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers {
func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers {
return &horizontalPodAutoscalers{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +97,7 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.Hori
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
func (c *horizontalPodAutoscalers) Delete(name string, options *api_v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
@ -106,7 +108,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *horizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *horizontalPodAutoscalers) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
@ -129,7 +131,7 @@ func (c *horizontalPodAutoscalers) Get(name string) (result *v1.HorizontalPodAut
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
result = &v1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +143,7 @@ func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *v1.Horizo
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *horizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -0,0 +1,98 @@
/*
Copyright 2017 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 (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type BatchV1Interface interface {
RESTClient() rest.Interface
JobsGetter
}
// BatchV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type BatchV1Client struct {
restClient rest.Interface
}
func (c *BatchV1Client) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
// NewForConfig creates a new BatchV1Client for the given config.
func NewForConfig(c *rest.Config) (*BatchV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &BatchV1Client{client}, nil
}
// NewForConfigOrDie creates a new BatchV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *BatchV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new BatchV1Client for the given RESTClient.
func New(c rest.Interface) *BatchV1Client {
return &BatchV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("batch/v1")
if err != nil {
return err
}
// if batch/v1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("batch/v1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *BatchV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,11 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/apis/batch/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
api_v1 "k8s.io/client-go/pkg/api/v1"
v1 "k8s.io/client-go/pkg/apis/batch/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// JobsGetter has a method to return a JobInterface.
@ -33,25 +35,25 @@ type JobInterface interface {
Create(*v1.Job) (*v1.Job, error)
Update(*v1.Job) (*v1.Job, error)
UpdateStatus(*v1.Job) (*v1.Job, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *api_v1.DeleteOptions) error
DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error
Get(name string) (*v1.Job, error)
List(opts api.ListOptions) (*v1.JobList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts api_v1.ListOptions) (*v1.JobList, error)
Watch(opts api_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Job, err error)
JobExpansion
}
// jobs implements JobInterface
type jobs struct {
client *BatchClient
client rest.Interface
ns string
}
// newJobs returns a Jobs
func newJobs(c *BatchClient, namespace string) *jobs {
func newJobs(c *BatchV1Client, namespace string) *jobs {
return &jobs{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +97,7 @@ func (c *jobs) UpdateStatus(job *v1.Job) (result *v1.Job, err error) {
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(name string, options *api.DeleteOptions) error {
func (c *jobs) Delete(name string, options *api_v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
@ -106,7 +108,7 @@ func (c *jobs) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *jobs) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
@ -129,7 +131,7 @@ func (c *jobs) Get(name string) (result *v1.Job, err error) {
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(opts api.ListOptions) (result *v1.JobList, err error) {
func (c *jobs) List(opts api_v1.ListOptions) (result *v1.JobList, err error) {
result = &v1.JobList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +143,7 @@ func (c *jobs) List(opts api.ListOptions) (result *v1.JobList, err error) {
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *jobs) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -0,0 +1,103 @@
/*
Copyright 2017 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 v2alpha1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type BatchV2alpha1Interface interface {
RESTClient() rest.Interface
CronJobsGetter
JobsGetter
}
// BatchV2alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type BatchV2alpha1Client struct {
restClient rest.Interface
}
func (c *BatchV2alpha1Client) CronJobs(namespace string) CronJobInterface {
return newCronJobs(c, namespace)
}
func (c *BatchV2alpha1Client) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
// NewForConfig creates a new BatchV2alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*BatchV2alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &BatchV2alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new BatchV2alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *BatchV2alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new BatchV2alpha1Client for the given RESTClient.
func New(c rest.Interface) *BatchV2alpha1Client {
return &BatchV2alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("batch/v2alpha1")
if err != nil {
return err
}
// if batch/v2alpha1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("batch/v2alpha1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *BatchV2alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -0,0 +1,167 @@
/*
Copyright 2017 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 v2alpha1
import (
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// CronJobsGetter has a method to return a CronJobInterface.
// A group's client should implement this interface.
type CronJobsGetter interface {
CronJobs(namespace string) CronJobInterface
}
// CronJobInterface has methods to work with CronJob resources.
type CronJobInterface interface {
Create(*v2alpha1.CronJob) (*v2alpha1.CronJob, error)
Update(*v2alpha1.CronJob) (*v2alpha1.CronJob, error)
UpdateStatus(*v2alpha1.CronJob) (*v2alpha1.CronJob, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v2alpha1.CronJob, error)
List(opts v1.ListOptions) (*v2alpha1.CronJobList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error)
CronJobExpansion
}
// cronJobs implements CronJobInterface
type cronJobs struct {
client rest.Interface
ns string
}
// newCronJobs returns a CronJobs
func newCronJobs(c *BatchV2alpha1Client, namespace string) *cronJobs {
return &cronJobs{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *cronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
err = c.client.Post().
Namespace(c.ns).
Resource("cronjobs").
Body(cronJob).
Do().
Into(result)
return
}
// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *cronJobs) Update(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
err = c.client.Put().
Namespace(c.ns).
Resource("cronjobs").
Name(cronJob.Name).
Body(cronJob).
Do().
Into(result)
return
}
func (c *cronJobs) UpdateStatus(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
err = c.client.Put().
Namespace(c.ns).
Resource("cronjobs").
Name(cronJob.Name).
SubResource("status").
Body(cronJob).
Do().
Into(result)
return
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any.
func (c *cronJobs) Get(name string) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
Name(name).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) {
result = &v2alpha1.CronJobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cronJobs.
func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched cronJob.
func (c *cronJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("cronjobs").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1alpha1
package v2alpha1

View file

@ -0,0 +1,21 @@
/*
Copyright 2017 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 v2alpha1
type CronJobExpansion interface{}
type JobExpansion interface{}

View file

@ -0,0 +1,167 @@
/*
Copyright 2017 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 v2alpha1
import (
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// JobsGetter has a method to return a JobInterface.
// A group's client should implement this interface.
type JobsGetter interface {
Jobs(namespace string) JobInterface
}
// JobInterface has methods to work with Job resources.
type JobInterface interface {
Create(*v2alpha1.Job) (*v2alpha1.Job, error)
Update(*v2alpha1.Job) (*v2alpha1.Job, error)
UpdateStatus(*v2alpha1.Job) (*v2alpha1.Job, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v2alpha1.Job, error)
List(opts v1.ListOptions) (*v2alpha1.JobList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error)
JobExpansion
}
// jobs implements JobInterface
type jobs struct {
client rest.Interface
ns string
}
// newJobs returns a Jobs
func newJobs(c *BatchV2alpha1Client, namespace string) *jobs {
return &jobs{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Create(job *v2alpha1.Job) (result *v2alpha1.Job, err error) {
result = &v2alpha1.Job{}
err = c.client.Post().
Namespace(c.ns).
Resource("jobs").
Body(job).
Do().
Into(result)
return
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *jobs) Update(job *v2alpha1.Job) (result *v2alpha1.Job, err error) {
result = &v2alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
Body(job).
Do().
Into(result)
return
}
func (c *jobs) UpdateStatus(job *v2alpha1.Job) (result *v2alpha1.Job, err error) {
result = &v2alpha1.Job{}
err = c.client.Put().
Namespace(c.ns).
Resource("jobs").
Name(job.Name).
SubResource("status").
Body(job).
Do().
Into(result)
return
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&listOptions, api.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *jobs) Get(name string) (result *v2alpha1.Job, err error) {
result = &v2alpha1.Job{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
Name(name).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(opts v1.ListOptions) (result *v2alpha1.JobList, err error) {
result = &v2alpha1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, api.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, api.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched job.
func (c *jobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) {
result = &v2alpha1.Job{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("jobs").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

View file

@ -0,0 +1,98 @@
/*
Copyright 2017 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 v1alpha1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type CertificatesV1alpha1Interface interface {
RESTClient() rest.Interface
CertificateSigningRequestsGetter
}
// CertificatesV1alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type CertificatesV1alpha1Client struct {
restClient rest.Interface
}
func (c *CertificatesV1alpha1Client) CertificateSigningRequests() CertificateSigningRequestInterface {
return newCertificateSigningRequests(c)
}
// NewForConfig creates a new CertificatesV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CertificatesV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new CertificatesV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CertificatesV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CertificatesV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *CertificatesV1alpha1Client {
return &CertificatesV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("certificates.k8s.io/v1alpha1")
if err != nil {
return err
}
// if certificates.k8s.io/v1alpha1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("certificates.k8s.io/v1alpha1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CertificatesV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,11 @@ limitations under the License.
package v1alpha1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1alpha1 "k8s.io/client-go/1.5/pkg/apis/certificates/v1alpha1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1alpha1 "k8s.io/client-go/pkg/apis/certificates/v1alpha1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface.
@ -33,24 +35,24 @@ type CertificateSigningRequestInterface interface {
Create(*v1alpha1.CertificateSigningRequest) (*v1alpha1.CertificateSigningRequest, error)
Update(*v1alpha1.CertificateSigningRequest) (*v1alpha1.CertificateSigningRequest, error)
UpdateStatus(*v1alpha1.CertificateSigningRequest) (*v1alpha1.CertificateSigningRequest, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1alpha1.CertificateSigningRequest, error)
List(opts api.ListOptions) (*v1alpha1.CertificateSigningRequestList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1alpha1.CertificateSigningRequestList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error)
CertificateSigningRequestExpansion
}
// certificateSigningRequests implements CertificateSigningRequestInterface
type certificateSigningRequests struct {
client *CertificatesClient
client rest.Interface
}
// newCertificateSigningRequests returns a CertificateSigningRequests
func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests {
func newCertificateSigningRequests(c *CertificatesV1alpha1Client) *certificateSigningRequests {
return &certificateSigningRequests{
client: c,
client: c.RESTClient(),
}
}
@ -90,7 +92,7 @@ func (c *certificateSigningRequests) UpdateStatus(certificateSigningRequest *v1a
}
// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs.
func (c *certificateSigningRequests) Delete(name string, options *api.DeleteOptions) error {
func (c *certificateSigningRequests) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("certificatesigningrequests").
Name(name).
@ -100,7 +102,7 @@ func (c *certificateSigningRequests) Delete(name string, options *api.DeleteOpti
}
// DeleteCollection deletes a collection of objects.
func (c *certificateSigningRequests) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *certificateSigningRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Resource("certificatesigningrequests").
VersionedParams(&listOptions, api.ParameterCodec).
@ -121,7 +123,7 @@ func (c *certificateSigningRequests) Get(name string) (result *v1alpha1.Certific
}
// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors.
func (c *certificateSigningRequests) List(opts api.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
result = &v1alpha1.CertificateSigningRequestList{}
err = c.client.Get().
Resource("certificatesigningrequests").
@ -132,7 +134,7 @@ func (c *certificateSigningRequests) List(opts api.ListOptions) (result *v1alpha
}
// Watch returns a watch.Interface that watches the requested certificateSigningRequests.
func (c *certificateSigningRequests) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("certificatesigningrequests").

View file

@ -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 v1alpha1
import (
certificates "k8s.io/client-go/pkg/apis/certificates/v1alpha1"
)
type CertificateSigningRequestExpansion interface {
UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error)
}
func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) {
result = &certificates.CertificateSigningRequest{}
err = c.client.Put().
Resource("certificatesigningrequests").
Name(certificateSigningRequest.Name).
Body(certificateSigningRequest).
SubResource("approval").
Do().
Into(result)
return
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1alpha1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -15,5 +15,3 @@ limitations under the License.
*/
package v1alpha1
type PetSetExpansion interface{}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ComponentStatusesGetter has a method to return a ComponentStatusInterface.
@ -32,24 +33,24 @@ type ComponentStatusesGetter interface {
type ComponentStatusInterface interface {
Create(*v1.ComponentStatus) (*v1.ComponentStatus, error)
Update(*v1.ComponentStatus) (*v1.ComponentStatus, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.ComponentStatus, error)
List(opts api.ListOptions) (*v1.ComponentStatusList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ComponentStatusList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error)
ComponentStatusExpansion
}
// componentStatuses implements ComponentStatusInterface
type componentStatuses struct {
client *CoreClient
client rest.Interface
}
// newComponentStatuses returns a ComponentStatuses
func newComponentStatuses(c *CoreClient) *componentStatuses {
func newComponentStatuses(c *CoreV1Client) *componentStatuses {
return &componentStatuses{
client: c,
client: c.RESTClient(),
}
}
@ -77,7 +78,7 @@ func (c *componentStatuses) Update(componentStatus *v1.ComponentStatus) (result
}
// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs.
func (c *componentStatuses) Delete(name string, options *api.DeleteOptions) error {
func (c *componentStatuses) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("componentstatuses").
Name(name).
@ -87,7 +88,7 @@ func (c *componentStatuses) Delete(name string, options *api.DeleteOptions) erro
}
// DeleteCollection deletes a collection of objects.
func (c *componentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *componentStatuses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Resource("componentstatuses").
VersionedParams(&listOptions, api.ParameterCodec).
@ -108,7 +109,7 @@ func (c *componentStatuses) Get(name string) (result *v1.ComponentStatus, err er
}
// List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors.
func (c *componentStatuses) List(opts api.ListOptions) (result *v1.ComponentStatusList, err error) {
func (c *componentStatuses) List(opts v1.ListOptions) (result *v1.ComponentStatusList, err error) {
result = &v1.ComponentStatusList{}
err = c.client.Get().
Resource("componentstatuses").
@ -119,7 +120,7 @@ func (c *componentStatuses) List(opts api.ListOptions) (result *v1.ComponentStat
}
// Watch returns a watch.Interface that watches the requested componentStatuses.
func (c *componentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *componentStatuses) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("componentstatuses").

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ConfigMapsGetter has a method to return a ConfigMapInterface.
@ -32,25 +33,25 @@ type ConfigMapsGetter interface {
type ConfigMapInterface interface {
Create(*v1.ConfigMap) (*v1.ConfigMap, error)
Update(*v1.ConfigMap) (*v1.ConfigMap, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.ConfigMap, error)
List(opts api.ListOptions) (*v1.ConfigMapList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ConfigMapList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error)
ConfigMapExpansion
}
// configMaps implements ConfigMapInterface
type configMaps struct {
client *CoreClient
client rest.Interface
ns string
}
// newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
func newConfigMaps(c *CoreV1Client, namespace string) *configMaps {
return &configMaps{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *configMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err
}
// Delete takes name of the configMap and deletes it. Returns an error if one occurs.
func (c *configMaps) Delete(name string, options *api.DeleteOptions) error {
func (c *configMaps) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
@ -92,7 +93,7 @@ func (c *configMaps) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *configMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *configMaps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
@ -115,7 +116,7 @@ func (c *configMaps) Get(name string) (result *v1.ConfigMap, err error) {
}
// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors.
func (c *configMaps) List(opts api.ListOptions) (result *v1.ConfigMapList, err error) {
func (c *configMaps) List(opts v1.ListOptions) (result *v1.ConfigMapList, err error) {
result = &v1.ConfigMapList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *configMaps) List(opts api.ListOptions) (result *v1.ConfigMapList, err e
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *configMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *configMaps) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -0,0 +1,173 @@
/*
Copyright 2017 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 (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type CoreV1Interface interface {
RESTClient() rest.Interface
ComponentStatusesGetter
ConfigMapsGetter
EndpointsGetter
EventsGetter
LimitRangesGetter
NamespacesGetter
NodesGetter
PersistentVolumesGetter
PersistentVolumeClaimsGetter
PodsGetter
PodTemplatesGetter
ReplicationControllersGetter
ResourceQuotasGetter
SecretsGetter
ServicesGetter
ServiceAccountsGetter
}
// CoreV1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type CoreV1Client struct {
restClient rest.Interface
}
func (c *CoreV1Client) ComponentStatuses() ComponentStatusInterface {
return newComponentStatuses(c)
}
func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface {
return newConfigMaps(c, namespace)
}
func (c *CoreV1Client) Endpoints(namespace string) EndpointsInterface {
return newEndpoints(c, namespace)
}
func (c *CoreV1Client) Events(namespace string) EventInterface {
return newEvents(c, namespace)
}
func (c *CoreV1Client) LimitRanges(namespace string) LimitRangeInterface {
return newLimitRanges(c, namespace)
}
func (c *CoreV1Client) Namespaces() NamespaceInterface {
return newNamespaces(c)
}
func (c *CoreV1Client) Nodes() NodeInterface {
return newNodes(c)
}
func (c *CoreV1Client) PersistentVolumes() PersistentVolumeInterface {
return newPersistentVolumes(c)
}
func (c *CoreV1Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface {
return newPersistentVolumeClaims(c, namespace)
}
func (c *CoreV1Client) Pods(namespace string) PodInterface {
return newPods(c, namespace)
}
func (c *CoreV1Client) PodTemplates(namespace string) PodTemplateInterface {
return newPodTemplates(c, namespace)
}
func (c *CoreV1Client) ReplicationControllers(namespace string) ReplicationControllerInterface {
return newReplicationControllers(c, namespace)
}
func (c *CoreV1Client) ResourceQuotas(namespace string) ResourceQuotaInterface {
return newResourceQuotas(c, namespace)
}
func (c *CoreV1Client) Secrets(namespace string) SecretInterface {
return newSecrets(c, namespace)
}
func (c *CoreV1Client) Services(namespace string) ServiceInterface {
return newServices(c, namespace)
}
func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface {
return newServiceAccounts(c, namespace)
}
// NewForConfig creates a new CoreV1Client for the given config.
func NewForConfig(c *rest.Config) (*CoreV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CoreV1Client{client}, nil
}
// NewForConfigOrDie creates a new CoreV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CoreV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CoreV1Client for the given RESTClient.
func New(c rest.Interface) *CoreV1Client {
return &CoreV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("/v1")
if err != nil {
return err
}
// if /v1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("/v1 is not enabled")
}
config.APIPath = "/api"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CoreV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// EndpointsGetter has a method to return a EndpointsInterface.
@ -32,25 +33,25 @@ type EndpointsGetter interface {
type EndpointsInterface interface {
Create(*v1.Endpoints) (*v1.Endpoints, error)
Update(*v1.Endpoints) (*v1.Endpoints, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Endpoints, error)
List(opts api.ListOptions) (*v1.EndpointsList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.EndpointsList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error)
EndpointsExpansion
}
// endpoints implements EndpointsInterface
type endpoints struct {
client *CoreClient
client rest.Interface
ns string
}
// newEndpoints returns a Endpoints
func newEndpoints(c *CoreClient, namespace string) *endpoints {
func newEndpoints(c *CoreV1Client, namespace string) *endpoints {
return &endpoints{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *endpoints) Update(endpoints *v1.Endpoints) (result *v1.Endpoints, err e
}
// Delete takes name of the endpoints and deletes it. Returns an error if one occurs.
func (c *endpoints) Delete(name string, options *api.DeleteOptions) error {
func (c *endpoints) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
@ -92,7 +93,7 @@ func (c *endpoints) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *endpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *endpoints) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
@ -115,7 +116,7 @@ func (c *endpoints) Get(name string) (result *v1.Endpoints, err error) {
}
// List takes label and field selectors, and returns the list of Endpoints that match those selectors.
func (c *endpoints) List(opts api.ListOptions) (result *v1.EndpointsList, err error) {
func (c *endpoints) List(opts v1.ListOptions) (result *v1.EndpointsList, err error) {
result = &v1.EndpointsList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *endpoints) List(opts api.ListOptions) (result *v1.EndpointsList, err er
}
// Watch returns a watch.Interface that watches the requested endpoints.
func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *endpoints) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// EventsGetter has a method to return a EventInterface.
@ -32,25 +33,25 @@ type EventsGetter interface {
type EventInterface interface {
Create(*v1.Event) (*v1.Event, error)
Update(*v1.Event) (*v1.Event, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Event, error)
List(opts api.ListOptions) (*v1.EventList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.EventList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Event, err error)
EventExpansion
}
// events implements EventInterface
type events struct {
client *CoreClient
client rest.Interface
ns string
}
// newEvents returns a Events
func newEvents(c *CoreClient, namespace string) *events {
func newEvents(c *CoreV1Client, namespace string) *events {
return &events{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *events) Update(event *v1.Event) (result *v1.Event, err error) {
}
// Delete takes name of the event and deletes it. Returns an error if one occurs.
func (c *events) Delete(name string, options *api.DeleteOptions) error {
func (c *events) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("events").
@ -92,7 +93,7 @@ func (c *events) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *events) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("events").
@ -115,7 +116,7 @@ func (c *events) Get(name string) (result *v1.Event, err error) {
}
// List takes label and field selectors, and returns the list of Events that match those selectors.
func (c *events) List(opts api.ListOptions) (result *v1.EventList, err error) {
func (c *events) List(opts v1.ListOptions) (result *v1.EventList, err error) {
result = &v1.EventList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *events) List(opts api.ListOptions) (result *v1.EventList, err error) {
}
// Watch returns a watch.Interface that watches the requested events.
func (c *events) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -19,10 +19,10 @@ package v1
import (
"fmt"
"k8s.io/client-go/1.5/pkg/api"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/pkg/fields"
"k8s.io/client-go/1.5/pkg/runtime"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/pkg/runtime"
)
// The EventExpansion interface allows manually adding extra methods to the EventInterface.
@ -116,7 +116,7 @@ func (e *events) Search(objOrRef runtime.Object) (*v1.EventList, error) {
refUID = &stringRefUID
}
fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID)
return e.List(api.ListOptions{FieldSelector: fieldSelector})
return e.List(v1.ListOptions{FieldSelector: fieldSelector.String()})
}
// Returns the appropriate field selector based on the API version being used to communicate with the server.

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -24,8 +24,6 @@ type EndpointsExpansion interface{}
type LimitRangeExpansion interface{}
type NodeExpansion interface{}
type PersistentVolumeExpansion interface{}
type PersistentVolumeClaimExpansion interface{}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// LimitRangesGetter has a method to return a LimitRangeInterface.
@ -32,25 +33,25 @@ type LimitRangesGetter interface {
type LimitRangeInterface interface {
Create(*v1.LimitRange) (*v1.LimitRange, error)
Update(*v1.LimitRange) (*v1.LimitRange, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.LimitRange, error)
List(opts api.ListOptions) (*v1.LimitRangeList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.LimitRangeList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error)
LimitRangeExpansion
}
// limitRanges implements LimitRangeInterface
type limitRanges struct {
client *CoreClient
client rest.Interface
ns string
}
// newLimitRanges returns a LimitRanges
func newLimitRanges(c *CoreClient, namespace string) *limitRanges {
func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges {
return &limitRanges{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *limitRanges) Update(limitRange *v1.LimitRange) (result *v1.LimitRange,
}
// Delete takes name of the limitRange and deletes it. Returns an error if one occurs.
func (c *limitRanges) Delete(name string, options *api.DeleteOptions) error {
func (c *limitRanges) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
@ -92,7 +93,7 @@ func (c *limitRanges) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *limitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *limitRanges) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
@ -115,7 +116,7 @@ func (c *limitRanges) Get(name string) (result *v1.LimitRange, err error) {
}
// List takes label and field selectors, and returns the list of LimitRanges that match those selectors.
func (c *limitRanges) List(opts api.ListOptions) (result *v1.LimitRangeList, err error) {
func (c *limitRanges) List(opts v1.ListOptions) (result *v1.LimitRangeList, err error) {
result = &v1.LimitRangeList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *limitRanges) List(opts api.ListOptions) (result *v1.LimitRangeList, err
}
// Watch returns a watch.Interface that watches the requested limitRanges.
func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *limitRanges) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// NamespacesGetter has a method to return a NamespaceInterface.
@ -33,24 +34,24 @@ type NamespaceInterface interface {
Create(*v1.Namespace) (*v1.Namespace, error)
Update(*v1.Namespace) (*v1.Namespace, error)
UpdateStatus(*v1.Namespace) (*v1.Namespace, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Namespace, error)
List(opts api.ListOptions) (*v1.NamespaceList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.NamespaceList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error)
NamespaceExpansion
}
// namespaces implements NamespaceInterface
type namespaces struct {
client *CoreClient
client rest.Interface
}
// newNamespaces returns a Namespaces
func newNamespaces(c *CoreClient) *namespaces {
func newNamespaces(c *CoreV1Client) *namespaces {
return &namespaces{
client: c,
client: c.RESTClient(),
}
}
@ -90,7 +91,7 @@ func (c *namespaces) UpdateStatus(namespace *v1.Namespace) (result *v1.Namespace
}
// Delete takes name of the namespace and deletes it. Returns an error if one occurs.
func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
func (c *namespaces) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("namespaces").
Name(name).
@ -100,7 +101,7 @@ func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *namespaces) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Resource("namespaces").
VersionedParams(&listOptions, api.ParameterCodec).
@ -121,7 +122,7 @@ func (c *namespaces) Get(name string) (result *v1.Namespace, err error) {
}
// List takes label and field selectors, and returns the list of Namespaces that match those selectors.
func (c *namespaces) List(opts api.ListOptions) (result *v1.NamespaceList, err error) {
func (c *namespaces) List(opts v1.ListOptions) (result *v1.NamespaceList, err error) {
result = &v1.NamespaceList{}
err = c.client.Get().
Resource("namespaces").
@ -132,7 +133,7 @@ func (c *namespaces) List(opts api.ListOptions) (result *v1.NamespaceList, err e
}
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *namespaces) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("namespaces").

View file

@ -16,7 +16,7 @@ limitations under the License.
package v1
import "k8s.io/client-go/1.5/pkg/api/v1"
import "k8s.io/client-go/pkg/api/v1"
// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface.
type NamespaceExpansion interface {

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// NodesGetter has a method to return a NodeInterface.
@ -33,24 +34,24 @@ type NodeInterface interface {
Create(*v1.Node) (*v1.Node, error)
Update(*v1.Node) (*v1.Node, error)
UpdateStatus(*v1.Node) (*v1.Node, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Node, error)
List(opts api.ListOptions) (*v1.NodeList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.NodeList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Node, err error)
NodeExpansion
}
// nodes implements NodeInterface
type nodes struct {
client *CoreClient
client rest.Interface
}
// newNodes returns a Nodes
func newNodes(c *CoreClient) *nodes {
func newNodes(c *CoreV1Client) *nodes {
return &nodes{
client: c,
client: c.RESTClient(),
}
}
@ -90,7 +91,7 @@ func (c *nodes) UpdateStatus(node *v1.Node) (result *v1.Node, err error) {
}
// Delete takes name of the node and deletes it. Returns an error if one occurs.
func (c *nodes) Delete(name string, options *api.DeleteOptions) error {
func (c *nodes) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("nodes").
Name(name).
@ -100,7 +101,7 @@ func (c *nodes) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *nodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *nodes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Resource("nodes").
VersionedParams(&listOptions, api.ParameterCodec).
@ -121,7 +122,7 @@ func (c *nodes) Get(name string) (result *v1.Node, err error) {
}
// List takes label and field selectors, and returns the list of Nodes that match those selectors.
func (c *nodes) List(opts api.ListOptions) (result *v1.NodeList, err error) {
func (c *nodes) List(opts v1.ListOptions) (result *v1.NodeList, err error) {
result = &v1.NodeList{}
err = c.client.Get().
Resource("nodes").
@ -132,7 +133,7 @@ func (c *nodes) List(opts api.ListOptions) (result *v1.NodeList, err error) {
}
// Watch returns a watch.Interface that watches the requested nodes.
func (c *nodes) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *nodes) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("nodes").

View file

@ -0,0 +1,43 @@
/*
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/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1"
)
// The NodeExpansion interface allows manually adding extra methods to the NodeInterface.
type NodeExpansion interface {
// PatchStatus modifies the status of an existing node. It returns the copy
// of the node that the server returns, or an error.
PatchStatus(nodeName string, data []byte) (*v1.Node, error)
}
// PatchStatus modifies the status of an existing node. It returns the copy of
// the node that the server returns, or an error.
func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) {
result := &v1.Node{}
err := c.client.Patch(api.StrategicMergePatchType).
Resource("nodes").
Name(nodeName).
SubResource("status").
Body(data).
Do().
Into(result)
return result, err
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PersistentVolumesGetter has a method to return a PersistentVolumeInterface.
@ -33,24 +34,24 @@ type PersistentVolumeInterface interface {
Create(*v1.PersistentVolume) (*v1.PersistentVolume, error)
Update(*v1.PersistentVolume) (*v1.PersistentVolume, error)
UpdateStatus(*v1.PersistentVolume) (*v1.PersistentVolume, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.PersistentVolume, error)
List(opts api.ListOptions) (*v1.PersistentVolumeList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.PersistentVolumeList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error)
PersistentVolumeExpansion
}
// persistentVolumes implements PersistentVolumeInterface
type persistentVolumes struct {
client *CoreClient
client rest.Interface
}
// newPersistentVolumes returns a PersistentVolumes
func newPersistentVolumes(c *CoreClient) *persistentVolumes {
func newPersistentVolumes(c *CoreV1Client) *persistentVolumes {
return &persistentVolumes{
client: c,
client: c.RESTClient(),
}
}
@ -90,7 +91,7 @@ func (c *persistentVolumes) UpdateStatus(persistentVolume *v1.PersistentVolume)
}
// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs.
func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) error {
func (c *persistentVolumes) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("persistentvolumes").
Name(name).
@ -100,7 +101,7 @@ func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) erro
}
// DeleteCollection deletes a collection of objects.
func (c *persistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *persistentVolumes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Resource("persistentvolumes").
VersionedParams(&listOptions, api.ParameterCodec).
@ -121,7 +122,7 @@ func (c *persistentVolumes) Get(name string) (result *v1.PersistentVolume, err e
}
// List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors.
func (c *persistentVolumes) List(opts api.ListOptions) (result *v1.PersistentVolumeList, err error) {
func (c *persistentVolumes) List(opts v1.ListOptions) (result *v1.PersistentVolumeList, err error) {
result = &v1.PersistentVolumeList{}
err = c.client.Get().
Resource("persistentvolumes").
@ -132,7 +133,7 @@ func (c *persistentVolumes) List(opts api.ListOptions) (result *v1.PersistentVol
}
// Watch returns a watch.Interface that watches the requested persistentVolumes.
func (c *persistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *persistentVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("persistentvolumes").

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface.
@ -33,25 +34,25 @@ type PersistentVolumeClaimInterface interface {
Create(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
Update(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
UpdateStatus(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.PersistentVolumeClaim, error)
List(opts api.ListOptions) (*v1.PersistentVolumeClaimList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.PersistentVolumeClaimList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error)
PersistentVolumeClaimExpansion
}
// persistentVolumeClaims implements PersistentVolumeClaimInterface
type persistentVolumeClaims struct {
client *CoreClient
client rest.Interface
ns string
}
// newPersistentVolumeClaims returns a PersistentVolumeClaims
func newPersistentVolumeClaims(c *CoreClient, namespace string) *persistentVolumeClaims {
func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims {
return &persistentVolumeClaims{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +96,7 @@ func (c *persistentVolumeClaims) UpdateStatus(persistentVolumeClaim *v1.Persiste
}
// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs.
func (c *persistentVolumeClaims) Delete(name string, options *api.DeleteOptions) error {
func (c *persistentVolumeClaims) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("persistentvolumeclaims").
@ -106,7 +107,7 @@ func (c *persistentVolumeClaims) Delete(name string, options *api.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *persistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *persistentVolumeClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("persistentvolumeclaims").
@ -129,7 +130,7 @@ func (c *persistentVolumeClaims) Get(name string) (result *v1.PersistentVolumeCl
}
// List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors.
func (c *persistentVolumeClaims) List(opts api.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
func (c *persistentVolumeClaims) List(opts v1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
result = &v1.PersistentVolumeClaimList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +142,7 @@ func (c *persistentVolumeClaims) List(opts api.ListOptions) (result *v1.Persiste
}
// Watch returns a watch.Interface that watches the requested persistentVolumeClaims.
func (c *persistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *persistentVolumeClaims) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PodsGetter has a method to return a PodInterface.
@ -33,25 +34,25 @@ type PodInterface interface {
Create(*v1.Pod) (*v1.Pod, error)
Update(*v1.Pod) (*v1.Pod, error)
UpdateStatus(*v1.Pod) (*v1.Pod, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Pod, error)
List(opts api.ListOptions) (*v1.PodList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.PodList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error)
PodExpansion
}
// pods implements PodInterface
type pods struct {
client *CoreClient
client rest.Interface
ns string
}
// newPods returns a Pods
func newPods(c *CoreClient, namespace string) *pods {
func newPods(c *CoreV1Client, namespace string) *pods {
return &pods{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +96,7 @@ func (c *pods) UpdateStatus(pod *v1.Pod) (result *v1.Pod, err error) {
}
// Delete takes name of the pod and deletes it. Returns an error if one occurs.
func (c *pods) Delete(name string, options *api.DeleteOptions) error {
func (c *pods) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pods").
@ -106,7 +107,7 @@ func (c *pods) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *pods) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *pods) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pods").
@ -129,7 +130,7 @@ func (c *pods) Get(name string) (result *v1.Pod, err error) {
}
// List takes label and field selectors, and returns the list of Pods that match those selectors.
func (c *pods) List(opts api.ListOptions) (result *v1.PodList, err error) {
func (c *pods) List(opts v1.ListOptions) (result *v1.PodList, err error) {
result = &v1.PodList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +142,7 @@ func (c *pods) List(opts api.ListOptions) (result *v1.PodList, err error) {
}
// Watch returns a watch.Interface that watches the requested pods.
func (c *pods) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *pods) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -17,10 +17,10 @@ limitations under the License.
package v1
import (
"k8s.io/client-go/1.5/pkg/api"
"k8s.io/client-go/1.5/pkg/api/v1"
policy "k8s.io/client-go/1.5/pkg/apis/policy/v1alpha1"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/v1"
policy "k8s.io/client-go/pkg/apis/policy/v1beta1"
"k8s.io/client-go/rest"
)
// The PodExpansion interface allows manually adding extra methods to the PodInterface.

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PodTemplatesGetter has a method to return a PodTemplateInterface.
@ -32,25 +33,25 @@ type PodTemplatesGetter interface {
type PodTemplateInterface interface {
Create(*v1.PodTemplate) (*v1.PodTemplate, error)
Update(*v1.PodTemplate) (*v1.PodTemplate, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.PodTemplate, error)
List(opts api.ListOptions) (*v1.PodTemplateList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.PodTemplateList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error)
PodTemplateExpansion
}
// podTemplates implements PodTemplateInterface
type podTemplates struct {
client *CoreClient
client rest.Interface
ns string
}
// newPodTemplates returns a PodTemplates
func newPodTemplates(c *CoreClient, namespace string) *podTemplates {
func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates {
return &podTemplates{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *podTemplates) Update(podTemplate *v1.PodTemplate) (result *v1.PodTempla
}
// Delete takes name of the podTemplate and deletes it. Returns an error if one occurs.
func (c *podTemplates) Delete(name string, options *api.DeleteOptions) error {
func (c *podTemplates) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podtemplates").
@ -92,7 +93,7 @@ func (c *podTemplates) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *podTemplates) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *podTemplates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podtemplates").
@ -115,7 +116,7 @@ func (c *podTemplates) Get(name string) (result *v1.PodTemplate, err error) {
}
// List takes label and field selectors, and returns the list of PodTemplates that match those selectors.
func (c *podTemplates) List(opts api.ListOptions) (result *v1.PodTemplateList, err error) {
func (c *podTemplates) List(opts v1.ListOptions) (result *v1.PodTemplateList, err error) {
result = &v1.PodTemplateList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *podTemplates) List(opts api.ListOptions) (result *v1.PodTemplateList, e
}
// Watch returns a watch.Interface that watches the requested podTemplates.
func (c *podTemplates) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *podTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ReplicationControllersGetter has a method to return a ReplicationControllerInterface.
@ -33,25 +34,25 @@ type ReplicationControllerInterface interface {
Create(*v1.ReplicationController) (*v1.ReplicationController, error)
Update(*v1.ReplicationController) (*v1.ReplicationController, error)
UpdateStatus(*v1.ReplicationController) (*v1.ReplicationController, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.ReplicationController, error)
List(opts api.ListOptions) (*v1.ReplicationControllerList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ReplicationControllerList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error)
ReplicationControllerExpansion
}
// replicationControllers implements ReplicationControllerInterface
type replicationControllers struct {
client *CoreClient
client rest.Interface
ns string
}
// newReplicationControllers returns a ReplicationControllers
func newReplicationControllers(c *CoreClient, namespace string) *replicationControllers {
func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers {
return &replicationControllers{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +96,7 @@ func (c *replicationControllers) UpdateStatus(replicationController *v1.Replicat
}
// Delete takes name of the replicationController and deletes it. Returns an error if one occurs.
func (c *replicationControllers) Delete(name string, options *api.DeleteOptions) error {
func (c *replicationControllers) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("replicationcontrollers").
@ -106,7 +107,7 @@ func (c *replicationControllers) Delete(name string, options *api.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *replicationControllers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *replicationControllers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("replicationcontrollers").
@ -129,7 +130,7 @@ func (c *replicationControllers) Get(name string) (result *v1.ReplicationControl
}
// List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors.
func (c *replicationControllers) List(opts api.ListOptions) (result *v1.ReplicationControllerList, err error) {
func (c *replicationControllers) List(opts v1.ListOptions) (result *v1.ReplicationControllerList, err error) {
result = &v1.ReplicationControllerList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +142,7 @@ func (c *replicationControllers) List(opts api.ListOptions) (result *v1.Replicat
}
// Watch returns a watch.Interface that watches the requested replicationControllers.
func (c *replicationControllers) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *replicationControllers) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ResourceQuotasGetter has a method to return a ResourceQuotaInterface.
@ -33,25 +34,25 @@ type ResourceQuotaInterface interface {
Create(*v1.ResourceQuota) (*v1.ResourceQuota, error)
Update(*v1.ResourceQuota) (*v1.ResourceQuota, error)
UpdateStatus(*v1.ResourceQuota) (*v1.ResourceQuota, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.ResourceQuota, error)
List(opts api.ListOptions) (*v1.ResourceQuotaList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ResourceQuotaList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error)
ResourceQuotaExpansion
}
// resourceQuotas implements ResourceQuotaInterface
type resourceQuotas struct {
client *CoreClient
client rest.Interface
ns string
}
// newResourceQuotas returns a ResourceQuotas
func newResourceQuotas(c *CoreClient, namespace string) *resourceQuotas {
func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas {
return &resourceQuotas{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +96,7 @@ func (c *resourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (result *
}
// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs.
func (c *resourceQuotas) Delete(name string, options *api.DeleteOptions) error {
func (c *resourceQuotas) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resourcequotas").
@ -106,7 +107,7 @@ func (c *resourceQuotas) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *resourceQuotas) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *resourceQuotas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resourcequotas").
@ -129,7 +130,7 @@ func (c *resourceQuotas) Get(name string) (result *v1.ResourceQuota, err error)
}
// List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors.
func (c *resourceQuotas) List(opts api.ListOptions) (result *v1.ResourceQuotaList, err error) {
func (c *resourceQuotas) List(opts v1.ListOptions) (result *v1.ResourceQuotaList, err error) {
result = &v1.ResourceQuotaList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +142,7 @@ func (c *resourceQuotas) List(opts api.ListOptions) (result *v1.ResourceQuotaLis
}
// Watch returns a watch.Interface that watches the requested resourceQuotas.
func (c *resourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *resourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// SecretsGetter has a method to return a SecretInterface.
@ -32,25 +33,25 @@ type SecretsGetter interface {
type SecretInterface interface {
Create(*v1.Secret) (*v1.Secret, error)
Update(*v1.Secret) (*v1.Secret, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Secret, error)
List(opts api.ListOptions) (*v1.SecretList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.SecretList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error)
SecretExpansion
}
// secrets implements SecretInterface
type secrets struct {
client *CoreClient
client rest.Interface
ns string
}
// newSecrets returns a Secrets
func newSecrets(c *CoreClient, namespace string) *secrets {
func newSecrets(c *CoreV1Client, namespace string) *secrets {
return &secrets{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *secrets) Update(secret *v1.Secret) (result *v1.Secret, err error) {
}
// Delete takes name of the secret and deletes it. Returns an error if one occurs.
func (c *secrets) Delete(name string, options *api.DeleteOptions) error {
func (c *secrets) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("secrets").
@ -92,7 +93,7 @@ func (c *secrets) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *secrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *secrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("secrets").
@ -115,7 +116,7 @@ func (c *secrets) Get(name string) (result *v1.Secret, err error) {
}
// List takes label and field selectors, and returns the list of Secrets that match those selectors.
func (c *secrets) List(opts api.ListOptions) (result *v1.SecretList, err error) {
func (c *secrets) List(opts v1.ListOptions) (result *v1.SecretList, err error) {
result = &v1.SecretList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *secrets) List(opts api.ListOptions) (result *v1.SecretList, err error)
}
// Watch returns a watch.Interface that watches the requested secrets.
func (c *secrets) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *secrets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ServicesGetter has a method to return a ServiceInterface.
@ -33,25 +34,25 @@ type ServiceInterface interface {
Create(*v1.Service) (*v1.Service, error)
Update(*v1.Service) (*v1.Service, error)
UpdateStatus(*v1.Service) (*v1.Service, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.Service, error)
List(opts api.ListOptions) (*v1.ServiceList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ServiceList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Service, err error)
ServiceExpansion
}
// services implements ServiceInterface
type services struct {
client *CoreClient
client rest.Interface
ns string
}
// newServices returns a Services
func newServices(c *CoreClient, namespace string) *services {
func newServices(c *CoreV1Client, namespace string) *services {
return &services{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +96,7 @@ func (c *services) UpdateStatus(service *v1.Service) (result *v1.Service, err er
}
// Delete takes name of the service and deletes it. Returns an error if one occurs.
func (c *services) Delete(name string, options *api.DeleteOptions) error {
func (c *services) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("services").
@ -106,7 +107,7 @@ func (c *services) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *services) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *services) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("services").
@ -129,7 +130,7 @@ func (c *services) Get(name string) (result *v1.Service, err error) {
}
// List takes label and field selectors, and returns the list of Services that match those selectors.
func (c *services) List(opts api.ListOptions) (result *v1.ServiceList, err error) {
func (c *services) List(opts v1.ListOptions) (result *v1.ServiceList, err error) {
result = &v1.ServiceList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +142,7 @@ func (c *services) List(opts api.ListOptions) (result *v1.ServiceList, err error
}
// Watch returns a watch.Interface that watches the requested services.
func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *services) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -17,8 +17,8 @@ limitations under the License.
package v1
import (
"k8s.io/client-go/1.5/pkg/util/net"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/pkg/util/net"
"k8s.io/client-go/rest"
)
// The ServiceExpansion interface allows manually adding extra methods to the ServiceInterface.

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1 "k8s.io/client-go/1.5/pkg/api/v1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// ServiceAccountsGetter has a method to return a ServiceAccountInterface.
@ -32,25 +33,25 @@ type ServiceAccountsGetter interface {
type ServiceAccountInterface interface {
Create(*v1.ServiceAccount) (*v1.ServiceAccount, error)
Update(*v1.ServiceAccount) (*v1.ServiceAccount, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1.ServiceAccount, error)
List(opts api.ListOptions) (*v1.ServiceAccountList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1.ServiceAccountList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error)
ServiceAccountExpansion
}
// serviceAccounts implements ServiceAccountInterface
type serviceAccounts struct {
client *CoreClient
client rest.Interface
ns string
}
// newServiceAccounts returns a ServiceAccounts
func newServiceAccounts(c *CoreClient, namespace string) *serviceAccounts {
func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts {
return &serviceAccounts{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -81,7 +82,7 @@ func (c *serviceAccounts) Update(serviceAccount *v1.ServiceAccount) (result *v1.
}
// Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs.
func (c *serviceAccounts) Delete(name string, options *api.DeleteOptions) error {
func (c *serviceAccounts) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serviceaccounts").
@ -92,7 +93,7 @@ func (c *serviceAccounts) Delete(name string, options *api.DeleteOptions) error
}
// DeleteCollection deletes a collection of objects.
func (c *serviceAccounts) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *serviceAccounts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serviceaccounts").
@ -115,7 +116,7 @@ func (c *serviceAccounts) Get(name string) (result *v1.ServiceAccount, err error
}
// List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors.
func (c *serviceAccounts) List(opts api.ListOptions) (result *v1.ServiceAccountList, err error) {
func (c *serviceAccounts) List(opts v1.ListOptions) (result *v1.ServiceAccountList, err error) {
result = &v1.ServiceAccountList{}
err = c.client.Get().
Namespace(c.ns).
@ -127,7 +128,7 @@ func (c *serviceAccounts) List(opts api.ListOptions) (result *v1.ServiceAccountL
}
// Watch returns a watch.Interface that watches the requested serviceAccounts.
func (c *serviceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *serviceAccounts) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,11 @@ limitations under the License.
package v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1beta1 "k8s.io/client-go/1.5/pkg/apis/extensions/v1beta1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@ -33,25 +35,25 @@ type DaemonSetInterface interface {
Create(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error)
Update(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error)
UpdateStatus(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1beta1.DaemonSet, error)
List(opts api.ListOptions) (*v1beta1.DaemonSetList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1beta1.DaemonSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error)
DaemonSetExpansion
}
// daemonSets implements DaemonSetInterface
type daemonSets struct {
client *ExtensionsClient
client rest.Interface
ns string
}
// newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets {
return &daemonSets{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +97,7 @@ func (c *daemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (result *v1beta1
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error {
func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
@ -106,7 +108,7 @@ func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *daemonSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
@ -129,7 +131,7 @@ func (c *daemonSets) Get(name string) (result *v1beta1.DaemonSet, err error) {
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(opts api.ListOptions) (result *v1beta1.DaemonSetList, err error) {
func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) {
result = &v1beta1.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +143,7 @@ func (c *daemonSets) List(opts api.ListOptions) (result *v1beta1.DaemonSetList,
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -17,9 +17,11 @@ limitations under the License.
package v1beta1
import (
api "k8s.io/client-go/1.5/pkg/api"
v1beta1 "k8s.io/client-go/1.5/pkg/apis/extensions/v1beta1"
watch "k8s.io/client-go/1.5/pkg/watch"
api "k8s.io/client-go/pkg/api"
v1 "k8s.io/client-go/pkg/api/v1"
v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1"
watch "k8s.io/client-go/pkg/watch"
rest "k8s.io/client-go/rest"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@ -33,25 +35,25 @@ type DeploymentInterface interface {
Create(*v1beta1.Deployment) (*v1beta1.Deployment, error)
Update(*v1beta1.Deployment) (*v1beta1.Deployment, error)
UpdateStatus(*v1beta1.Deployment) (*v1beta1.Deployment, error)
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string) (*v1beta1.Deployment, error)
List(opts api.ListOptions) (*v1beta1.DeploymentList, error)
Watch(opts api.ListOptions) (watch.Interface, error)
List(opts v1.ListOptions) (*v1beta1.DeploymentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error)
DeploymentExpansion
}
// deployments implements DeploymentInterface
type deployments struct {
client *ExtensionsClient
client rest.Interface
ns string
}
// newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments {
return &deployments{
client: c,
client: c.RESTClient(),
ns: namespace,
}
}
@ -95,7 +97,7 @@ func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1be
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
func (c *deployments) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
@ -106,7 +108,7 @@ func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *deployments) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
@ -129,7 +131,7 @@ func (c *deployments) Get(name string) (result *v1beta1.Deployment, err error) {
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(opts api.ListOptions) (result *v1beta1.DeploymentList, err error) {
func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
result = &v1beta1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
@ -141,7 +143,7 @@ func (c *deployments) List(opts api.ListOptions) (result *v1beta1.DeploymentList
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) {
func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View file

@ -16,7 +16,7 @@ limitations under the License.
package v1beta1
import "k8s.io/client-go/1.5/pkg/apis/extensions/v1beta1"
import "k8s.io/client-go/pkg/apis/extensions/v1beta1"
// The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface.
type DeploymentExpansion interface {

View file

@ -1,5 +1,5 @@
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2017 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.
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// This package has the automatically generated typed clients.
package v1beta1

Some files were not shown because too many files have changed in this diff Show more