mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #91858 from SataQiu/fix-kubectl-2020060603
kubectl: fix the bug that kubectl scale does not honor --timeout flag
This commit is contained in:
commit
7fc3d9771b
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user