Compare commits

..

3 Commits

Author SHA1 Message Date
Chao Xu
843f7c4f28 Merge pull request #22 from caesarxuchao/1.5
manually copy the fix the fake_pod_expansion.go
2016-10-23 13:27:10 -07:00
Chao Xu
496ce4be34 manually copy the fix the fake_pod_expansion.go 2016-10-21 10:06:26 -07:00
Chao Xu
4e647cdbb2 Merge pull request #16 from caesarxuchao/1.5
remove 1.4 folder from 1.5 branch
2016-10-17 11:08:08 -07:00
1520 changed files with 92918 additions and 126507 deletions

View File

@@ -1,7 +1,7 @@
{
"ImportPath": "k8s.io/client-go",
"GoVersion": "go1.7",
"GodepVersion": "v75",
"ImportPath": "k8s.io/client-go/1.5",
"GoVersion": "go1.6",
"GodepVersion": "v74",
"Packages": [
"./..."
],
@@ -79,14 +79,6 @@
"Comment": "v2.4.0-rc.1-38-gcd27f17",
"Rev": "cd27f179f2c10c5d300e6d09025b538c475b0d51"
},
{
"ImportPath": "github.com/docker/spdystream",
"Rev": "449fdfce4d962303d702fec724ef0ad181c92528"
},
{
"ImportPath": "github.com/docker/spdystream/spdy",
"Rev": "449fdfce4d962303d702fec724ef0ad181c92528"
},
{
"ImportPath": "github.com/emicklei/go-restful",
"Comment": "v1.2-79-g89ef8af",
@@ -161,6 +153,10 @@
"ImportPath": "github.com/jonboulle/clockwork",
"Rev": "72f9bd7c4e0c2a40055ab3d0f09654f730cce982"
},
{
"ImportPath": "github.com/juju/ratelimit",
"Rev": "77ed1c8a01217656d2080ad51981f6e99adaa177"
},
{
"ImportPath": "github.com/mailru/easyjson/buffer",
"Rev": "d5b7844b561a7bc640052f1b935f7b800330d7e0"
@@ -177,18 +173,9 @@
"ImportPath": "github.com/pborman/uuid",
"Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4"
},
{
"ImportPath": "github.com/pmezard/go-difflib/difflib",
"Rev": "d8ed2627bdf02c080bf22230dbb337003b7aba2d"
},
{
"ImportPath": "github.com/spf13/pflag",
"Rev": "5ccb023bc27df288a957c5e994cd44fd19619465"
},
{
"ImportPath": "github.com/stretchr/testify/assert",
"Comment": "v1.0-88-ge3a8ff8",
"Rev": "e3a8ff8ce36581f87a15341206f205b1da467059"
"Rev": "1560c1005499d61b80f865c04d39ca7505bf7f0b"
},
{
"ImportPath": "github.com/ugorji/go/codec",
@@ -244,7 +231,7 @@
},
{
"ImportPath": "golang.org/x/sys/unix",
"Rev": "8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9"
"Rev": "9c60d1c508f5134d1ca726b4641db998f2523357"
},
{
"ImportPath": "golang.org/x/text/cases",

View File

View File

@@ -176,7 +176,18 @@
END OF TERMS AND CONDITIONS
Copyright 2014-2015 Docker, Inc.
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.

View File

@@ -25,35 +25,25 @@ import (
"github.com/emicklei/go-restful/swagger"
"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"
"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"
)
// 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
@@ -90,7 +80,7 @@ type SwaggerSchemaInterface interface {
// DiscoveryClient implements the functions that discover server-supported API groups,
// versions and resources.
type DiscoveryClient struct {
restClient rest.Interface
*rest.RESTClient
LegacyPrefix string
}
@@ -117,7 +107,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.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
err = d.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
apiGroup := unversioned.APIGroup{}
if err == nil {
apiGroup = apiVersionsToAPIGroup(v)
@@ -128,7 +118,7 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList
// Get the groupVersions exposed at /apis
apiGroupList = &unversioned.APIGroupList{}
err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList)
err = d.Get().AbsPath("/apis").Do().Into(apiGroupList)
if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
return nil, err
}
@@ -154,7 +144,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r
url.Path = "/apis/" + groupVersion
}
resources = &unversioned.APIResourceList{}
err = d.restClient.Get().AbsPath(url.String()).Do().Into(resources)
err = d.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)) {
@@ -209,46 +199,39 @@ 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) {
// retry in case the groups supported by the server change after ServerGroup() returns.
const maxRetries = 2
var failedGroups map[unversioned.GroupVersion]error
var results []unversioned.GroupVersionResource
RetrieveGroups:
for i := 0; i < maxRetries; i++ {
results = []unversioned.GroupVersionResource{}
failedGroups = make(map[unversioned.GroupVersion]error)
serverGroupList, err := d.ServerGroups()
if err != nil {
return results, err
}
results := []unversioned.GroupVersionResource{}
serverGroupList, err := d.ServerGroups()
if err != nil {
return results, err
}
for _, apiGroup := range serverGroupList.Groups {
preferredVersion := apiGroup.PreferredVersion
groupVersion := unversioned.GroupVersion{Group: apiGroup.Name, Version: preferredVersion.Version}
apiResourceList, err := d.ServerResourcesForGroupVersion(preferredVersion.GroupVersion)
if err != nil {
if i < maxRetries-1 {
continue RetrieveGroups
}
failedGroups[groupVersion] = err
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)
if err != nil {
if failedGroups == nil {
failedGroups = make(map[unversioned.GroupVersion]error)
}
failedGroups[groupVersion] = err
continue
}
for _, apiResource := range apiResourceList.APIResources {
// ignore the root scoped resources if "namespaced" is true.
if namespaced && !apiResource.Namespaced {
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
}
results = append(results, groupVersion.WithResource(apiResource.Name))
if strings.Contains(apiResource.Name, "/") {
continue
}
}
if len(failedGroups) == 0 {
return results, nil
results = append(results, groupVersion.WithResource(apiResource.Name))
}
}
return results, &ErrGroupDiscoveryFailed{Groups: failedGroups}
if len(failedGroups) > 0 {
return results, &ErrGroupDiscoveryFailed{Groups: failedGroups}
}
return results, nil
}
// ServerPreferredResources returns the supported resources with the version preferred by the
@@ -265,7 +248,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.restClient.Get().AbsPath("/version").Do().Raw()
body, err := d.Get().AbsPath("/version").Do().Raw()
if err != nil {
return nil, err
}
@@ -299,7 +282,7 @@ func (d *DiscoveryClient) SwaggerSchema(version unversioned.GroupVersion) (*swag
path = "/swaggerapi/apis/" + version.Group + "/" + version.Version
}
body, err := d.restClient.Get().AbsPath(path).Do().Raw()
body, err := d.Get().AbsPath(path).Do().Raw()
if err != nil {
return nil, err
}
@@ -315,7 +298,10 @@ 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})
config.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(
runtime.SerializerInfo{Serializer: codec},
runtime.StreamSerializerInfo{},
)
if len(config.UserAgent) == 0 {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
@@ -330,7 +316,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
@@ -345,8 +331,8 @@ func NewDiscoveryClientForConfigOrDie(c *rest.Config) *DiscoveryClient {
}
// New creates a new DiscoveryClient for the given RESTClient.
func NewDiscoveryClient(c rest.Interface) *DiscoveryClient {
return &DiscoveryClient{restClient: c, LegacyPrefix: "/api"}
func NewDiscoveryClient(c *rest.RESTClient) *DiscoveryClient {
return &DiscoveryClient{RESTClient: c, LegacyPrefix: "/api"}
}
func stringDoesntExistIn(str string, slice []string) bool {
@@ -357,12 +343,3 @@ 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
}

View File

@@ -25,10 +25,10 @@ import (
"github.com/emicklei/go-restful/swagger"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/version"
"k8s.io/client-go/rest"
"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/version"
"k8s.io/client-go/1.5/rest"
)
func TestGetServerVersion(t *testing.T) {
@@ -454,102 +454,3 @@ func TestGetServerPreferredResources(t *testing.T) {
server.Close()
}
}
func TestGetServerPreferredResourcesRetries(t *testing.T) {
stable := unversioned.APIResourceList{
GroupVersion: "v1",
APIResources: []unversioned.APIResource{
{Name: "pods", Namespaced: true, Kind: "Pod"},
},
}
beta := unversioned.APIResourceList{
GroupVersion: "extensions/v1",
APIResources: []unversioned.APIResource{
{Name: "deployments", Namespaced: true, Kind: "Deployment"},
},
}
response := func(numErrors int) http.HandlerFunc {
var i = 0
return func(w http.ResponseWriter, req *http.Request) {
var list interface{}
switch req.URL.Path {
case "/apis/extensions/v1beta1":
if i < numErrors {
i++
w.WriteHeader(http.StatusInternalServerError)
return
}
list = &beta
case "/api/v1":
list = &stable
case "/api":
list = &unversioned.APIVersions{
Versions: []string{
"v1",
},
}
case "/apis":
list = &unversioned.APIGroupList{
Groups: []unversioned.APIGroup{
{
Name: "extensions",
Versions: []unversioned.GroupVersionForDiscovery{
{GroupVersion: "extensions/v1beta1"},
},
PreferredVersion: unversioned.GroupVersionForDiscovery{
GroupVersion: "extensions/v1beta1",
Version: "v1beta1",
},
},
},
}
default:
t.Logf("unexpected request: %s", req.URL.Path)
w.WriteHeader(http.StatusNotFound)
return
}
output, err := json.Marshal(list)
if err != nil {
t.Errorf("unexpected encoding error: %v", err)
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write(output)
}
}
tests := []struct {
responseErrors int
expectResources int
expectedError func(err error) bool
}{
{
responseErrors: 1,
expectResources: 2,
expectedError: func(err error) bool {
return err == nil
},
},
{
responseErrors: 2,
expectResources: 1,
expectedError: IsGroupDiscoveryFailedError,
},
}
for i, tc := range tests {
server := httptest.NewServer(http.HandlerFunc(response(tc.responseErrors)))
defer server.Close()
client := NewDiscoveryClientForConfigOrDie(&rest.Config{Host: server.URL})
got, err := client.ServerPreferredResources()
if !tc.expectedError(err) {
t.Errorf("case %d: unexpected error: %v", i, err)
}
if len(got) != tc.expectResources {
t.Errorf("case %d: expect %d resources, got %#v", i, tc.expectResources, got)
}
server.Close()
}
}

View File

@@ -18,11 +18,10 @@ package fake
import (
"github.com/emicklei/go-restful/swagger"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/version"
"k8s.io/client-go/rest"
"k8s.io/client-go/testing"
"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/version"
"k8s.io/client-go/1.5/testing"
)
type FakeDiscovery struct {
@@ -81,7 +80,3 @@ func (c *FakeDiscovery) SwaggerSchema(version unversioned.GroupVersion) (*swagge
c.Invokes(action, nil)
return &swagger.ApiDeclaration{}, nil
}
func (c *FakeDiscovery) RESTClient() rest.Interface {
return nil
}

View File

@@ -20,11 +20,9 @@ import (
"fmt"
"sync"
"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"
"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"
)
// APIGroupResources is an API group with a mapping of versions to
@@ -37,7 +35,7 @@ type APIGroupResources struct {
}
// NewRESTMapper returns a PriorityRESTMapper based on the discovered
// groups and resources passed in.
// groups and resourced passed in.
func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.VersionInterfacesFunc) meta.RESTMapper {
unionMapper := meta.MultiRESTMapper{}
@@ -49,8 +47,8 @@ func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.V
groupPriority = append(groupPriority, group.Group.Name)
if len(group.Group.PreferredVersion.Version) != 0 {
preferred := group.Group.PreferredVersion.Version
if _, ok := group.VersionedResources[preferred]; ok {
preffered := group.Group.PreferredVersion.Version
if _, ok := group.VersionedResources[preffered]; ok {
resourcePriority = append(resourcePriority, unversioned.GroupVersionResource{
Group: group.Group.Name,
Version: group.Group.PreferredVersion.Version,
@@ -143,14 +141,14 @@ func GetAPIGroupResources(cl DiscoveryInterface) ([]*APIGroupResources, error) {
type DeferredDiscoveryRESTMapper struct {
initMu sync.Mutex
delegate meta.RESTMapper
cl CachedDiscoveryInterface
cl DiscoveryInterface
versionInterface meta.VersionInterfacesFunc
}
// NewDeferredDiscoveryRESTMapper returns a
// DeferredDiscoveryRESTMapper that will lazily query the provided
// client for discovery information to do REST mappings.
func NewDeferredDiscoveryRESTMapper(cl CachedDiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper {
func NewDeferredDiscoveryRESTMapper(cl DiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper {
return &DeferredDiscoveryRESTMapper{
cl: cl,
versionInterface: versionInterface,
@@ -177,118 +175,79 @@ 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) (gvk unversioned.GroupVersionKind, err error) {
func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, error) {
del, err := d.getDelegate()
if err != nil {
return unversioned.GroupVersionKind{}, err
}
gvk, err = del.KindFor(resource)
if err != nil && !d.cl.Fresh() {
d.Reset()
gvk, err = d.KindFor(resource)
}
return
return del.KindFor(resource)
}
// KindsFor takes a partial resource and returns back the list of
// potential kinds in priority order.
func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) (gvks []unversioned.GroupVersionKind, err error) {
func (d *DeferredDiscoveryRESTMapper) KindsFor(resource unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
gvks, err = del.KindsFor(resource)
if len(gvks) == 0 && !d.cl.Fresh() {
d.Reset()
gvks, err = d.KindsFor(resource)
}
return
return del.KindsFor(resource)
}
// 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) (gvr unversioned.GroupVersionResource, err error) {
func (d *DeferredDiscoveryRESTMapper) ResourceFor(input unversioned.GroupVersionResource) (unversioned.GroupVersionResource, error) {
del, err := d.getDelegate()
if err != nil {
return unversioned.GroupVersionResource{}, err
}
gvr, err = del.ResourceFor(input)
if err != nil && !d.cl.Fresh() {
d.Reset()
gvr, err = d.ResourceFor(input)
}
return
return del.ResourceFor(input)
}
// ResourcesFor takes a partial resource and returns back the list of
// potential resource in priority order.
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) (gvrs []unversioned.GroupVersionResource, err error) {
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
gvrs, err = del.ResourcesFor(input)
if len(gvrs) == 0 && !d.cl.Fresh() {
d.Reset()
gvrs, err = d.ResourcesFor(input)
}
return
return del.ResourcesFor(input)
}
// RESTMapping identifies a preferred resource mapping for the
// provided group kind.
func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (m *meta.RESTMapping, err error) {
func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
m, err = del.RESTMapping(gk, versions...)
if err != nil && !d.cl.Fresh() {
d.Reset()
m, err = d.RESTMapping(gk, versions...)
}
return
return del.RESTMapping(gk, versions...)
}
// 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) (ms []*meta.RESTMapping, err error) {
func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*meta.RESTMapping, error) {
del, err := d.getDelegate()
if err != nil {
return nil, err
}
ms, err = del.RESTMappings(gk)
if len(ms) == 0 && !d.cl.Fresh() {
d.Reset()
ms, err = d.RESTMappings(gk)
}
return
return del.RESTMappings(gk)
}
// AliasesForResource returns whether a resource has an alias or not.
func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) (as []string, ok bool) {
func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) ([]string, bool) {
del, err := d.getDelegate()
if err != nil {
return nil, false
}
as, ok = del.AliasesForResource(resource)
if len(as) == 0 && !d.cl.Fresh() {
d.Reset()
as, ok = d.AliasesForResource(resource)
}
return
return del.AliasesForResource(resource)
}
// ResourceSingularizer converts a resource name from plural to
@@ -298,12 +257,7 @@ func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (sin
if err != nil {
return resource, err
}
singular, err = del.ResourceSingularizer(resource)
if err != nil && !d.cl.Fresh() {
d.Reset()
singular, err = d.ResourceSingularizer(resource)
}
return
return del.ResourceSingularizer(resource)
}
func (d *DeferredDiscoveryRESTMapper) String() string {

View File

@@ -0,0 +1,176 @@
/*
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 (
"reflect"
"testing"
"k8s.io/client-go/1.5/pkg/api/unversioned"
)
func TestRESTMapper(t *testing.T) {
resources := []*APIGroupResources{
{
Group: unversioned.APIGroup{
Versions: []unversioned.GroupVersionForDiscovery{
{Version: "v1"},
{Version: "v2"},
},
PreferredVersion: unversioned.GroupVersionForDiscovery{Version: "v1"},
},
VersionedResources: map[string][]unversioned.APIResource{
"v1": {
{Name: "pods", Namespaced: true, Kind: "Pod"},
},
"v2": {
{Name: "pods", Namespaced: true, Kind: "Pod"},
},
},
},
{
Group: unversioned.APIGroup{
Name: "extensions",
Versions: []unversioned.GroupVersionForDiscovery{
{Version: "v1beta"},
},
PreferredVersion: unversioned.GroupVersionForDiscovery{Version: "v1beta"},
},
VersionedResources: map[string][]unversioned.APIResource{
"v1beta": {
{Name: "jobs", Namespaced: true, Kind: "Job"},
},
},
},
}
restMapper := NewRESTMapper(resources, nil)
kindTCs := []struct {
input unversioned.GroupVersionResource
want unversioned.GroupVersionKind
}{
{
input: unversioned.GroupVersionResource{
Version: "v1",
Resource: "pods",
},
want: unversioned.GroupVersionKind{
Version: "v1",
Kind: "Pod",
},
},
{
input: unversioned.GroupVersionResource{
Version: "v2",
Resource: "pods",
},
want: unversioned.GroupVersionKind{
Version: "v2",
Kind: "Pod",
},
},
{
input: unversioned.GroupVersionResource{
Resource: "pods",
},
want: unversioned.GroupVersionKind{
Version: "v1",
Kind: "Pod",
},
},
{
input: unversioned.GroupVersionResource{
Resource: "jobs",
},
want: unversioned.GroupVersionKind{
Group: "extensions",
Version: "v1beta",
Kind: "Job",
},
},
}
for _, tc := range kindTCs {
got, err := restMapper.KindFor(tc.input)
if err != nil {
t.Errorf("KindFor(%#v) unexpected error: %v", tc.input, err)
continue
}
if !reflect.DeepEqual(got, tc.want) {
t.Errorf("KindFor(%#v) = %#v, want %#v", tc.input, got, tc.want)
}
}
resourceTCs := []struct {
input unversioned.GroupVersionResource
want unversioned.GroupVersionResource
}{
{
input: unversioned.GroupVersionResource{
Version: "v1",
Resource: "pods",
},
want: unversioned.GroupVersionResource{
Version: "v1",
Resource: "pods",
},
},
{
input: unversioned.GroupVersionResource{
Version: "v2",
Resource: "pods",
},
want: unversioned.GroupVersionResource{
Version: "v2",
Resource: "pods",
},
},
{
input: unversioned.GroupVersionResource{
Resource: "pods",
},
want: unversioned.GroupVersionResource{
Version: "v1",
Resource: "pods",
},
},
{
input: unversioned.GroupVersionResource{
Resource: "jobs",
},
want: unversioned.GroupVersionResource{
Group: "extensions",
Version: "v1beta",
Resource: "jobs",
},
},
}
for _, tc := range resourceTCs {
got, err := restMapper.ResourceFor(tc.input)
if err != nil {
t.Errorf("ResourceFor(%#v) unexpected error: %v", tc.input, err)
continue
}
if !reflect.DeepEqual(got, tc.want) {
t.Errorf("ResourceFor(%#v) = %#v, want %#v", tc.input, got, tc.want)
}
}
}

View File

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

View File

@@ -26,15 +26,15 @@ import (
"net/url"
"strings"
"k8s.io/client-go/pkg/api"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/conversion/queryparams"
"k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/pkg/runtime/serializer"
"k8s.io/client-go/pkg/util/flowcontrol"
"k8s.io/client-go/pkg/watch"
"k8s.io/client-go/rest"
"k8s.io/client-go/1.5/pkg/api"
"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/conversion/queryparams"
"k8s.io/client-go/1.5/pkg/runtime"
"k8s.io/client-go/1.5/pkg/runtime/serializer"
"k8s.io/client-go/1.5/pkg/util/flowcontrol"
"k8s.io/client-go/1.5/pkg/watch"
"k8s.io/client-go/1.5/rest"
)
// Client is a Kubernetes client that allows you to access metadata
@@ -241,22 +241,13 @@ func (dynamicCodec) Encode(obj runtime.Object, w io.Writer) error {
// ContentConfig returns a rest.ContentConfig for dynamic types.
func ContentConfig() rest.ContentConfig {
var jsonInfo runtime.SerializerInfo
// TODO: api.Codecs here should become "pkg/apis/server/scheme" which is the minimal core you need
// to talk to a kubernetes server
for _, info := range api.Codecs.SupportedMediaTypes() {
if info.MediaType == runtime.ContentTypeJSON {
jsonInfo = info
break
}
}
jsonInfo.Serializer = dynamicCodec{}
jsonInfo.PrettySerializer = nil
// TODO: it's questionable that this should be using anything other than unstructured schema and JSON
codec := dynamicCodec{}
streamingInfo, _ := api.Codecs.StreamingSerializerForMediaType("application/json;stream=watch", nil)
return rest.ContentConfig{
AcceptContentTypes: runtime.ContentTypeJSON,
ContentType: runtime.ContentTypeJSON,
NegotiatedSerializer: serializer.NegotiatedSerializerWrapper(jsonInfo),
NegotiatedSerializer: serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: codec}, streamingInfo),
}
}

View File

@@ -19,9 +19,12 @@ package dynamic
import (
"sync"
"k8s.io/client-go/pkg/api/meta"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/rest"
"k8s.io/client-go/1.5/pkg/api"
"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/runtime"
"k8s.io/client-go/1.5/pkg/runtime/serializer"
"k8s.io/client-go/1.5/rest"
)
// ClientPool manages a pool of dynamic clients.
@@ -61,7 +64,6 @@ type clientPoolImpl struct {
// resources or groups.
func NewClientPool(config *rest.Config, mapper meta.RESTMapper, apiPathResolverFunc APIPathResolverFunc) ClientPool {
confCopy := *config
return &clientPoolImpl{
config: &confCopy,
clients: map[unversioned.GroupVersion]*Client{},
@@ -106,6 +108,11 @@ func (c *clientPoolImpl) ClientForGroupVersionKind(kind unversioned.GroupVersion
// we need to make a client
conf.GroupVersion = &gv
if conf.NegotiatedSerializer == nil {
streamingInfo, _ := api.Codecs.StreamingSerializerForMediaType("application/json;stream=watch", nil)
conf.NegotiatedSerializer = serializer.NegotiatedSerializerWrapper(runtime.SerializerInfo{Serializer: dynamicCodec{}}, streamingInfo)
}
dynamicClient, err := NewClient(conf)
if err != nil {
return nil, err

View File

@@ -25,14 +25,14 @@ import (
"reflect"
"testing"
"k8s.io/client-go/pkg/api"
"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/streaming"
"k8s.io/client-go/pkg/watch"
"k8s.io/client-go/pkg/watch/versioned"
"k8s.io/client-go/rest"
"k8s.io/client-go/1.5/pkg/api"
"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/streaming"
"k8s.io/client-go/1.5/pkg/watch"
"k8s.io/client-go/1.5/pkg/watch/versioned"
"k8s.io/client-go/1.5/rest"
)
func getJSON(version, kind, name string) []byte {
@@ -529,7 +529,6 @@ func TestPatch(t *testing.T) {
return
}
w.Header().Set("Content-Type", "application/json")
w.Write(data)
})
if err != nil {

View File

@@ -19,9 +19,9 @@ package dynamic
import (
"fmt"
"k8s.io/client-go/pkg/api/meta"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/pkg/runtime"
"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/runtime"
)
// VersionInterfaces provides an object converter and metadata

View File

@@ -19,7 +19,7 @@ package dynamic
import (
"testing"
"k8s.io/client-go/pkg/api/unversioned"
"k8s.io/client-go/1.5/pkg/api/unversioned"
)
func TestDiscoveryRESTMapper(t *testing.T) {

261
1.5/kubernetes/clientset.go Normal file
View File

@@ -0,0 +1,261 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 clientset.
package kubernetes

View File

@@ -0,0 +1,138 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
"k8s.io/client-go/1.5/discovery"
fakediscovery "k8s.io/client-go/1.5/discovery/fake"
clientset "k8s.io/client-go/1.5/kubernetes"
v1alpha1apps "k8s.io/client-go/1.5/kubernetes/typed/apps/v1alpha1"
fakev1alpha1apps "k8s.io/client-go/1.5/kubernetes/typed/apps/v1alpha1/fake"
v1beta1authentication "k8s.io/client-go/1.5/kubernetes/typed/authentication/v1beta1"
fakev1beta1authentication "k8s.io/client-go/1.5/kubernetes/typed/authentication/v1beta1/fake"
v1beta1authorization "k8s.io/client-go/1.5/kubernetes/typed/authorization/v1beta1"
fakev1beta1authorization "k8s.io/client-go/1.5/kubernetes/typed/authorization/v1beta1/fake"
v1autoscaling "k8s.io/client-go/1.5/kubernetes/typed/autoscaling/v1"
fakev1autoscaling "k8s.io/client-go/1.5/kubernetes/typed/autoscaling/v1/fake"
v1batch "k8s.io/client-go/1.5/kubernetes/typed/batch/v1"
fakev1batch "k8s.io/client-go/1.5/kubernetes/typed/batch/v1/fake"
v1alpha1certificates "k8s.io/client-go/1.5/kubernetes/typed/certificates/v1alpha1"
fakev1alpha1certificates "k8s.io/client-go/1.5/kubernetes/typed/certificates/v1alpha1/fake"
v1core "k8s.io/client-go/1.5/kubernetes/typed/core/v1"
fakev1core "k8s.io/client-go/1.5/kubernetes/typed/core/v1/fake"
v1beta1extensions "k8s.io/client-go/1.5/kubernetes/typed/extensions/v1beta1"
fakev1beta1extensions "k8s.io/client-go/1.5/kubernetes/typed/extensions/v1beta1/fake"
v1alpha1policy "k8s.io/client-go/1.5/kubernetes/typed/policy/v1alpha1"
fakev1alpha1policy "k8s.io/client-go/1.5/kubernetes/typed/policy/v1alpha1/fake"
v1alpha1rbac "k8s.io/client-go/1.5/kubernetes/typed/rbac/v1alpha1"
fakev1alpha1rbac "k8s.io/client-go/1.5/kubernetes/typed/rbac/v1alpha1/fake"
v1beta1storage "k8s.io/client-go/1.5/kubernetes/typed/storage/v1beta1"
fakev1beta1storage "k8s.io/client-go/1.5/kubernetes/typed/storage/v1beta1/fake"
"k8s.io/client-go/1.5/pkg/api"
"k8s.io/client-go/1.5/pkg/apimachinery/registered"
"k8s.io/client-go/1.5/pkg/runtime"
"k8s.io/client-go/1.5/pkg/watch"
"k8s.io/client-go/1.5/testing"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := testing.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, registered.RESTMapper()))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
// Clientset implements clientset.Interface. Meant to be embedded into a
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
return &fakediscovery.FakeDiscovery{Fake: &c.Fake}
}
var _ clientset.Interface = &Clientset{}
// Core retrieves the CoreClient
func (c *Clientset) Core() v1core.CoreInterface {
return &fakev1core.FakeCore{Fake: &c.Fake}
}
// Apps retrieves the AppsClient
func (c *Clientset) Apps() v1alpha1apps.AppsInterface {
return &fakev1alpha1apps.FakeApps{Fake: &c.Fake}
}
// Authentication retrieves the AuthenticationClient
func (c *Clientset) Authentication() v1beta1authentication.AuthenticationInterface {
return &fakev1beta1authentication.FakeAuthentication{Fake: &c.Fake}
}
// Authorization retrieves the AuthorizationClient
func (c *Clientset) Authorization() v1beta1authorization.AuthorizationInterface {
return &fakev1beta1authorization.FakeAuthorization{Fake: &c.Fake}
}
// Autoscaling retrieves the AutoscalingClient
func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingInterface {
return &fakev1autoscaling.FakeAutoscaling{Fake: &c.Fake}
}
// Batch retrieves the BatchClient
func (c *Clientset) Batch() v1batch.BatchInterface {
return &fakev1batch.FakeBatch{Fake: &c.Fake}
}
// Certificates retrieves the CertificatesClient
func (c *Clientset) Certificates() v1alpha1certificates.CertificatesInterface {
return &fakev1alpha1certificates.FakeCertificates{Fake: &c.Fake}
}
// Extensions retrieves the ExtensionsClient
func (c *Clientset) Extensions() v1beta1extensions.ExtensionsInterface {
return &fakev1beta1extensions.FakeExtensions{Fake: &c.Fake}
}
// Policy retrieves the PolicyClient
func (c *Clientset) Policy() v1alpha1policy.PolicyInterface {
return &fakev1alpha1policy.FakePolicy{Fake: &c.Fake}
}
// Rbac retrieves the RbacClient
func (c *Clientset) Rbac() v1alpha1rbac.RbacInterface {
return &fakev1alpha1rbac.FakeRbac{Fake: &c.Fake}
}
// Storage retrieves the StorageClient
func (c *Clientset) Storage() v1beta1storage.StorageInterface {
return &fakev1beta1storage.FakeStorage{Fake: &c.Fake}
}

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 fake clientset.
package fake

View File

@@ -20,18 +20,18 @@ package kubernetes
import (
"fmt"
_ "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"
_ "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"
)
func init() {

View File

@@ -0,0 +1,96 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,22 +17,21 @@ limitations under the License.
package fake
import (
v1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/client-go/1.5/kubernetes/typed/apps/v1alpha1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeAppsV1beta1 struct {
type FakeApps struct {
*testing.Fake
}
func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface {
return &FakeStatefulSets{c, namespace}
func (c *FakeApps) PetSets(namespace string) v1alpha1.PetSetInterface {
return &FakePetSets{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAppsV1beta1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeApps) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -0,0 +1,127 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
api "k8s.io/client-go/1.5/pkg/api"
unversioned "k8s.io/client-go/1.5/pkg/api/unversioned"
v1alpha1 "k8s.io/client-go/1.5/pkg/apis/apps/v1alpha1"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakePetSets implements PetSetInterface
type FakePetSets struct {
Fake *FakeApps
ns string
}
var petsetsResource = unversioned.GroupVersionResource{Group: "apps", Version: "v1alpha1", Resource: "petsets"}
func (c *FakePetSets) Create(petSet *v1alpha1.PetSet) (result *v1alpha1.PetSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(petsetsResource, c.ns, petSet), &v1alpha1.PetSet{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PetSet), err
}
func (c *FakePetSets) Update(petSet *v1alpha1.PetSet) (result *v1alpha1.PetSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(petsetsResource, c.ns, petSet), &v1alpha1.PetSet{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PetSet), err
}
func (c *FakePetSets) UpdateStatus(petSet *v1alpha1.PetSet) (*v1alpha1.PetSet, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(petsetsResource, "status", c.ns, petSet), &v1alpha1.PetSet{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PetSet), err
}
func (c *FakePetSets) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(petsetsResource, c.ns, name), &v1alpha1.PetSet{})
return err
}
func (c *FakePetSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(petsetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.PetSetList{})
return err
}
func (c *FakePetSets) Get(name string) (result *v1alpha1.PetSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(petsetsResource, c.ns, name), &v1alpha1.PetSet{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PetSet), err
}
func (c *FakePetSets) List(opts api.ListOptions) (result *v1alpha1.PetSetList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(petsetsResource, c.ns, opts), &v1alpha1.PetSetList{})
if obj == nil {
return nil, err
}
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.PetSetList{}
for _, item := range obj.(*v1alpha1.PetSetList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested petSets.
func (c *FakePetSets) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(petsetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched petSet.
func (c *FakePetSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PetSet, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(petsetsResource, c.ns, name, data, subresources...), &v1alpha1.PetSet{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PetSet), err
}

View File

@@ -15,3 +15,5 @@ limitations under the License.
*/
package v1alpha1
type PetSetExpansion interface{}

View File

@@ -0,0 +1,165 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package 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

@@ -0,0 +1,96 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 v1beta1

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,22 +17,21 @@ limitations under the License.
package fake
import (
v1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/client-go/1.5/kubernetes/typed/authentication/v1beta1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeAuthenticationV1beta1 struct {
type FakeAuthentication struct {
*testing.Fake
}
func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface {
func (c *FakeAuthentication) TokenReviews() v1beta1.TokenReviewInterface {
return &FakeTokenReviews{c}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAuthenticationV1beta1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeAuthentication) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -18,5 +18,5 @@ package fake
// FakeTokenReviews implements TokenReviewInterface
type FakeTokenReviews struct {
Fake *FakeAuthenticationV1beta1
Fake *FakeAuthentication
}

View File

@@ -16,4 +16,4 @@ limitations under the License.
package v1beta1
type StatefulSetExpansion interface{}
type TokenReviewExpansion interface{}

View File

@@ -16,10 +16,6 @@ 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 {
@@ -33,12 +29,12 @@ type TokenReviewInterface interface {
// tokenReviews implements TokenReviewInterface
type tokenReviews struct {
client rest.Interface
client *AuthenticationClient
}
// newTokenReviews returns a TokenReviews
func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews {
func newTokenReviews(c *AuthenticationClient) *tokenReviews {
return &tokenReviews{
client: c.RESTClient(),
client: c,
}
}

View File

@@ -0,0 +1,106 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 v1beta1

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,30 +17,29 @@ limitations under the License.
package fake
import (
v1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/client-go/1.5/kubernetes/typed/authorization/v1beta1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeAuthorizationV1beta1 struct {
type FakeAuthorization struct {
*testing.Fake
}
func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface {
func (c *FakeAuthorization) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface {
return &FakeLocalSubjectAccessReviews{c, namespace}
}
func (c *FakeAuthorizationV1beta1) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface {
func (c *FakeAuthorization) SelfSubjectAccessReviews() v1beta1.SelfSubjectAccessReviewInterface {
return &FakeSelfSubjectAccessReviews{c}
}
func (c *FakeAuthorizationV1beta1) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface {
func (c *FakeAuthorization) SubjectAccessReviews() v1beta1.SubjectAccessReviewInterface {
return &FakeSubjectAccessReviews{c}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAuthorizationV1beta1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeAuthorization) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -18,6 +18,6 @@ package fake
// FakeLocalSubjectAccessReviews implements LocalSubjectAccessReviewInterface
type FakeLocalSubjectAccessReviews struct {
Fake *FakeAuthorizationV1beta1
Fake *FakeAuthorization
ns string
}

View File

@@ -18,5 +18,5 @@ package fake
// FakeSelfSubjectAccessReviews implements SelfSubjectAccessReviewInterface
type FakeSelfSubjectAccessReviews struct {
Fake *FakeAuthorizationV1beta1
Fake *FakeAuthorization
}

View File

@@ -18,5 +18,5 @@ package fake
// FakeSubjectAccessReviews implements SubjectAccessReviewInterface
type FakeSubjectAccessReviews struct {
Fake *FakeAuthorizationV1beta1
Fake *FakeAuthorization
}

View File

@@ -17,8 +17,9 @@ limitations under the License.
package fake
import (
authorizationapi "k8s.io/client-go/pkg/apis/authorization/v1beta1"
"k8s.io/client-go/testing"
authorizationapi "k8s.io/client-go/1.5/pkg/apis/authorization/v1beta1"
"k8s.io/client-go/1.5/testing"
)
func (c *FakeSubjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {

View File

@@ -16,4 +16,6 @@ limitations under the License.
package v1beta1
type PodDisruptionBudgetExpansion interface{}
type LocalSubjectAccessReviewExpansion interface{}
type SelfSubjectAccessReviewExpansion interface{}

View File

@@ -16,10 +16,6 @@ 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 {
@@ -33,14 +29,14 @@ type LocalSubjectAccessReviewInterface interface {
// localSubjectAccessReviews implements LocalSubjectAccessReviewInterface
type localSubjectAccessReviews struct {
client rest.Interface
client *AuthorizationClient
ns string
}
// newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews
func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace string) *localSubjectAccessReviews {
func newLocalSubjectAccessReviews(c *AuthorizationClient, namespace string) *localSubjectAccessReviews {
return &localSubjectAccessReviews{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}

View File

@@ -16,10 +16,6 @@ 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 {
@@ -33,12 +29,12 @@ type SelfSubjectAccessReviewInterface interface {
// selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface
type selfSubjectAccessReviews struct {
client rest.Interface
client *AuthorizationClient
}
// newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews
func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAccessReviews {
func newSelfSubjectAccessReviews(c *AuthorizationClient) *selfSubjectAccessReviews {
return &selfSubjectAccessReviews{
client: c.RESTClient(),
client: c,
}
}

View File

@@ -16,10 +16,6 @@ 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 {
@@ -33,12 +29,12 @@ type SubjectAccessReviewInterface interface {
// subjectAccessReviews implements SubjectAccessReviewInterface
type subjectAccessReviews struct {
client rest.Interface
client *AuthorizationClient
}
// newSubjectAccessReviews returns a SubjectAccessReviews
func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReviews {
func newSubjectAccessReviews(c *AuthorizationClient) *subjectAccessReviews {
return &subjectAccessReviews{
client: c.RESTClient(),
client: c,
}
}

View File

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

View File

@@ -0,0 +1,96 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 v1

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,22 +17,21 @@ limitations under the License.
package fake
import (
v1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/client-go/1.5/kubernetes/typed/autoscaling/v1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeAutoscalingV1 struct {
type FakeAutoscaling struct {
*testing.Fake
}
func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface {
func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface {
return &FakeHorizontalPodAutoscalers{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeAutoscalingV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeAutoscaling) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -17,18 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
api_v1 "k8s.io/client-go/pkg/api/v1"
v1 "k8s.io/client-go/pkg/apis/autoscaling/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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/apis/autoscaling/v1"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
type FakeHorizontalPodAutoscalers struct {
Fake *FakeAutoscalingV1
Fake *FakeAutoscaling
ns string
}
@@ -64,14 +63,14 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.
return obj.(*v1.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api_v1.DeleteOptions) error {
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
return err
}
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{})
@@ -88,7 +87,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string) (result *v1.HorizontalPo
return obj.(*v1.HorizontalPodAutoscaler), err
}
func (c *FakeHorizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
func (c *FakeHorizontalPodAutoscalers) List(opts api.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
@@ -96,7 +95,7 @@ func (c *FakeHorizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -110,7 +109,7 @@ func (c *FakeHorizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *FakeHorizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
func (c *FakeHorizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))

View File

@@ -17,11 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@@ -35,25 +33,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_v1.DeleteOptions) error
DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.HorizontalPodAutoscaler, error)
List(opts api_v1.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(opts api_v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(opts api.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 rest.Interface
client *AutoscalingClient
ns string
}
// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers
func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers {
func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers {
return &horizontalPodAutoscalers{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -97,7 +95,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_v1.DeleteOptions) error {
func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
@@ -108,7 +106,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api_v1.DeleteOpt
}
// DeleteCollection deletes a collection of objects.
func (c *horizontalPodAutoscalers) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
func (c *horizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
@@ -131,7 +129,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_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
result = &v1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
@@ -143,7 +141,7 @@ func (c *horizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1.Hor
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View File

@@ -17,30 +17,28 @@ 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"
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 BatchV1Interface interface {
RESTClient() rest.Interface
type BatchInterface interface {
GetRESTClient() *rest.RESTClient
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
// BatchClient is used to interact with features provided by the Batch group.
type BatchClient struct {
*rest.RESTClient
}
func (c *BatchV1Client) Jobs(namespace string) JobInterface {
func (c *BatchClient) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}
// NewForConfig creates a new BatchV1Client for the given config.
func NewForConfig(c *rest.Config) (*BatchV1Client, error) {
// 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
@@ -49,12 +47,12 @@ func NewForConfig(c *rest.Config) (*BatchV1Client, error) {
if err != nil {
return nil, err
}
return &BatchV1Client{client}, nil
return &BatchClient{client}, nil
}
// NewForConfigOrDie creates a new BatchV1Client for the given config and
// NewForConfigOrDie creates a new BatchClient for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *BatchV1Client {
func NewForConfigOrDie(c *rest.Config) *BatchClient {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@@ -62,37 +60,37 @@ func NewForConfigOrDie(c *rest.Config) *BatchV1Client {
return client
}
// New creates a new BatchV1Client for the given RESTClient.
func New(c rest.Interface) *BatchV1Client {
return &BatchV1Client{c}
// New creates a new BatchClient for the given RESTClient.
func New(c *rest.RESTClient) *BatchClient {
return &BatchClient{c}
}
func setConfigDefaults(config *rest.Config) error {
gv, err := unversioned.ParseGroupVersion("batch/v1")
// if batch group is not registered, return an error
g, err := registered.Group("batch")
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
// 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
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *BatchV1Client) RESTClient() rest.Interface {
func (c *BatchClient) GetRESTClient() *rest.RESTClient {
if c == nil {
return nil
}
return c.restClient
return c.RESTClient
}

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 v1

View File

@@ -0,0 +1,20 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,22 +17,21 @@ limitations under the License.
package fake
import (
v1 "k8s.io/client-go/kubernetes/typed/batch/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/client-go/1.5/kubernetes/typed/batch/v1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeBatchV1 struct {
type FakeBatch struct {
*testing.Fake
}
func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface {
func (c *FakeBatch) Jobs(namespace string) v1.JobInterface {
return &FakeJobs{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeBatchV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeBatch) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -17,18 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
api_v1 "k8s.io/client-go/pkg/api/v1"
v1 "k8s.io/client-go/pkg/apis/batch/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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/apis/batch/v1"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeJobs implements JobInterface
type FakeJobs struct {
Fake *FakeBatchV1
Fake *FakeBatch
ns string
}
@@ -64,14 +63,14 @@ func (c *FakeJobs) UpdateStatus(job *v1.Job) (*v1.Job, error) {
return obj.(*v1.Job), err
}
func (c *FakeJobs) Delete(name string, options *api_v1.DeleteOptions) error {
func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &v1.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
func (c *FakeJobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.JobList{})
@@ -88,7 +87,7 @@ func (c *FakeJobs) Get(name string) (result *v1.Job, err error) {
return obj.(*v1.Job), err
}
func (c *FakeJobs) List(opts api_v1.ListOptions) (result *v1.JobList, err error) {
func (c *FakeJobs) List(opts api.ListOptions) (result *v1.JobList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(jobsResource, c.ns, opts), &v1.JobList{})
@@ -96,7 +95,7 @@ func (c *FakeJobs) List(opts api_v1.ListOptions) (result *v1.JobList, err error)
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -110,7 +109,7 @@ func (c *FakeJobs) List(opts api_v1.ListOptions) (result *v1.JobList, err error)
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
func (c *FakeJobs) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))

View File

@@ -17,11 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// JobsGetter has a method to return a JobInterface.
@@ -35,25 +33,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_v1.DeleteOptions) error
DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.Job, error)
List(opts api_v1.ListOptions) (*v1.JobList, error)
Watch(opts api_v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.JobList, error)
Watch(opts api.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 rest.Interface
client *BatchClient
ns string
}
// newJobs returns a Jobs
func newJobs(c *BatchV1Client, namespace string) *jobs {
func newJobs(c *BatchClient, namespace string) *jobs {
return &jobs{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -97,7 +95,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_v1.DeleteOptions) error {
func (c *jobs) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
@@ -108,7 +106,7 @@ func (c *jobs) Delete(name string, options *api_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error {
func (c *jobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
@@ -131,7 +129,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_v1.ListOptions) (result *v1.JobList, err error) {
func (c *jobs) List(opts api.ListOptions) (result *v1.JobList, err error) {
result = &v1.JobList{}
err = c.client.Get().
Namespace(c.ns).
@@ -143,7 +141,7 @@ func (c *jobs) List(opts api_v1.ListOptions) (result *v1.JobList, err error) {
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(opts api_v1.ListOptions) (watch.Interface, error) {
func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View File

@@ -0,0 +1,96 @@
/*
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

@@ -17,11 +17,9 @@ limitations under the License.
package v1alpha1
import (
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"
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"
)
// CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface.
@@ -35,24 +33,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 *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1alpha1.CertificateSigningRequest, error)
List(opts v1.ListOptions) (*v1alpha1.CertificateSigningRequestList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1alpha1.CertificateSigningRequestList, error)
Watch(opts api.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 rest.Interface
client *CertificatesClient
}
// newCertificateSigningRequests returns a CertificateSigningRequests
func newCertificateSigningRequests(c *CertificatesV1alpha1Client) *certificateSigningRequests {
func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests {
return &certificateSigningRequests{
client: c.RESTClient(),
client: c,
}
}
@@ -92,7 +90,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 *v1.DeleteOptions) error {
func (c *certificateSigningRequests) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Resource("certificatesigningrequests").
Name(name).
@@ -102,7 +100,7 @@ func (c *certificateSigningRequests) Delete(name string, options *v1.DeleteOptio
}
// DeleteCollection deletes a collection of objects.
func (c *certificateSigningRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *certificateSigningRequests) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Resource("certificatesigningrequests").
VersionedParams(&listOptions, api.ParameterCodec).
@@ -123,7 +121,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 v1.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
func (c *certificateSigningRequests) List(opts api.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
result = &v1alpha1.CertificateSigningRequestList{}
err = c.client.Get().
Resource("certificatesigningrequests").
@@ -134,7 +132,7 @@ func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1alpha1
}
// Watch returns a watch.Interface that watches the requested certificateSigningRequests.
func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *certificateSigningRequests) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("certificatesigningrequests").

View File

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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

@@ -0,0 +1,20 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,22 +17,21 @@ limitations under the License.
package fake
import (
v1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/client-go/1.5/kubernetes/typed/certificates/v1alpha1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeCertificatesV1alpha1 struct {
type FakeCertificates struct {
*testing.Fake
}
func (c *FakeCertificatesV1alpha1) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface {
func (c *FakeCertificates) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface {
return &FakeCertificateSigningRequests{c}
}
// RESTClient returns a RESTClient that is used to communicate
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
func (c *FakeCertificates) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -17,18 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
v1alpha1 "k8s.io/client-go/pkg/apis/certificates/v1alpha1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/client-go/1.5/pkg/api"
unversioned "k8s.io/client-go/1.5/pkg/api/unversioned"
v1alpha1 "k8s.io/client-go/1.5/pkg/apis/certificates/v1alpha1"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeCertificateSigningRequests implements CertificateSigningRequestInterface
type FakeCertificateSigningRequests struct {
Fake *FakeCertificatesV1alpha1
Fake *FakeCertificates
}
var certificatesigningrequestsResource = unversioned.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1alpha1", Resource: "certificatesigningrequests"}
@@ -60,13 +59,13 @@ func (c *FakeCertificateSigningRequests) UpdateStatus(certificateSigningRequest
return obj.(*v1alpha1.CertificateSigningRequest), err
}
func (c *FakeCertificateSigningRequests) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeCertificateSigningRequests) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(certificatesigningrequestsResource, name), &v1alpha1.CertificateSigningRequest{})
return err
}
func (c *FakeCertificateSigningRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeCertificateSigningRequests) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.CertificateSigningRequestList{})
@@ -82,14 +81,14 @@ func (c *FakeCertificateSigningRequests) Get(name string) (result *v1alpha1.Cert
return obj.(*v1alpha1.CertificateSigningRequest), err
}
func (c *FakeCertificateSigningRequests) List(opts v1.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
func (c *FakeCertificateSigningRequests) List(opts api.ListOptions) (result *v1alpha1.CertificateSigningRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(certificatesigningrequestsResource, opts), &v1alpha1.CertificateSigningRequestList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -103,7 +102,7 @@ func (c *FakeCertificateSigningRequests) List(opts v1.ListOptions) (result *v1al
}
// Watch returns a watch.Interface that watches the requested certificateSigningRequests.
func (c *FakeCertificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeCertificateSigningRequests) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(certificatesigningrequestsResource, opts))
}

View File

@@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:defaulter-gen=TypeMeta
// +groupName=kubeadm.k8s.io
package v1alpha1
type CertificateSigningRequestExpansion interface{}

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// ComponentStatusesGetter has a method to return a ComponentStatusInterface.
@@ -33,24 +32,24 @@ type ComponentStatusesGetter interface {
type ComponentStatusInterface interface {
Create(*v1.ComponentStatus) (*v1.ComponentStatus, error)
Update(*v1.ComponentStatus) (*v1.ComponentStatus, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.ComponentStatus, error)
List(opts v1.ListOptions) (*v1.ComponentStatusList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.ComponentStatusList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
}
// newComponentStatuses returns a ComponentStatuses
func newComponentStatuses(c *CoreV1Client) *componentStatuses {
func newComponentStatuses(c *CoreClient) *componentStatuses {
return &componentStatuses{
client: c.RESTClient(),
client: c,
}
}
@@ -78,7 +77,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 *v1.DeleteOptions) error {
func (c *componentStatuses) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Resource("componentstatuses").
Name(name).
@@ -88,7 +87,7 @@ func (c *componentStatuses) Delete(name string, options *v1.DeleteOptions) error
}
// DeleteCollection deletes a collection of objects.
func (c *componentStatuses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *componentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Resource("componentstatuses").
VersionedParams(&listOptions, api.ParameterCodec).
@@ -109,7 +108,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 v1.ListOptions) (result *v1.ComponentStatusList, err error) {
func (c *componentStatuses) List(opts api.ListOptions) (result *v1.ComponentStatusList, err error) {
result = &v1.ComponentStatusList{}
err = c.client.Get().
Resource("componentstatuses").
@@ -120,7 +119,7 @@ func (c *componentStatuses) List(opts v1.ListOptions) (result *v1.ComponentStatu
}
// Watch returns a watch.Interface that watches the requested componentStatuses.
func (c *componentStatuses) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *componentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Resource("componentstatuses").

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// ConfigMapsGetter has a method to return a ConfigMapInterface.
@@ -33,25 +32,25 @@ type ConfigMapsGetter interface {
type ConfigMapInterface interface {
Create(*v1.ConfigMap) (*v1.ConfigMap, error)
Update(*v1.ConfigMap) (*v1.ConfigMap, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.ConfigMap, error)
List(opts v1.ListOptions) (*v1.ConfigMapList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.ConfigMapList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
ns string
}
// newConfigMaps returns a ConfigMaps
func newConfigMaps(c *CoreV1Client, namespace string) *configMaps {
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
return &configMaps{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -82,7 +81,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 *v1.DeleteOptions) error {
func (c *configMaps) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
@@ -93,7 +92,7 @@ func (c *configMaps) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *configMaps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *configMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
@@ -116,7 +115,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 v1.ListOptions) (result *v1.ConfigMapList, err error) {
func (c *configMaps) List(opts api.ListOptions) (result *v1.ConfigMapList, err error) {
result = &v1.ConfigMapList{}
err = c.client.Get().
Namespace(c.ns).
@@ -128,7 +127,7 @@ func (c *configMaps) List(opts v1.ListOptions) (result *v1.ConfigMapList, err er
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *configMaps) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *configMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View File

@@ -0,0 +1,171 @@
/*
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

@@ -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/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// 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 v1

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// EndpointsGetter has a method to return a EndpointsInterface.
@@ -33,25 +32,25 @@ type EndpointsGetter interface {
type EndpointsInterface interface {
Create(*v1.Endpoints) (*v1.Endpoints, error)
Update(*v1.Endpoints) (*v1.Endpoints, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.Endpoints, error)
List(opts v1.ListOptions) (*v1.EndpointsList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.EndpointsList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
ns string
}
// newEndpoints returns a Endpoints
func newEndpoints(c *CoreV1Client, namespace string) *endpoints {
func newEndpoints(c *CoreClient, namespace string) *endpoints {
return &endpoints{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -82,7 +81,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 *v1.DeleteOptions) error {
func (c *endpoints) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
@@ -93,7 +92,7 @@ func (c *endpoints) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *endpoints) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *endpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
@@ -116,7 +115,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 v1.ListOptions) (result *v1.EndpointsList, err error) {
func (c *endpoints) List(opts api.ListOptions) (result *v1.EndpointsList, err error) {
result = &v1.EndpointsList{}
err = c.client.Get().
Namespace(c.ns).
@@ -128,7 +127,7 @@ func (c *endpoints) List(opts v1.ListOptions) (result *v1.EndpointsList, err err
}
// Watch returns a watch.Interface that watches the requested endpoints.
func (c *endpoints) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// EventsGetter has a method to return a EventInterface.
@@ -33,25 +32,25 @@ type EventsGetter interface {
type EventInterface interface {
Create(*v1.Event) (*v1.Event, error)
Update(*v1.Event) (*v1.Event, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.Event, error)
List(opts v1.ListOptions) (*v1.EventList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.EventList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
ns string
}
// newEvents returns a Events
func newEvents(c *CoreV1Client, namespace string) *events {
func newEvents(c *CoreClient, namespace string) *events {
return &events{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -82,7 +81,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 *v1.DeleteOptions) error {
func (c *events) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("events").
@@ -93,7 +92,7 @@ func (c *events) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *events) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("events").
@@ -116,7 +115,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 v1.ListOptions) (result *v1.EventList, err error) {
func (c *events) List(opts api.ListOptions) (result *v1.EventList, err error) {
result = &v1.EventList{}
err = c.client.Get().
Namespace(c.ns).
@@ -128,7 +127,7 @@ func (c *events) List(opts v1.ListOptions) (result *v1.EventList, err error) {
}
// Watch returns a watch.Interface that watches the requested events.
func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *events) Watch(opts api.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/pkg/api"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/fields"
"k8s.io/client-go/pkg/runtime"
"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"
)
// 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(v1.ListOptions{FieldSelector: fieldSelector.String()})
return e.List(api.ListOptions{FieldSelector: fieldSelector})
}
// Returns the appropriate field selector based on the API version being used to communicate with the server.

View File

@@ -0,0 +1,20 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with 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]
// Package fake has the automatically generated clients.
package fake

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeComponentStatuses implements ComponentStatusInterface
type FakeComponentStatuses struct {
Fake *FakeCoreV1
Fake *FakeCore
}
var componentstatusesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "componentstatuses"}
@@ -50,13 +50,13 @@ func (c *FakeComponentStatuses) Update(componentStatus *v1.ComponentStatus) (res
return obj.(*v1.ComponentStatus), err
}
func (c *FakeComponentStatuses) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeComponentStatuses) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(componentstatusesResource, name), &v1.ComponentStatus{})
return err
}
func (c *FakeComponentStatuses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeComponentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1.ComponentStatusList{})
@@ -72,14 +72,14 @@ func (c *FakeComponentStatuses) Get(name string) (result *v1.ComponentStatus, er
return obj.(*v1.ComponentStatus), err
}
func (c *FakeComponentStatuses) List(opts v1.ListOptions) (result *v1.ComponentStatusList, err error) {
func (c *FakeComponentStatuses) List(opts api.ListOptions) (result *v1.ComponentStatusList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(componentstatusesResource, opts), &v1.ComponentStatusList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -93,7 +93,7 @@ func (c *FakeComponentStatuses) List(opts v1.ListOptions) (result *v1.ComponentS
}
// Watch returns a watch.Interface that watches the requested componentStatuses.
func (c *FakeComponentStatuses) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeComponentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(componentstatusesResource, opts))
}

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeConfigMaps implements ConfigMapInterface
type FakeConfigMaps struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeConfigMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap,
return obj.(*v1.ConfigMap), err
}
func (c *FakeConfigMaps) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeConfigMaps) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &v1.ConfigMap{})
return err
}
func (c *FakeConfigMaps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeConfigMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ConfigMapList{})
@@ -77,7 +77,7 @@ func (c *FakeConfigMaps) Get(name string) (result *v1.ConfigMap, err error) {
return obj.(*v1.ConfigMap), err
}
func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *v1.ConfigMapList, err error) {
func (c *FakeConfigMaps) List(opts api.ListOptions) (result *v1.ConfigMapList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(configmapsResource, c.ns, opts), &v1.ConfigMapList{})
@@ -85,7 +85,7 @@ func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *v1.ConfigMapList, er
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *v1.ConfigMapList, er
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *FakeConfigMaps) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts))

View File

@@ -0,0 +1,97 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
v1 "k8s.io/client-go/1.5/kubernetes/typed/core/v1"
rest "k8s.io/client-go/1.5/rest"
testing "k8s.io/client-go/1.5/testing"
)
type FakeCore struct {
*testing.Fake
}
func (c *FakeCore) ComponentStatuses() v1.ComponentStatusInterface {
return &FakeComponentStatuses{c}
}
func (c *FakeCore) ConfigMaps(namespace string) v1.ConfigMapInterface {
return &FakeConfigMaps{c, namespace}
}
func (c *FakeCore) Endpoints(namespace string) v1.EndpointsInterface {
return &FakeEndpoints{c, namespace}
}
func (c *FakeCore) Events(namespace string) v1.EventInterface {
return &FakeEvents{c, namespace}
}
func (c *FakeCore) LimitRanges(namespace string) v1.LimitRangeInterface {
return &FakeLimitRanges{c, namespace}
}
func (c *FakeCore) Namespaces() v1.NamespaceInterface {
return &FakeNamespaces{c}
}
func (c *FakeCore) Nodes() v1.NodeInterface {
return &FakeNodes{c}
}
func (c *FakeCore) PersistentVolumes() v1.PersistentVolumeInterface {
return &FakePersistentVolumes{c}
}
func (c *FakeCore) PersistentVolumeClaims(namespace string) v1.PersistentVolumeClaimInterface {
return &FakePersistentVolumeClaims{c, namespace}
}
func (c *FakeCore) Pods(namespace string) v1.PodInterface {
return &FakePods{c, namespace}
}
func (c *FakeCore) PodTemplates(namespace string) v1.PodTemplateInterface {
return &FakePodTemplates{c, namespace}
}
func (c *FakeCore) ReplicationControllers(namespace string) v1.ReplicationControllerInterface {
return &FakeReplicationControllers{c, namespace}
}
func (c *FakeCore) ResourceQuotas(namespace string) v1.ResourceQuotaInterface {
return &FakeResourceQuotas{c, namespace}
}
func (c *FakeCore) Secrets(namespace string) v1.SecretInterface {
return &FakeSecrets{c, namespace}
}
func (c *FakeCore) Services(namespace string) v1.ServiceInterface {
return &FakeServices{c, namespace}
}
func (c *FakeCore) ServiceAccounts(namespace string) v1.ServiceAccountInterface {
return &FakeServiceAccounts{c, namespace}
}
// GetRESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCore) GetRESTClient() *rest.RESTClient {
return nil
}

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeEndpoints implements EndpointsInterface
type FakeEndpoints struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeEndpoints) Update(endpoints *v1.Endpoints) (result *v1.Endpoints, e
return obj.(*v1.Endpoints), err
}
func (c *FakeEndpoints) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeEndpoints) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(endpointsResource, c.ns, name), &v1.Endpoints{})
return err
}
func (c *FakeEndpoints) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeEndpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.EndpointsList{})
@@ -77,7 +77,7 @@ func (c *FakeEndpoints) Get(name string) (result *v1.Endpoints, err error) {
return obj.(*v1.Endpoints), err
}
func (c *FakeEndpoints) List(opts v1.ListOptions) (result *v1.EndpointsList, err error) {
func (c *FakeEndpoints) List(opts api.ListOptions) (result *v1.EndpointsList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(endpointsResource, c.ns, opts), &v1.EndpointsList{})
@@ -85,7 +85,7 @@ func (c *FakeEndpoints) List(opts v1.ListOptions) (result *v1.EndpointsList, err
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeEndpoints) List(opts v1.ListOptions) (result *v1.EndpointsList, err
}
// Watch returns a watch.Interface that watches the requested endpoints.
func (c *FakeEndpoints) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeEndpoints) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(endpointsResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeEvents implements EventInterface
type FakeEvents struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeEvents) Update(event *v1.Event) (result *v1.Event, err error) {
return obj.(*v1.Event), err
}
func (c *FakeEvents) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeEvents) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &v1.Event{})
return err
}
func (c *FakeEvents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.EventList{})
@@ -77,7 +77,7 @@ func (c *FakeEvents) Get(name string) (result *v1.Event, err error) {
return obj.(*v1.Event), err
}
func (c *FakeEvents) List(opts v1.ListOptions) (result *v1.EventList, err error) {
func (c *FakeEvents) List(opts api.ListOptions) (result *v1.EventList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(eventsResource, c.ns, opts), &v1.EventList{})
@@ -85,7 +85,7 @@ func (c *FakeEvents) List(opts v1.ListOptions) (result *v1.EventList, err error)
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeEvents) List(opts v1.ListOptions) (result *v1.EventList, err error)
}
// Watch returns a watch.Interface that watches the requested events.
func (c *FakeEvents) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeEvents) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts))

View File

@@ -17,11 +17,11 @@ limitations under the License.
package fake
import (
"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"
"k8s.io/client-go/testing"
"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/1.5/testing"
)
func (c *FakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) {

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeLimitRanges implements LimitRangeInterface
type FakeLimitRanges struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeLimitRanges) Update(limitRange *v1.LimitRange) (result *v1.LimitRan
return obj.(*v1.LimitRange), err
}
func (c *FakeLimitRanges) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeLimitRanges) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(limitrangesResource, c.ns, name), &v1.LimitRange{})
return err
}
func (c *FakeLimitRanges) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeLimitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.LimitRangeList{})
@@ -77,7 +77,7 @@ func (c *FakeLimitRanges) Get(name string) (result *v1.LimitRange, err error) {
return obj.(*v1.LimitRange), err
}
func (c *FakeLimitRanges) List(opts v1.ListOptions) (result *v1.LimitRangeList, err error) {
func (c *FakeLimitRanges) List(opts api.ListOptions) (result *v1.LimitRangeList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(limitrangesResource, c.ns, opts), &v1.LimitRangeList{})
@@ -85,7 +85,7 @@ func (c *FakeLimitRanges) List(opts v1.ListOptions) (result *v1.LimitRangeList,
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeLimitRanges) List(opts v1.ListOptions) (result *v1.LimitRangeList,
}
// Watch returns a watch.Interface that watches the requested limitRanges.
func (c *FakeLimitRanges) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeLimitRanges) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(limitrangesResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeNamespaces implements NamespaceInterface
type FakeNamespaces struct {
Fake *FakeCoreV1
Fake *FakeCore
}
var namespacesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "namespaces"}
@@ -59,13 +59,13 @@ func (c *FakeNamespaces) UpdateStatus(namespace *v1.Namespace) (*v1.Namespace, e
return obj.(*v1.Namespace), err
}
func (c *FakeNamespaces) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeNamespaces) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(namespacesResource, name), &v1.Namespace{})
return err
}
func (c *FakeNamespaces) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeNamespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(namespacesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1.NamespaceList{})
@@ -81,14 +81,14 @@ func (c *FakeNamespaces) Get(name string) (result *v1.Namespace, err error) {
return obj.(*v1.Namespace), err
}
func (c *FakeNamespaces) List(opts v1.ListOptions) (result *v1.NamespaceList, err error) {
func (c *FakeNamespaces) List(opts api.ListOptions) (result *v1.NamespaceList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(namespacesResource, opts), &v1.NamespaceList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -102,7 +102,7 @@ func (c *FakeNamespaces) List(opts v1.ListOptions) (result *v1.NamespaceList, er
}
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *FakeNamespaces) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeNamespaces) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts))
}

View File

@@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/testing"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/testing"
)
func (c *FakeNamespaces) Finalize(namespace *v1.Namespace) (*v1.Namespace, error) {

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeNodes implements NodeInterface
type FakeNodes struct {
Fake *FakeCoreV1
Fake *FakeCore
}
var nodesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "nodes"}
@@ -59,13 +59,13 @@ func (c *FakeNodes) UpdateStatus(node *v1.Node) (*v1.Node, error) {
return obj.(*v1.Node), err
}
func (c *FakeNodes) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeNodes) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(nodesResource, name), &v1.Node{})
return err
}
func (c *FakeNodes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeNodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(nodesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1.NodeList{})
@@ -81,14 +81,14 @@ func (c *FakeNodes) Get(name string) (result *v1.Node, err error) {
return obj.(*v1.Node), err
}
func (c *FakeNodes) List(opts v1.ListOptions) (result *v1.NodeList, err error) {
func (c *FakeNodes) List(opts api.ListOptions) (result *v1.NodeList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(nodesResource, opts), &v1.NodeList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -102,7 +102,7 @@ func (c *FakeNodes) List(opts v1.ListOptions) (result *v1.NodeList, err error) {
}
// Watch returns a watch.Interface that watches the requested nodes.
func (c *FakeNodes) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeNodes) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(nodesResource, opts))
}

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakePersistentVolumes implements PersistentVolumeInterface
type FakePersistentVolumes struct {
Fake *FakeCoreV1
Fake *FakeCore
}
var persistentvolumesResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "persistentvolumes"}
@@ -59,13 +59,13 @@ func (c *FakePersistentVolumes) UpdateStatus(persistentVolume *v1.PersistentVolu
return obj.(*v1.PersistentVolume), err
}
func (c *FakePersistentVolumes) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakePersistentVolumes) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(persistentvolumesResource, name), &v1.PersistentVolume{})
return err
}
func (c *FakePersistentVolumes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakePersistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1.PersistentVolumeList{})
@@ -81,14 +81,14 @@ func (c *FakePersistentVolumes) Get(name string) (result *v1.PersistentVolume, e
return obj.(*v1.PersistentVolume), err
}
func (c *FakePersistentVolumes) List(opts v1.ListOptions) (result *v1.PersistentVolumeList, err error) {
func (c *FakePersistentVolumes) List(opts api.ListOptions) (result *v1.PersistentVolumeList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(persistentvolumesResource, opts), &v1.PersistentVolumeList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -102,7 +102,7 @@ func (c *FakePersistentVolumes) List(opts v1.ListOptions) (result *v1.Persistent
}
// Watch returns a watch.Interface that watches the requested persistentVolumes.
func (c *FakePersistentVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakePersistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(persistentvolumesResource, opts))
}

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakePersistentVolumeClaims implements PersistentVolumeClaimInterface
type FakePersistentVolumeClaims struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -63,14 +63,14 @@ func (c *FakePersistentVolumeClaims) UpdateStatus(persistentVolumeClaim *v1.Pers
return obj.(*v1.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakePersistentVolumeClaims) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(persistentvolumeclaimsResource, c.ns, name), &v1.PersistentVolumeClaim{})
return err
}
func (c *FakePersistentVolumeClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakePersistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.PersistentVolumeClaimList{})
@@ -87,7 +87,7 @@ func (c *FakePersistentVolumeClaims) Get(name string) (result *v1.PersistentVolu
return obj.(*v1.PersistentVolumeClaim), err
}
func (c *FakePersistentVolumeClaims) List(opts v1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
func (c *FakePersistentVolumeClaims) List(opts api.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(persistentvolumeclaimsResource, c.ns, opts), &v1.PersistentVolumeClaimList{})
@@ -95,7 +95,7 @@ func (c *FakePersistentVolumeClaims) List(opts v1.ListOptions) (result *v1.Persi
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -109,7 +109,7 @@ func (c *FakePersistentVolumeClaims) List(opts v1.ListOptions) (result *v1.Persi
}
// Watch returns a watch.Interface that watches the requested persistentVolumeClaims.
func (c *FakePersistentVolumeClaims) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakePersistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(persistentvolumeclaimsResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakePods implements PodInterface
type FakePods struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -63,14 +63,14 @@ func (c *FakePods) UpdateStatus(pod *v1.Pod) (*v1.Pod, error) {
return obj.(*v1.Pod), err
}
func (c *FakePods) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakePods) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podsResource, c.ns, name), &v1.Pod{})
return err
}
func (c *FakePods) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakePods) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.PodList{})
@@ -87,7 +87,7 @@ func (c *FakePods) Get(name string) (result *v1.Pod, err error) {
return obj.(*v1.Pod), err
}
func (c *FakePods) List(opts v1.ListOptions) (result *v1.PodList, err error) {
func (c *FakePods) List(opts api.ListOptions) (result *v1.PodList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podsResource, c.ns, opts), &v1.PodList{})
@@ -95,7 +95,7 @@ func (c *FakePods) List(opts v1.ListOptions) (result *v1.PodList, err error) {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -109,7 +109,7 @@ func (c *FakePods) List(opts v1.ListOptions) (result *v1.PodList, err error) {
}
// Watch returns a watch.Interface that watches the requested pods.
func (c *FakePods) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakePods) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podsResource, c.ns, opts))

View File

@@ -17,10 +17,10 @@ limitations under the License.
package fake
import (
"k8s.io/client-go/pkg/api/v1"
policy "k8s.io/client-go/pkg/apis/policy/v1beta1"
"k8s.io/client-go/rest"
"k8s.io/client-go/testing"
"k8s.io/client-go/1.5/pkg/api/v1"
"k8s.io/client-go/1.5/pkg/apis/policy/v1alpha1"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/1.5/testing"
)
func (c *FakePods) Bind(binding *v1.Binding) error {
@@ -46,7 +46,7 @@ func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *rest.Request {
return &rest.Request{}
}
func (c *FakePods) Evict(eviction *policy.Eviction) error {
func (c *FakePods) Evict(eviction *v1alpha1.Eviction) error {
action := testing.CreateActionImpl{}
action.Verb = "create"
action.Resource = podsResource

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakePodTemplates implements PodTemplateInterface
type FakePodTemplates struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakePodTemplates) Update(podTemplate *v1.PodTemplate) (result *v1.PodTe
return obj.(*v1.PodTemplate), err
}
func (c *FakePodTemplates) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podtemplatesResource, c.ns, name), &v1.PodTemplate{})
return err
}
func (c *FakePodTemplates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakePodTemplates) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.PodTemplateList{})
@@ -77,7 +77,7 @@ func (c *FakePodTemplates) Get(name string) (result *v1.PodTemplate, err error)
return obj.(*v1.PodTemplate), err
}
func (c *FakePodTemplates) List(opts v1.ListOptions) (result *v1.PodTemplateList, err error) {
func (c *FakePodTemplates) List(opts api.ListOptions) (result *v1.PodTemplateList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podtemplatesResource, c.ns, opts), &v1.PodTemplateList{})
@@ -85,7 +85,7 @@ func (c *FakePodTemplates) List(opts v1.ListOptions) (result *v1.PodTemplateList
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakePodTemplates) List(opts v1.ListOptions) (result *v1.PodTemplateList
}
// Watch returns a watch.Interface that watches the requested podTemplates.
func (c *FakePodTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakePodTemplates) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podtemplatesResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeReplicationControllers implements ReplicationControllerInterface
type FakeReplicationControllers struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -63,14 +63,14 @@ func (c *FakeReplicationControllers) UpdateStatus(replicationController *v1.Repl
return obj.(*v1.ReplicationController), err
}
func (c *FakeReplicationControllers) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeReplicationControllers) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(replicationcontrollersResource, c.ns, name), &v1.ReplicationController{})
return err
}
func (c *FakeReplicationControllers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeReplicationControllers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ReplicationControllerList{})
@@ -87,7 +87,7 @@ func (c *FakeReplicationControllers) Get(name string) (result *v1.ReplicationCon
return obj.(*v1.ReplicationController), err
}
func (c *FakeReplicationControllers) List(opts v1.ListOptions) (result *v1.ReplicationControllerList, err error) {
func (c *FakeReplicationControllers) List(opts api.ListOptions) (result *v1.ReplicationControllerList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(replicationcontrollersResource, c.ns, opts), &v1.ReplicationControllerList{})
@@ -95,7 +95,7 @@ func (c *FakeReplicationControllers) List(opts v1.ListOptions) (result *v1.Repli
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -109,7 +109,7 @@ func (c *FakeReplicationControllers) List(opts v1.ListOptions) (result *v1.Repli
}
// Watch returns a watch.Interface that watches the requested replicationControllers.
func (c *FakeReplicationControllers) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeReplicationControllers) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(replicationcontrollersResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeResourceQuotas implements ResourceQuotaInterface
type FakeResourceQuotas struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -63,14 +63,14 @@ func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (*v1.
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeResourceQuotas) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(resourcequotasResource, c.ns, name), &v1.ResourceQuota{})
return err
}
func (c *FakeResourceQuotas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeResourceQuotas) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ResourceQuotaList{})
@@ -87,7 +87,7 @@ func (c *FakeResourceQuotas) Get(name string) (result *v1.ResourceQuota, err err
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) List(opts v1.ListOptions) (result *v1.ResourceQuotaList, err error) {
func (c *FakeResourceQuotas) List(opts api.ListOptions) (result *v1.ResourceQuotaList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(resourcequotasResource, c.ns, opts), &v1.ResourceQuotaList{})
@@ -95,7 +95,7 @@ func (c *FakeResourceQuotas) List(opts v1.ListOptions) (result *v1.ResourceQuota
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -109,7 +109,7 @@ func (c *FakeResourceQuotas) List(opts v1.ListOptions) (result *v1.ResourceQuota
}
// Watch returns a watch.Interface that watches the requested resourceQuotas.
func (c *FakeResourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeResourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(resourcequotasResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeSecrets implements SecretInterface
type FakeSecrets struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeSecrets) Update(secret *v1.Secret) (result *v1.Secret, err error) {
return obj.(*v1.Secret), err
}
func (c *FakeSecrets) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeSecrets) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &v1.Secret{})
return err
}
func (c *FakeSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeSecrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.SecretList{})
@@ -77,7 +77,7 @@ func (c *FakeSecrets) Get(name string) (result *v1.Secret, err error) {
return obj.(*v1.Secret), err
}
func (c *FakeSecrets) List(opts v1.ListOptions) (result *v1.SecretList, err error) {
func (c *FakeSecrets) List(opts api.ListOptions) (result *v1.SecretList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(secretsResource, c.ns, opts), &v1.SecretList{})
@@ -85,7 +85,7 @@ func (c *FakeSecrets) List(opts v1.ListOptions) (result *v1.SecretList, err erro
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeSecrets) List(opts v1.ListOptions) (result *v1.SecretList, err erro
}
// Watch returns a watch.Interface that watches the requested secrets.
func (c *FakeSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeSecrets) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts))

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeServices implements ServiceInterface
type FakeServices struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -63,14 +63,14 @@ func (c *FakeServices) UpdateStatus(service *v1.Service) (*v1.Service, error) {
return obj.(*v1.Service), err
}
func (c *FakeServices) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeServices) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &v1.Service{})
return err
}
func (c *FakeServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeServices) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ServiceList{})
@@ -87,7 +87,7 @@ func (c *FakeServices) Get(name string) (result *v1.Service, err error) {
return obj.(*v1.Service), err
}
func (c *FakeServices) List(opts v1.ListOptions) (result *v1.ServiceList, err error) {
func (c *FakeServices) List(opts api.ListOptions) (result *v1.ServiceList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(servicesResource, c.ns, opts), &v1.ServiceList{})
@@ -95,7 +95,7 @@ func (c *FakeServices) List(opts v1.ListOptions) (result *v1.ServiceList, err er
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -109,7 +109,7 @@ func (c *FakeServices) List(opts v1.ListOptions) (result *v1.ServiceList, err er
}
// Watch returns a watch.Interface that watches the requested services.
func (c *FakeServices) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeServices) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(servicesResource, c.ns, opts))

View File

@@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
"k8s.io/client-go/rest"
"k8s.io/client-go/testing"
"k8s.io/client-go/1.5/rest"
"k8s.io/client-go/1.5/testing"
)
func (c *FakeServices) ProxyGet(scheme, name, port, path string, params map[string]string) rest.ResponseWrapper {

View File

@@ -17,17 +17,17 @@ limitations under the License.
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"
labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch"
testing "k8s.io/client-go/testing"
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"
labels "k8s.io/client-go/1.5/pkg/labels"
watch "k8s.io/client-go/1.5/pkg/watch"
testing "k8s.io/client-go/1.5/testing"
)
// FakeServiceAccounts implements ServiceAccountInterface
type FakeServiceAccounts struct {
Fake *FakeCoreV1
Fake *FakeCore
ns string
}
@@ -53,14 +53,14 @@ func (c *FakeServiceAccounts) Update(serviceAccount *v1.ServiceAccount) (result
return obj.(*v1.ServiceAccount), err
}
func (c *FakeServiceAccounts) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeServiceAccounts) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(serviceaccountsResource, c.ns, name), &v1.ServiceAccount{})
return err
}
func (c *FakeServiceAccounts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeServiceAccounts) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ServiceAccountList{})
@@ -77,7 +77,7 @@ func (c *FakeServiceAccounts) Get(name string) (result *v1.ServiceAccount, err e
return obj.(*v1.ServiceAccount), err
}
func (c *FakeServiceAccounts) List(opts v1.ListOptions) (result *v1.ServiceAccountList, err error) {
func (c *FakeServiceAccounts) List(opts api.ListOptions) (result *v1.ServiceAccountList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(serviceaccountsResource, c.ns, opts), &v1.ServiceAccountList{})
@@ -85,7 +85,7 @@ func (c *FakeServiceAccounts) List(opts v1.ListOptions) (result *v1.ServiceAccou
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
label := opts.LabelSelector
if label == nil {
label = labels.Everything()
}
@@ -99,7 +99,7 @@ func (c *FakeServiceAccounts) List(opts v1.ListOptions) (result *v1.ServiceAccou
}
// Watch returns a watch.Interface that watches the requested serviceAccounts.
func (c *FakeServiceAccounts) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeServiceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(serviceaccountsResource, c.ns, opts))

View File

@@ -24,6 +24,8 @@ type EndpointsExpansion interface{}
type LimitRangeExpansion interface{}
type NodeExpansion interface{}
type PersistentVolumeExpansion interface{}
type PersistentVolumeClaimExpansion interface{}

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// LimitRangesGetter has a method to return a LimitRangeInterface.
@@ -33,25 +32,25 @@ type LimitRangesGetter interface {
type LimitRangeInterface interface {
Create(*v1.LimitRange) (*v1.LimitRange, error)
Update(*v1.LimitRange) (*v1.LimitRange, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.LimitRange, error)
List(opts v1.ListOptions) (*v1.LimitRangeList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.LimitRangeList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
ns string
}
// newLimitRanges returns a LimitRanges
func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges {
func newLimitRanges(c *CoreClient, namespace string) *limitRanges {
return &limitRanges{
client: c.RESTClient(),
client: c,
ns: namespace,
}
}
@@ -82,7 +81,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 *v1.DeleteOptions) error {
func (c *limitRanges) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
@@ -93,7 +92,7 @@ func (c *limitRanges) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *limitRanges) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *limitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
@@ -116,7 +115,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 v1.ListOptions) (result *v1.LimitRangeList, err error) {
func (c *limitRanges) List(opts api.ListOptions) (result *v1.LimitRangeList, err error) {
result = &v1.LimitRangeList{}
err = c.client.Get().
Namespace(c.ns).
@@ -128,7 +127,7 @@ func (c *limitRanges) List(opts v1.ListOptions) (result *v1.LimitRangeList, err
}
// Watch returns a watch.Interface that watches the requested limitRanges.
func (c *limitRanges) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().
Prefix("watch").
Namespace(c.ns).

View File

@@ -17,10 +17,9 @@ limitations under the License.
package v1
import (
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"
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"
)
// NamespacesGetter has a method to return a NamespaceInterface.
@@ -34,24 +33,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 *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Delete(name string, options *api.DeleteOptions) error
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
Get(name string) (*v1.Namespace, error)
List(opts v1.ListOptions) (*v1.NamespaceList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
List(opts api.ListOptions) (*v1.NamespaceList, error)
Watch(opts api.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 rest.Interface
client *CoreClient
}
// newNamespaces returns a Namespaces
func newNamespaces(c *CoreV1Client) *namespaces {
func newNamespaces(c *CoreClient) *namespaces {
return &namespaces{
client: c.RESTClient(),
client: c,
}
}
@@ -91,7 +90,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 *v1.DeleteOptions) error {
func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
return c.client.Delete().
Resource("namespaces").
Name(name).
@@ -101,7 +100,7 @@ func (c *namespaces) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *namespaces) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
return c.client.Delete().
Resource("namespaces").
VersionedParams(&listOptions, api.ParameterCodec).
@@ -122,7 +121,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 v1.ListOptions) (result *v1.NamespaceList, err error) {
func (c *namespaces) List(opts api.ListOptions) (result *v1.NamespaceList, err error) {
result = &v1.NamespaceList{}
err = c.client.Get().
Resource("namespaces").
@@ -133,7 +132,7 @@ func (c *namespaces) List(opts v1.ListOptions) (result *v1.NamespaceList, err er
}
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *namespaces) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *namespaces) Watch(opts api.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/pkg/api/v1"
import "k8s.io/client-go/1.5/pkg/api/v1"
// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface.
type NamespaceExpansion interface {

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