mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Generate clientset 1.5
This commit is contained in:
parent
cc958818db
commit
7ba1410521
@ -24,6 +24,7 @@ import (
|
|||||||
v1core "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/core/v1"
|
v1core "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/core/v1"
|
||||||
v1beta1extensions "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/extensions/v1beta1"
|
v1beta1extensions "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/extensions/v1beta1"
|
||||||
v1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1"
|
v1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1"
|
||||||
|
v1beta1storage "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/storage/v1beta1"
|
||||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||||
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||||
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
||||||
@ -37,6 +38,7 @@ type Interface interface {
|
|||||||
Batch() v1batch.BatchInterface
|
Batch() v1batch.BatchInterface
|
||||||
Extensions() v1beta1extensions.ExtensionsInterface
|
Extensions() v1beta1extensions.ExtensionsInterface
|
||||||
Policy() v1alpha1policy.PolicyInterface
|
Policy() v1alpha1policy.PolicyInterface
|
||||||
|
Storage() v1beta1storage.StorageInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clientset contains the clients for groups. Each group has exactly one
|
// Clientset contains the clients for groups. Each group has exactly one
|
||||||
@ -49,6 +51,7 @@ type Clientset struct {
|
|||||||
*v1batch.BatchClient
|
*v1batch.BatchClient
|
||||||
*v1beta1extensions.ExtensionsClient
|
*v1beta1extensions.ExtensionsClient
|
||||||
*v1alpha1policy.PolicyClient
|
*v1alpha1policy.PolicyClient
|
||||||
|
*v1beta1storage.StorageClient
|
||||||
}
|
}
|
||||||
|
|
||||||
// Core retrieves the CoreClient
|
// Core retrieves the CoreClient
|
||||||
@ -99,6 +102,14 @@ func (c *Clientset) Policy() v1alpha1policy.PolicyInterface {
|
|||||||
return c.PolicyClient
|
return c.PolicyClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Storage retrieves the StorageClient
|
||||||
|
func (c *Clientset) Storage() v1beta1storage.StorageInterface {
|
||||||
|
if c == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return c.StorageClient
|
||||||
|
}
|
||||||
|
|
||||||
// Discovery retrieves the DiscoveryClient
|
// Discovery retrieves the DiscoveryClient
|
||||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||||
return c.DiscoveryClient
|
return c.DiscoveryClient
|
||||||
@ -136,6 +147,10 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
clientset.StorageClient, err = v1beta1storage.NewForConfig(&configShallowCopy)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -155,6 +170,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
|||||||
clientset.BatchClient = v1batch.NewForConfigOrDie(c)
|
clientset.BatchClient = v1batch.NewForConfigOrDie(c)
|
||||||
clientset.ExtensionsClient = v1beta1extensions.NewForConfigOrDie(c)
|
clientset.ExtensionsClient = v1beta1extensions.NewForConfigOrDie(c)
|
||||||
clientset.PolicyClient = v1alpha1policy.NewForConfigOrDie(c)
|
clientset.PolicyClient = v1alpha1policy.NewForConfigOrDie(c)
|
||||||
|
clientset.StorageClient = v1beta1storage.NewForConfigOrDie(c)
|
||||||
|
|
||||||
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||||
return &clientset
|
return &clientset
|
||||||
@ -169,6 +185,7 @@ func New(c *restclient.RESTClient) *Clientset {
|
|||||||
clientset.BatchClient = v1batch.New(c)
|
clientset.BatchClient = v1batch.New(c)
|
||||||
clientset.ExtensionsClient = v1beta1extensions.New(c)
|
clientset.ExtensionsClient = v1beta1extensions.New(c)
|
||||||
clientset.PolicyClient = v1alpha1policy.New(c)
|
clientset.PolicyClient = v1alpha1policy.New(c)
|
||||||
|
clientset.StorageClient = v1beta1storage.New(c)
|
||||||
|
|
||||||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||||
return &clientset
|
return &clientset
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated clientset.
|
// This package has the automatically generated clientset.
|
||||||
package release_1_5
|
package release_1_5
|
||||||
|
@ -32,6 +32,8 @@ import (
|
|||||||
fakev1beta1extensions "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/extensions/v1beta1/fake"
|
fakev1beta1extensions "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/extensions/v1beta1/fake"
|
||||||
v1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1"
|
v1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1"
|
||||||
fakev1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1/fake"
|
fakev1alpha1policy "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/policy/v1alpha1/fake"
|
||||||
|
v1beta1storage "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/storage/v1beta1"
|
||||||
|
fakev1beta1storage "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/storage/v1beta1/fake"
|
||||||
"k8s.io/kubernetes/pkg/client/testing/core"
|
"k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||||
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake"
|
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake"
|
||||||
@ -101,3 +103,8 @@ func (c *Clientset) Extensions() v1beta1extensions.ExtensionsInterface {
|
|||||||
func (c *Clientset) Policy() v1alpha1policy.PolicyInterface {
|
func (c *Clientset) Policy() v1alpha1policy.PolicyInterface {
|
||||||
return &fakev1alpha1policy.FakePolicy{Fake: &c.Fake}
|
return &fakev1alpha1policy.FakePolicy{Fake: &c.Fake}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Storage retrieves the StorageClient
|
||||||
|
func (c *Clientset) Storage() v1beta1storage.StorageInterface {
|
||||||
|
return &fakev1beta1storage.FakeStorage{Fake: &c.Fake}
|
||||||
|
}
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated fake clientset.
|
// This package has the automatically generated fake clientset.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1beta1
|
package v1beta1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1
|
package v1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1
|
package v1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1
|
package v1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1beta1
|
package v1beta1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1]
|
// This package is generated by client-gen with arguments: --clientset-name=release_1_5 --input=[api/v1,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -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,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
|
// This package has the automatically generated typed clients.
|
||||||
|
package v1beta1
|
@ -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,authorization/v1beta1,autoscaling/v1,batch/v1,extensions/v1beta1,policy/v1alpha1,storage/v1beta1]
|
||||||
|
|
||||||
|
// 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 (
|
||||||
|
v1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/release_1_5/typed/storage/v1beta1"
|
||||||
|
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||||
|
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FakeStorage struct {
|
||||||
|
*core.Fake
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorage) StorageClasses() v1beta1.StorageClassInterface {
|
||||||
|
return &FakeStorageClasses{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRESTClient returns a RESTClient that is used to communicate
|
||||||
|
// with API server by this client implementation.
|
||||||
|
func (c *FakeStorage) GetRESTClient() *restclient.RESTClient {
|
||||||
|
return nil
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package fake
|
||||||
|
|
||||||
|
import (
|
||||||
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
|
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
|
v1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
|
||||||
|
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
|
labels "k8s.io/kubernetes/pkg/labels"
|
||||||
|
watch "k8s.io/kubernetes/pkg/watch"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FakeStorageClasses implements StorageClassInterface
|
||||||
|
type FakeStorageClasses struct {
|
||||||
|
Fake *FakeStorage
|
||||||
|
}
|
||||||
|
|
||||||
|
var storageclassesResource = unversioned.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "storageclasses"}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) Create(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(core.NewRootCreateAction(storageclassesResource, storageClass), &v1beta1.StorageClass{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*v1beta1.StorageClass), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) Update(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(core.NewRootUpdateAction(storageclassesResource, storageClass), &v1beta1.StorageClass{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*v1beta1.StorageClass), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) Delete(name string, options *api.DeleteOptions) error {
|
||||||
|
_, err := c.Fake.
|
||||||
|
Invokes(core.NewRootDeleteAction(storageclassesResource, name), &v1beta1.StorageClass{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||||
|
action := core.NewRootDeleteCollectionAction(storageclassesResource, listOptions)
|
||||||
|
|
||||||
|
_, err := c.Fake.Invokes(action, &v1beta1.StorageClassList{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) Get(name string) (result *v1beta1.StorageClass, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(core.NewRootGetAction(storageclassesResource, name), &v1beta1.StorageClass{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*v1beta1.StorageClass), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeStorageClasses) List(opts api.ListOptions) (result *v1beta1.StorageClassList, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(core.NewRootListAction(storageclassesResource, opts), &v1beta1.StorageClassList{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
label := opts.LabelSelector
|
||||||
|
if label == nil {
|
||||||
|
label = labels.Everything()
|
||||||
|
}
|
||||||
|
list := &v1beta1.StorageClassList{}
|
||||||
|
for _, item := range obj.(*v1beta1.StorageClassList).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 storageClasses.
|
||||||
|
func (c *FakeStorageClasses) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||||
|
return c.Fake.
|
||||||
|
InvokesWatch(core.NewRootWatchAction(storageclassesResource, opts))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched storageClass.
|
||||||
|
func (c *FakeStorageClasses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(core.NewRootPatchSubresourceAction(storageclassesResource, name, data, subresources...), &v1beta1.StorageClass{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*v1beta1.StorageClass), err
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1beta1
|
||||||
|
|
||||||
|
type StorageClassExpansion interface{}
|
@ -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/kubernetes/pkg/api"
|
||||||
|
registered "k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
|
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||||
|
serializer "k8s.io/kubernetes/pkg/runtime/serializer"
|
||||||
|
)
|
||||||
|
|
||||||
|
type StorageInterface interface {
|
||||||
|
GetRESTClient() *restclient.RESTClient
|
||||||
|
StorageClassesGetter
|
||||||
|
}
|
||||||
|
|
||||||
|
// StorageClient is used to interact with features provided by the Storage group.
|
||||||
|
type StorageClient struct {
|
||||||
|
*restclient.RESTClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *StorageClient) StorageClasses() StorageClassInterface {
|
||||||
|
return newStorageClasses(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewForConfig creates a new StorageClient for the given config.
|
||||||
|
func NewForConfig(c *restclient.Config) (*StorageClient, error) {
|
||||||
|
config := *c
|
||||||
|
if err := setConfigDefaults(&config); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
client, err := restclient.RESTClientFor(&config)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &StorageClient{client}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewForConfigOrDie creates a new StorageClient for the given config and
|
||||||
|
// panics if there is an error in the config.
|
||||||
|
func NewForConfigOrDie(c *restclient.Config) *StorageClient {
|
||||||
|
client, err := NewForConfig(c)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return client
|
||||||
|
}
|
||||||
|
|
||||||
|
// New creates a new StorageClient for the given RESTClient.
|
||||||
|
func New(c *restclient.RESTClient) *StorageClient {
|
||||||
|
return &StorageClient{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setConfigDefaults(config *restclient.Config) error {
|
||||||
|
// if storage group is not registered, return an error
|
||||||
|
g, err := registered.Group("storage.k8s.io")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
config.APIPath = "/apis"
|
||||||
|
if config.UserAgent == "" {
|
||||||
|
config.UserAgent = restclient.DefaultKubernetesUserAgent()
|
||||||
|
}
|
||||||
|
// TODO: Unconditionally set the config.Version, until we fix the config.
|
||||||
|
//if config.Version == "" {
|
||||||
|
copyGroupVersion := g.GroupVersion
|
||||||
|
config.GroupVersion = ©GroupVersion
|
||||||
|
//}
|
||||||
|
|
||||||
|
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRESTClient returns a RESTClient that is used to communicate
|
||||||
|
// with API server by this client implementation.
|
||||||
|
func (c *StorageClient) GetRESTClient() *restclient.RESTClient {
|
||||||
|
if c == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return c.RESTClient
|
||||||
|
}
|
@ -0,0 +1,141 @@
|
|||||||
|
/*
|
||||||
|
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/kubernetes/pkg/api"
|
||||||
|
v1beta1 "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
|
||||||
|
watch "k8s.io/kubernetes/pkg/watch"
|
||||||
|
)
|
||||||
|
|
||||||
|
// StorageClassesGetter has a method to return a StorageClassInterface.
|
||||||
|
// A group's client should implement this interface.
|
||||||
|
type StorageClassesGetter interface {
|
||||||
|
StorageClasses() StorageClassInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
// StorageClassInterface has methods to work with StorageClass resources.
|
||||||
|
type StorageClassInterface interface {
|
||||||
|
Create(*v1beta1.StorageClass) (*v1beta1.StorageClass, error)
|
||||||
|
Update(*v1beta1.StorageClass) (*v1beta1.StorageClass, error)
|
||||||
|
Delete(name string, options *api.DeleteOptions) error
|
||||||
|
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||||
|
Get(name string) (*v1beta1.StorageClass, error)
|
||||||
|
List(opts api.ListOptions) (*v1beta1.StorageClassList, error)
|
||||||
|
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||||
|
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error)
|
||||||
|
StorageClassExpansion
|
||||||
|
}
|
||||||
|
|
||||||
|
// storageClasses implements StorageClassInterface
|
||||||
|
type storageClasses struct {
|
||||||
|
client *StorageClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// newStorageClasses returns a StorageClasses
|
||||||
|
func newStorageClasses(c *StorageClient) *storageClasses {
|
||||||
|
return &storageClasses{
|
||||||
|
client: c,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any.
|
||||||
|
func (c *storageClasses) Create(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
|
||||||
|
result = &v1beta1.StorageClass{}
|
||||||
|
err = c.client.Post().
|
||||||
|
Resource("storageclasses").
|
||||||
|
Body(storageClass).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any.
|
||||||
|
func (c *storageClasses) Update(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
|
||||||
|
result = &v1beta1.StorageClass{}
|
||||||
|
err = c.client.Put().
|
||||||
|
Resource("storageclasses").
|
||||||
|
Name(storageClass.Name).
|
||||||
|
Body(storageClass).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete takes name of the storageClass and deletes it. Returns an error if one occurs.
|
||||||
|
func (c *storageClasses) Delete(name string, options *api.DeleteOptions) error {
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("storageclasses").
|
||||||
|
Name(name).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCollection deletes a collection of objects.
|
||||||
|
func (c *storageClasses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("storageclasses").
|
||||||
|
VersionedParams(&listOptions, api.ParameterCodec).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any.
|
||||||
|
func (c *storageClasses) Get(name string) (result *v1beta1.StorageClass, err error) {
|
||||||
|
result = &v1beta1.StorageClass{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("storageclasses").
|
||||||
|
Name(name).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List takes label and field selectors, and returns the list of StorageClasses that match those selectors.
|
||||||
|
func (c *storageClasses) List(opts api.ListOptions) (result *v1beta1.StorageClassList, err error) {
|
||||||
|
result = &v1beta1.StorageClassList{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("storageclasses").
|
||||||
|
VersionedParams(&opts, api.ParameterCodec).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch returns a watch.Interface that watches the requested storageClasses.
|
||||||
|
func (c *storageClasses) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||||
|
return c.client.Get().
|
||||||
|
Prefix("watch").
|
||||||
|
Resource("storageclasses").
|
||||||
|
VersionedParams(&opts, api.ParameterCodec).
|
||||||
|
Watch()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched storageClass.
|
||||||
|
func (c *storageClasses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) {
|
||||||
|
result = &v1beta1.StorageClass{}
|
||||||
|
err = c.client.Patch(pt).
|
||||||
|
Resource("storageclasses").
|
||||||
|
SubResource(subresources...).
|
||||||
|
Name(name).
|
||||||
|
Body(data).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user