mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
kubectl: fix the bug that kubectl scale does not honor --timeout flag
Signed-off-by: SataQiu <1527062125@qq.com>
This commit is contained in:
@@ -62,10 +62,6 @@ var (
|
|||||||
kubectl scale --replicas=3 statefulset/web`))
|
kubectl scale --replicas=3 statefulset/web`))
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
timeout = 5 * time.Minute
|
|
||||||
)
|
|
||||||
|
|
||||||
type ScaleOptions struct {
|
type ScaleOptions struct {
|
||||||
FilenameOptions resource.FilenameOptions
|
FilenameOptions resource.FilenameOptions
|
||||||
RecordFlags *genericclioptions.RecordFlags
|
RecordFlags *genericclioptions.RecordFlags
|
||||||
@@ -234,7 +230,7 @@ func (o *ScaleOptions) RunScale() error {
|
|||||||
|
|
||||||
var waitForReplicas *scale.RetryParams
|
var waitForReplicas *scale.RetryParams
|
||||||
if o.Timeout != 0 && o.dryRunStrategy == cmdutil.DryRunNone {
|
if o.Timeout != 0 && o.dryRunStrategy == cmdutil.DryRunNone {
|
||||||
waitForReplicas = scale.NewRetryParams(1*time.Second, timeout)
|
waitForReplicas = scale.NewRetryParams(1*time.Second, o.Timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
counter := 0
|
counter := 0
|
||||||
|
Reference in New Issue
Block a user