published by bot

(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 1bc5b822cd566321c115d4ebac5d97cfd347d687
This commit is contained in:
Kubernetes Publisher
2016-11-11 03:39:04 +00:00
parent 24b73253cd
commit ae6775eeec
305 changed files with 13010 additions and 8421 deletions

View File

@@ -17,28 +17,30 @@ limitations under the License.
package v1alpha1
import (
fmt "fmt"
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
registered "k8s.io/client-go/pkg/apimachinery/registered"
serializer "k8s.io/client-go/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type CertificatesInterface interface {
type CertificatesV1alpha1Interface interface {
RESTClient() rest.Interface
CertificateSigningRequestsGetter
}
// CertificatesClient is used to interact with features provided by the Certificates group.
type CertificatesClient struct {
// CertificatesV1alpha1Client is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
type CertificatesV1alpha1Client struct {
restClient rest.Interface
}
func (c *CertificatesClient) CertificateSigningRequests() CertificateSigningRequestInterface {
func (c *CertificatesV1alpha1Client) CertificateSigningRequests() CertificateSigningRequestInterface {
return newCertificateSigningRequests(c)
}
// NewForConfig creates a new CertificatesClient for the given config.
func NewForConfig(c *rest.Config) (*CertificatesClient, error) {
// NewForConfig creates a new CertificatesV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*CertificatesV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@@ -47,12 +49,12 @@ func NewForConfig(c *rest.Config) (*CertificatesClient, error) {
if err != nil {
return nil, err
}
return &CertificatesClient{client}, nil
return &CertificatesV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new CertificatesClient for the given config and
// NewForConfigOrDie creates a new CertificatesV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CertificatesClient {
func NewForConfigOrDie(c *rest.Config) *CertificatesV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@@ -60,26 +62,26 @@ func NewForConfigOrDie(c *rest.Config) *CertificatesClient {
return client
}
// New creates a new CertificatesClient for the given RESTClient.
func New(c rest.Interface) *CertificatesClient {
return &CertificatesClient{c}
// New creates a new CertificatesV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *CertificatesV1alpha1Client {
return &CertificatesV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
// if certificates group is not registered, return an error
g, err := registered.Group("certificates.k8s.io")
gv, err := unversioned.ParseGroupVersion("certificates.k8s.io/v1alpha1")
if err != nil {
return err
}
// if certificates.k8s.io/v1alpha1 is not enabled, return an error
if !registered.IsEnabledVersion(gv) {
return fmt.Errorf("certificates.k8s.io/v1alpha1 is not enabled")
}
config.APIPath = "/apis"
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
// TODO: Unconditionally set the config.Version, until we fix the config.
//if config.Version == "" {
copyGroupVersion := g.GroupVersion
copyGroupVersion := gv
config.GroupVersion = &copyGroupVersion
//}
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
@@ -88,7 +90,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CertificatesClient) RESTClient() rest.Interface {
func (c *CertificatesV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@@ -50,7 +50,7 @@ type certificateSigningRequests struct {
}
// newCertificateSigningRequests returns a CertificateSigningRequests
func newCertificateSigningRequests(c *CertificatesClient) *certificateSigningRequests {
func newCertificateSigningRequests(c *CertificatesV1alpha1Client) *certificateSigningRequests {
return &certificateSigningRequests{
client: c.RESTClient(),
}

View File

@@ -0,0 +1,37 @@
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
certificates "k8s.io/client-go/pkg/apis/certificates/v1alpha1"
)
type CertificateSigningRequestExpansion interface {
UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error)
}
func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) {
result = &certificates.CertificateSigningRequest{}
err = c.client.Put().
Resource("certificatesigningrequests").
Name(certificateSigningRequest.Name).
Body(certificateSigningRequest).
SubResource("approval").
Do().
Into(result)
return
}

View File

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

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1alpha1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,certificates/v1alpha1,extensions/v1beta1,policy/v1alpha1,rbac/v1alpha1,storage/v1beta1]
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,apps/v1beta1,authentication/v1beta1,authorization/v1beta1,autoscaling/v1,batch/v1,batch/v2alpha1,certificates/v1alpha1,extensions/v1beta1,policy/v1beta1,rbac/v1alpha1,storage/v1beta1]
// Package fake has the automatically generated clients.
package fake

View File

@@ -22,17 +22,17 @@ import (
testing "k8s.io/client-go/testing"
)
type FakeCertificates struct {
type FakeCertificatesV1alpha1 struct {
*testing.Fake
}
func (c *FakeCertificates) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface {
func (c *FakeCertificatesV1alpha1) CertificateSigningRequests() v1alpha1.CertificateSigningRequestInterface {
return &FakeCertificateSigningRequests{c}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCertificates) RESTClient() rest.Interface {
func (c *FakeCertificatesV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@@ -28,7 +28,7 @@ import (
// FakeCertificateSigningRequests implements CertificateSigningRequestInterface
type FakeCertificateSigningRequests struct {
Fake *FakeCertificates
Fake *FakeCertificatesV1alpha1
}
var certificatesigningrequestsResource = unversioned.GroupVersionResource{Group: "certificates.k8s.io", Version: "v1alpha1", Resource: "certificatesigningrequests"}

View File

@@ -0,0 +1,31 @@
/*
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 (
certificates "k8s.io/client-go/pkg/apis/certificates/v1alpha1"
"k8s.io/client-go/testing"
)
func (c *FakeCertificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{})
if obj == nil {
return nil, err
}
return obj.(*certificates.CertificateSigningRequest), err
}

View File

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