Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcdctl/ctlv3: fix watch with exec commands, interactive mode flag parsing #9688

Merged
merged 4 commits into from
May 4, 2018

Commits on May 4, 2018

  1. etcdctl/ctlv3: fix watch with exec commands

    Following command was failing because the parser incorrectly
    picks up the second "watch" string in exec command, thus
    passing wrong exec commands.
    
    ```
    ETCDCTL_API=3 ./bin/etcdctl watch aaa -- echo watch event received
    
    panic: runtime error: slice bounds out of range
    
    goroutine 1 [running]:
    github.com/coreos/etcd/etcdctl/ctlv3/command.parseWatchArgs(0xc42002e080, 0x8, 0x8, 0xc420206a20, 0x5, 0x6, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/command/watch_command.go:303 +0xbed
    github.com/coreos/etcd/etcdctl/ctlv3/command.watchCommandFunc(0xc4202a7180, 0xc420206a20, 0x5, 0x6)
    	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/command/watch_command.go:73 +0x11d
    github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).execute(0xc4202a7180, 0xc420206960, 0x6, 0x6, 0xc4202a7180, 0xc420206960)
    	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
    github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1363de0, 0xc420128638, 0xc420185e01, 0xc420185ee8)
    	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:852 +0x30a
    github.com/coreos/etcd/vendor/github.com/spf13/cobra.(*Command).Execute(0x1363de0, 0x0, 0x0)
    	/home/gyuho/go/src/github.com/coreos/etcd/vendor/github.com/spf13/cobra/command.go:800 +0x2b
    github.com/coreos/etcd/etcdctl/ctlv3.Start()
    	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/ctlv3/ctl_nocov.go:25 +0x8e
    main.main()
    	/home/gyuho/go/src/github.com/coreos/etcd/etcdctl/main.go:40 +0x17b
    ```
    
    Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
    gyuho committed May 4, 2018
    Configuration menu
    Copy the full SHA
    44cda79 View commit details
    Browse the repository at this point in the history
  2. tests/e2e: separate coverage tests for exec commands

    Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
    gyuho committed May 4, 2018
    Configuration menu
    Copy the full SHA
    acf671a View commit details
    Browse the repository at this point in the history
  3. gitignore: add "*.coverprofile"

    Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
    gyuho committed May 4, 2018
    Configuration menu
    Copy the full SHA
    1102833 View commit details
    Browse the repository at this point in the history
  4. Makefile: add ".coverprofile" to "make clean"

    Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
    gyuho committed May 4, 2018
    Configuration menu
    Copy the full SHA
    38fcfb6 View commit details
    Browse the repository at this point in the history