generate UpdateScale and GetScale verbs for scalable resources

pull/6/head
Michal Fojtik 2017-08-30 20:32:08 +02:00
parent ba731a6cca
commit 7d2be1c521
No known key found for this signature in database
GPG Key ID: 172B61E538AAC0EE
26 changed files with 552 additions and 0 deletions

View File

@ -42,6 +42,9 @@ type DeploymentInterface interface {
List(opts v1.ListOptions) (*v1beta1.DeploymentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error)
GetScale(deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(deploymentName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
DeploymentExpansion
}
@ -170,3 +173,31 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -136,3 +136,25 @@ func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*v1beta1.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeDeployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}

View File

@ -136,3 +136,25 @@ func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*v1beta1.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}

View File

@ -42,6 +42,9 @@ type ReplicaSetInterface interface {
List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error)
GetScale(replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(replicaSetName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
ReplicaSetExpansion
}
@ -170,3 +173,31 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -2607,6 +2607,8 @@ type ReplicationControllerCondition struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/extensions.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/extensions.Scale,result=k8s.io/kubernetes/pkg/apis/extensions.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ReplicationController represents the configuration of a replication controller.

View File

@ -23,6 +23,8 @@ import (
)
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/kubernetes/pkg/apis/extensions.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/kubernetes/pkg/apis/extensions.Scale,result=k8s.io/kubernetes/pkg/apis/extensions.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// StatefulSet represents a set of pods with consistent identities.

View File

@ -166,6 +166,8 @@ type ThirdPartyResourceData struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type Deployment struct {
@ -751,6 +753,8 @@ type IngressBackend struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ReplicaSet represents the configuration of a replica set.

View File

@ -24,6 +24,7 @@ import (
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
)
// FakeStatefulSets implements StatefulSetInterface
@ -136,3 +137,25 @@ func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, s
}
return obj.(*apps.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeStatefulSets) UpdateScale(statefulSetName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}

View File

@ -22,6 +22,7 @@ import (
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
)
@ -42,6 +43,9 @@ type StatefulSetInterface interface {
List(opts v1.ListOptions) (*apps.StatefulSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.StatefulSet, err error)
GetScale(statefulSetName string, options v1.GetOptions) (*extensions.Scale, error)
UpdateScale(statefulSetName string, scale *extensions.Scale) (*extensions.Scale, error)
StatefulSetExpansion
}
@ -170,3 +174,31 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
Into(result)
return
}
// GetScale takes name of the statefulSet, and returns the corresponding extensions.Scale object, and an error if there is any.
func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *statefulSets) UpdateScale(statefulSetName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -24,6 +24,7 @@ import (
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
)
// FakeReplicationControllers implements ReplicationControllerInterface
@ -136,3 +137,25 @@ func (c *FakeReplicationControllers) Patch(name string, pt types.PatchType, data
}
return obj.(*api.ReplicationController), err
}
// GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicationControllers) GetScale(replicationControllerName string, options v1.GetOptions) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicationcontrollersResource, c.ns, "scale", replicationControllerName), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicationControllers) UpdateScale(replicationControllerName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "scale", c.ns, scale), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}

View File

@ -22,6 +22,7 @@ import (
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
api "k8s.io/kubernetes/pkg/api"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
)
@ -42,6 +43,9 @@ type ReplicationControllerInterface interface {
List(opts v1.ListOptions) (*api.ReplicationControllerList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.ReplicationController, err error)
GetScale(replicationControllerName string, options v1.GetOptions) (*extensions.Scale, error)
UpdateScale(replicationControllerName string, scale *extensions.Scale) (*extensions.Scale, error)
ReplicationControllerExpansion
}
@ -170,3 +174,31 @@ func (c *replicationControllers) Patch(name string, pt types.PatchType, data []b
Into(result)
return
}
// GetScale takes name of the replicationController, and returns the corresponding extensions.Scale object, and an error if there is any.
func (c *replicationControllers) GetScale(replicationControllerName string, options v1.GetOptions) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicationcontrollers").
Name(replicationControllerName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicationControllers) UpdateScale(replicationControllerName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicationcontrollers").
Name(replicationControllerName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -42,6 +42,9 @@ type DeploymentInterface interface {
List(opts v1.ListOptions) (*extensions.DeploymentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error)
GetScale(deploymentName string, options v1.GetOptions) (*extensions.Scale, error)
UpdateScale(deploymentName string, scale *extensions.Scale) (*extensions.Scale, error)
DeploymentExpansion
}
@ -170,3 +173,31 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the deployment, and returns the corresponding extensions.Scale object, and an error if there is any.
func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *deployments) UpdateScale(deploymentName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -136,3 +136,25 @@ func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*extensions.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(deploymentName string, options v1.GetOptions) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeDeployments) UpdateScale(deploymentName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}

View File

@ -136,3 +136,25 @@ func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*extensions.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &extensions.Scale{})
if obj == nil {
return nil, err
}
return obj.(*extensions.Scale), err
}

