mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
kubectl scale: proceed even if there is invalid resource in multi
This commit is contained in:
parent
76ee3788cc
commit
b84f192acc
@ -211,10 +211,11 @@ func (o *ScaleOptions) RunScale() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
infos, err := r.Infos()
|
// We don't immediately return infoErr if it is not nil.
|
||||||
if err != nil {
|
// Because we want to proceed for other valid resources and
|
||||||
return err
|
// at the end of the function, we'll return this
|
||||||
}
|
// to show invalid resources to the user.
|
||||||
|
infos, infoErr := r.Infos()
|
||||||
|
|
||||||
if len(o.ResourceVersion) != 0 && len(infos) > 1 {
|
if len(o.ResourceVersion) != 0 && len(infos) > 1 {
|
||||||
return fmt.Errorf("cannot use --resource-version with multiple resources")
|
return fmt.Errorf("cannot use --resource-version with multiple resources")
|
||||||
@ -270,7 +271,7 @@ func (o *ScaleOptions) RunScale() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return infoErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func scaler(f cmdutil.Factory) (scale.Scaler, error) {
|
func scaler(f cmdutil.Factory) (scale.Scaler, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user