Skip to content

Commit

Permalink
Edit arguments given to run new upgraded subctl
Browse files Browse the repository at this point in the history
os.Args[1:] dropped prefix `subctl` so when upgrade is run using
upgraded subctl, `upgrade` is considered as the new parent command and
hencce complains about the `--to-version` validity.

This PR drops the arg slicing.

Closes: #962

Signed-off-by: Janki Chhatbar <[email protected]>
  • Loading branch information
Jaanki committed Oct 9, 2023
1 parent 769aad7 commit a1c68d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/subctl/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func upgrade(_ *cobra.Command, _ []string) {
// Step 2a: subctl was upgraded, so run it instead of continuing
cmd := exec.Cmd{
Path: command,
Args: os.Args[1:],
Args: os.Args,
Stdin: os.Stdin,
Stdout: os.Stdout,
Stderr: os.Stderr,
Expand Down

0 comments on commit a1c68d5

Please sign in to comment.