View File

@ -42,6 +42,9 @@ type ReplicaSetInterface interface {
List(opts v1.ListOptions) (*extensions.ReplicaSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error)
GetScale(replicaSetName string, options v1.GetOptions) (*extensions.Scale, error)
UpdateScale(replicaSetName string, scale *extensions.Scale) (*extensions.Scale, error)
ReplicaSetExpansion
}
@ -170,3 +173,31 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the replicaSet, and returns the corresponding extensions.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicaSets) UpdateScale(replicaSetName string, scale *extensions.Scale) (result *extensions.Scale, err error) {
result = &extensions.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -77,6 +77,8 @@ type Scale struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// StatefulSet represents a set of pods with consistent identities.

View File

@ -2951,6 +2951,8 @@ type ReplicationControllerCondition struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/extensions/v1beta1.Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/extensions/v1beta1.Scale,result=k8s.io/api/extensions/v1beta1.Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ReplicationController represents the configuration of a replication controller.

View File

@ -158,6 +158,8 @@ type ThirdPartyResourceData struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Deployment enables declarative updates for Pods and ReplicaSets.
@ -764,6 +766,8 @@ type IngressBackend struct {
}
// +genclient
// +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ReplicaSet represents the configuration of a ReplicaSet.

View File

@ -136,3 +136,25 @@ func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, s
}
return obj.(*v1beta2.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &v1beta2.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeStatefulSets) UpdateScale(statefulSetName string, scale *v1beta2.Scale) (result *v1beta2.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &v1beta2.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Scale), err
}

View File

@ -42,6 +42,9 @@ type StatefulSetInterface interface {
List(opts v1.ListOptions) (*v1beta2.StatefulSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.StatefulSet, err error)
GetScale(statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error)
UpdateScale(statefulSetName string, scale *v1beta2.Scale) (*v1beta2.Scale, error)
StatefulSetExpansion
}
@ -170,3 +173,31 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
Into(result)
return
}
// GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any.
func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
result = &v1beta2.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *statefulSets) UpdateScale(statefulSetName string, scale *v1beta2.Scale) (result *v1beta2.Scale, err error) {
result = &v1beta2.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -18,6 +18,7 @@ package fake
import (
core_v1 "k8s.io/api/core/v1"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -136,3 +137,25 @@ func (c *FakeReplicationControllers) Patch(name string, pt types.PatchType, data
}
return obj.(*core_v1.ReplicationController), err
}
// GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicationControllers) GetScale(replicationControllerName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicationcontrollersResource, c.ns, "scale", replicationControllerName), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicationControllers) UpdateScale(replicationControllerName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "scale", c.ns, scale), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}

View File

@ -18,6 +18,7 @@ package v1
import (
v1 "k8s.io/api/core/v1"
v1beta1 "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
@ -42,6 +43,9 @@ type ReplicationControllerInterface interface {
List(opts meta_v1.ListOptions) (*v1.ReplicationControllerList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error)
GetScale(replicationControllerName string, options meta_v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(replicationControllerName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
ReplicationControllerExpansion
}
@ -170,3 +174,31 @@ func (c *replicationControllers) Patch(name string, pt types.PatchType, data []b
Into(result)
return
}
// GetScale takes name of the replicationController, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *replicationControllers) GetScale(replicationControllerName string, options meta_v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicationcontrollers").
Name(replicationControllerName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicationControllers) UpdateScale(replicationControllerName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicationcontrollers").
Name(replicationControllerName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -42,6 +42,9 @@ type DeploymentInterface interface {
List(opts v1.ListOptions) (*v1beta1.DeploymentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error)
GetScale(deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(deploymentName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
DeploymentExpansion
}
@ -170,3 +173,31 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}

View File

@ -136,3 +136,25 @@ func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*v1beta1.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeDeployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}

View File

@ -136,3 +136,25 @@ func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, su
}
return obj.(*v1beta1.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Scale), err
}

View File

@ -42,6 +42,9 @@ type ReplicaSetInterface interface {
List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error)
GetScale(replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(replicaSetName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
ReplicaSetExpansion
}
@ -170,3 +173,31 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
Into(result)
return
}
// GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}