mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +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
|
||||
}
|
||||
|
||||
infos, err := r.Infos()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// We don't immediately return infoErr if it is not nil.
|
||||
// Because we want to proceed for other valid resources and
|
||||
// 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 {
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user