Skip to content

Commit

Permalink
fix unused operator init wait option. (#20306)
Browse files Browse the repository at this point in the history
* fix unused operator init wait option.

* fix test.
  • Loading branch information
Morven Cao authored and istio-testing committed Jan 20, 2020
1 parent cae8164 commit f729b5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 3 additions & 2 deletions operator/cmd/mesh/operator-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func addOperatorInitFlags(cmd *cobra.Command, args *operatorInitArgs) {
cmd.PersistentFlags().StringVarP(&args.inFilename, "filename", "f", "", filenameFlagHelpStr)
cmd.PersistentFlags().StringVarP(&args.kubeConfigPath, "kubeconfig", "c", "", "Path to kube config")
cmd.PersistentFlags().StringVar(&args.context, "context", "", "The name of the kubeconfig context to use")
cmd.PersistentFlags().DurationVar(&args.readinessTimeout, "readiness-timeout", 300*time.Second, "Maximum seconds to wait for all Istio resources to be ready."+
cmd.PersistentFlags().DurationVar(&args.readinessTimeout, "readiness-timeout", 300*time.Second, "Maximum seconds to wait for the Istio operator to be ready."+
" The --wait flag must be set for this flag to apply")
cmd.PersistentFlags().BoolVarP(&args.wait, "wait", "w", false, "Wait, if set will wait until all Pods, Services, and minimum number of Pods "+
"of a Deployment are in a ready state before the command exits. It will wait for a maximum duration of --readiness-timeout seconds")
Expand Down Expand Up @@ -134,7 +134,8 @@ func operatorInit(args *rootArgs, oiArgs *operatorInitArgs, l *Logger, apply man
opts := &kubectlcmd.Options{
DryRun: args.dryRun,
Verbose: args.verbose,
WaitTimeout: 1 * time.Minute,
Wait: oiArgs.wait,
WaitTimeout: oiArgs.readinessTimeout,
Kubeconfig: oiArgs.kubeConfigPath,
Context: oiArgs.context,
}
Expand Down
7 changes: 1 addition & 6 deletions operator/cmd/mesh/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"path/filepath"
"reflect"
"testing"
"time"

"github.com/kr/pretty"

Expand Down Expand Up @@ -75,11 +74,7 @@ func TestOperatorInit(t *testing.T) {
t.Fatalf("diff: %s", diff)
}

wantOpts := kubectlcmd.Options{
WaitTimeout: time.Minute,
Prune: nil,
ExtraArgs: nil,
}
wantOpts := kubectlcmd.Options{}

wantParams := []applyParams{
{
Expand Down

0 comments on commit f729b5a

Please sign in to comment.