mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
generated code changes
This commit is contained in:
@@ -18,6 +18,7 @@ package internalclientset
|
||||
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
unversionedauthentication "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/unversioned"
|
||||
unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned"
|
||||
unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
|
||||
unversionedcertificates "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/certificates/unversioned"
|
||||
@@ -34,6 +35,7 @@ type Interface interface {
|
||||
Core() unversionedcore.CoreInterface
|
||||
Extensions() unversionedextensions.ExtensionsInterface
|
||||
Autoscaling() unversionedautoscaling.AutoscalingInterface
|
||||
Authentication() unversionedauthentication.AuthenticationInterface
|
||||
Batch() unversionedbatch.BatchInterface
|
||||
Rbac() unversionedrbac.RbacInterface
|
||||
Certificates() unversionedcertificates.CertificatesInterface
|
||||
@@ -46,6 +48,7 @@ type Clientset struct {
|
||||
*unversionedcore.CoreClient
|
||||
*unversionedextensions.ExtensionsClient
|
||||
*unversionedautoscaling.AutoscalingClient
|
||||
*unversionedauthentication.AuthenticationClient
|
||||
*unversionedbatch.BatchClient
|
||||
*unversionedrbac.RbacClient
|
||||
*unversionedcertificates.CertificatesClient
|
||||
@@ -75,6 +78,14 @@ func (c *Clientset) Autoscaling() unversionedautoscaling.AutoscalingInterface {
|
||||
return c.AutoscalingClient
|
||||
}
|
||||
|
||||
// Authentication retrieves the AuthenticationClient
|
||||
func (c *Clientset) Authentication() unversionedauthentication.AuthenticationInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.AuthenticationClient
|
||||
}
|
||||
|
||||
// Batch retrieves the BatchClient
|
||||
func (c *Clientset) Batch() unversionedbatch.BatchInterface {
|
||||
if c == nil {
|
||||
@@ -124,6 +135,10 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientset.AuthenticationClient, err = unversionedauthentication.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientset.BatchClient, err = unversionedbatch.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -152,6 +167,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
clientset.CoreClient = unversionedcore.NewForConfigOrDie(c)
|
||||
clientset.ExtensionsClient = unversionedextensions.NewForConfigOrDie(c)
|
||||
clientset.AutoscalingClient = unversionedautoscaling.NewForConfigOrDie(c)
|
||||
clientset.AuthenticationClient = unversionedauthentication.NewForConfigOrDie(c)
|
||||
clientset.BatchClient = unversionedbatch.NewForConfigOrDie(c)
|
||||
clientset.RbacClient = unversionedrbac.NewForConfigOrDie(c)
|
||||
clientset.CertificatesClient = unversionedcertificates.NewForConfigOrDie(c)
|
||||
@@ -166,6 +182,7 @@ func New(c *restclient.RESTClient) *Clientset {
|
||||
clientset.CoreClient = unversionedcore.New(c)
|
||||
clientset.ExtensionsClient = unversionedextensions.New(c)
|
||||
clientset.AutoscalingClient = unversionedautoscaling.New(c)
|
||||
clientset.AuthenticationClient = unversionedauthentication.New(c)
|
||||
clientset.BatchClient = unversionedbatch.New(c)
|
||||
clientset.RbacClient = unversionedrbac.New(c)
|
||||
clientset.CertificatesClient = unversionedcertificates.New(c)
|
||||
|
||||
@@ -20,6 +20,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||
unversionedauthentication "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/unversioned"
|
||||
fakeunversionedauthentication "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/unversioned/fake"
|
||||
unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned"
|
||||
fakeunversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned/fake"
|
||||
unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
|
||||
@@ -87,6 +89,11 @@ func (c *Clientset) Autoscaling() unversionedautoscaling.AutoscalingInterface {
|
||||
return &fakeunversionedautoscaling.FakeAutoscaling{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Authentication retrieves the AuthenticationClient
|
||||
func (c *Clientset) Authentication() unversionedauthentication.AuthenticationInterface {
|
||||
return &fakeunversionedauthentication.FakeAuthentication{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Batch retrieves the BatchClient
|
||||
func (c *Clientset) Batch() unversionedbatch.BatchInterface {
|
||||
return &fakeunversionedbatch.FakeBatch{Fake: &c.Fake}
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/api/install"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
_ "k8s.io/kubernetes/pkg/apis/apps/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/authentication/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/authorization/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
|
||||
_ "k8s.io/kubernetes/pkg/apis/batch/install"
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
registered "k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
type AuthenticationInterface interface {
|
||||
GetRESTClient() *restclient.RESTClient
|
||||
TokenReviewsGetter
|
||||
}
|
||||
|
||||
// AuthenticationClient is used to interact with features provided by the Authentication group.
|
||||
type AuthenticationClient struct {
|
||||
*restclient.RESTClient
|
||||
}
|
||||
|
||||
func (c *AuthenticationClient) TokenReviews() TokenReviewInterface {
|
||||
return newTokenReviews(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new AuthenticationClient for the given config.
|
||||
func NewForConfig(c *restclient.Config) (*AuthenticationClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := restclient.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 *restclient.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 *restclient.RESTClient) *AuthenticationClient {
|
||||
return &AuthenticationClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *restclient.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 = restclient.DefaultKubernetesUserAgent()
|
||||
}
|
||||
// TODO: Unconditionally set the config.Version, until we fix the config.
|
||||
//if config.Version == "" {
|
||||
copyGroupVersion := g.GroupVersion
|
||||
config.GroupVersion = ©GroupVersion
|
||||
//}
|
||||
|
||||
config.NegotiatedSerializer = api.Codecs
|
||||
|
||||
if config.QPS == 0 {
|
||||
config.QPS = 5
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *AuthenticationClient) GetRESTClient() *restclient.RESTClient {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.RESTClient
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with the default arguments.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package unversioned
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with the default arguments.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
unversioned "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/unversioned"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
type FakeAuthentication struct {
|
||||
*core.Fake
|
||||
}
|
||||
|
||||
func (c *FakeAuthentication) TokenReviews() unversioned.TokenReviewInterface {
|
||||
return &FakeTokenReviews{c}
|
||||
}
|
||||
|
||||
// GetRESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeAuthentication) GetRESTClient() *restclient.RESTClient {
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
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
|
||||
|
||||
// FakeTokenReviews implements TokenReviewInterface
|
||||
type FakeTokenReviews struct {
|
||||
Fake *FakeAuthentication
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package unversioned
|
||||
|
||||
// TokenReviewsGetter has a method to return a TokenReviewInterface.
|
||||
// A group's client should implement this interface.
|
||||
type TokenReviewsGetter interface {
|
||||
TokenReviews() TokenReviewInterface
|
||||
}
|
||||
|
||||
// TokenReviewInterface has methods to work with TokenReview resources.
|
||||
type TokenReviewInterface interface {
|
||||
TokenReviewExpansion
|
||||
}
|
||||
|
||||
// tokenReviews implements TokenReviewInterface
|
||||
type tokenReviews struct {
|
||||
client *AuthenticationClient
|
||||
}
|
||||
|
||||
// newTokenReviews returns a TokenReviews
|
||||
func newTokenReviews(c *AuthenticationClient) *tokenReviews {
|
||||
return &tokenReviews{
|
||||
client: c,
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ package internalclientset
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||
unversionedauthentication "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/unversioned"
|
||||
unversionedautoscaling "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/autoscaling/unversioned"
|
||||
unversionedbatch "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/batch/unversioned"
|
||||
unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned"
|
||||
@@ -51,6 +52,11 @@ func FromUnversionedClient(c *unversioned.Client) *internalclientset.Clientset {
|
||||
} else {
|
||||
clientset.AutoscalingClient = unversionedautoscaling.New(nil)
|
||||
}
|
||||
if c != nil && c.AuthenticationClient != nil {
|
||||
clientset.AuthenticationClient = unversionedauthentication.New(c.AuthenticationClient.RESTClient)
|
||||
} else {
|
||||
clientset.AuthenticationClient = unversionedauthentication.New(nil)
|
||||
}
|
||||
if c != nil && c.DiscoveryClient != nil {
|
||||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c.DiscoveryClient.RESTClient)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user