diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 344b01b4..910a1ee3 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -372,299 +372,299 @@ }, { "ImportPath": "k8s.io/api/admissionregistration/v1alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/apps/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/apps/v1beta2", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/authentication/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/authentication/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/authorization/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/authorization/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/autoscaling/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/autoscaling/v2alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/batch/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/batch/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/batch/v2alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/certificates/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/core/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/extensions/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/imagepolicy/v1alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/networking/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/policy/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/rbac/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/rbac/v1alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/rbac/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/scheduling/v1alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/settings/v1alpha1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/storage/v1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/api/storage/v1beta1", - "Rev": "429a9e49c4fef512e68dc11e3ce5da5e79d88ffd" + "Rev": "b4c1dde74617eb5b4db9a7db95b75ecb8bf2b54f" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/errors", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/fields", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/cache", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/clock", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/intstr", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/version", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "f65a69e51385565c76e8ccb7730f96d4c4dd96a6" + "Rev": "f16ee4db044a21569fc95031aba96d08c5f28e7e" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index 65c7cdfd..bdff8330 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -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 +} diff --git a/kubernetes/typed/apps/v1beta2/statefulset.go b/kubernetes/typed/apps/v1beta2/statefulset.go index e42877aa..516587fa 100644 --- a/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/statefulset.go @@ -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 +} diff --git a/kubernetes/typed/core/v1/BUILD b/kubernetes/typed/core/v1/BUILD index 76b65f92..93c02b9e 100644 --- a/kubernetes/typed/core/v1/BUILD +++ b/kubernetes/typed/core/v1/BUILD @@ -35,6 +35,7 @@ go_library( ], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", diff --git a/kubernetes/typed/core/v1/fake/BUILD b/kubernetes/typed/core/v1/fake/BUILD index 8b292094..71e65a84 100644 --- a/kubernetes/typed/core/v1/fake/BUILD +++ b/kubernetes/typed/core/v1/fake/BUILD @@ -34,6 +34,7 @@ go_library( ], deps = [ "//vendor/k8s.io/api/core/v1:go_default_library", + "//vendor/k8s.io/api/extensions/v1beta1:go_default_library", "//vendor/k8s.io/api/policy/v1beta1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/fields:go_default_library", diff --git a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index b323622e..2fe0a6cf 100644 --- a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -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 +} diff --git a/kubernetes/typed/core/v1/replicationcontroller.go b/kubernetes/typed/core/v1/replicationcontroller.go index 5299ba9f..196c8d05 100644 --- a/kubernetes/typed/core/v1/replicationcontroller.go +++ b/kubernetes/typed/core/v1/replicationcontroller.go @@ -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 +} diff --git a/kubernetes/typed/extensions/v1beta1/deployment.go b/kubernetes/typed/extensions/v1beta1/deployment.go index 54de5c60..65f3820b 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/deployment.go @@ -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 +} diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index d35ffdb2..d5abace9 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -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 +} diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index 3de207f6..e8d22c6b 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -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 +} diff --git a/kubernetes/typed/extensions/v1beta1/replicaset.go b/kubernetes/typed/extensions/v1beta1/replicaset.go index 8107c2ca..8daa1cc0 100644 --- a/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -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 +} diff --git a/testing/actions.go b/testing/actions.go index 8633a81d..6f1c3a89 100644 --- a/testing/actions.go +++ b/testing/actions.go @@ -47,6 +47,17 @@ func NewGetAction(resource schema.GroupVersionResource, namespace, name string) return action } +func NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl { + action := GetActionImpl{} + action.Verb = "get" + action.Resource = resource + action.Subresource = subresource + action.Namespace = namespace + action.Name = name + + return action +} + func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts interface{}) ListActionImpl { action := ListActionImpl{} action.Verb = "list" @@ -70,6 +81,20 @@ func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersio return action } +func NewListSubresourceAction(resource schema.GroupVersionResource, name, subresource string, kind schema.GroupVersionKind, namespace string, opts interface{}) ListActionImpl { + action := ListActionImpl{} + action.Verb = "list" + action.Resource = resource + action.Subresource = subresource + action.Kind = kind + action.Namespace = namespace + action.Name = name + labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) + action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} + + return action +} + func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" @@ -89,6 +114,18 @@ func NewCreateAction(resource schema.GroupVersionResource, namespace string, obj return action } +func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, namespace string, object runtime.Object) CreateActionImpl { + action := CreateActionImpl{} + action.Verb = "create" + action.Resource = resource + action.Subresource = subresource + action.Namespace = namespace + action.Name = name + action.Object = object + + return action +} + func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" @@ -389,6 +426,7 @@ func (a GetActionImpl) GetName() string { type ListActionImpl struct { ActionImpl Kind schema.GroupVersionKind + Name string ListRestrictions ListRestrictions } @@ -402,6 +440,7 @@ func (a ListActionImpl) GetListRestrictions() ListRestrictions { type CreateActionImpl struct { ActionImpl + Name string Object runtime.Object }