mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
Update scale sub-resource to return the same error everywhere
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
This commit is contained in:
parent
dba9475d5b
commit
1fa995224a
@ -306,7 +306,7 @@ func (r *ScaleREST) Destroy() {
|
|||||||
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
||||||
obj, err := r.store.Get(ctx, name, options)
|
obj, err := r.store.Get(ctx, name, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.NewNotFound(apps.Resource("deployments/scale"), name)
|
return nil, err
|
||||||
}
|
}
|
||||||
deployment := obj.(*apps.Deployment)
|
deployment := obj.(*apps.Deployment)
|
||||||
scale, err := scaleFromDeployment(deployment)
|
scale, err := scaleFromDeployment(deployment)
|
||||||
|
@ -202,7 +202,7 @@ func (r *ScaleREST) Destroy() {
|
|||||||
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
||||||
obj, err := r.store.Get(ctx, name, options)
|
obj, err := r.store.Get(ctx, name, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.NewNotFound(apps.Resource("replicasets/scale"), name)
|
return nil, err
|
||||||
}
|
}
|
||||||
rs := obj.(*apps.ReplicaSet)
|
rs := obj.(*apps.ReplicaSet)
|
||||||
scale, err := scaleFromReplicaSet(rs)
|
scale, err := scaleFromReplicaSet(rs)
|
||||||
|
@ -190,7 +190,7 @@ func (r *ScaleREST) Destroy() {
|
|||||||
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
func (r *ScaleREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) {
|
||||||
obj, err := r.store.Get(ctx, name, options)
|
obj, err := r.store.Get(ctx, name, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.NewNotFound(autoscaling.Resource("replicationcontrollers/scale"), name)
|
return nil, err
|
||||||
}
|
}
|
||||||
rc := obj.(*api.ReplicationController)
|
rc := obj.(*api.ReplicationController)
|
||||||
return scaleFromRC(rc), nil
|
return scaleFromRC(rc), nil
|
||||||
|
Loading…
Reference in New Issue
Block a user