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 11, 2023
1 parent b9c4ecd commit df6fb82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/upgrade-subctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
- name: Build new subctl
run: make cmd/bin/subctl

- name: Run upgrade command
run: cmd/bin/subctl upgrade
- name: Run upgrade command and check versions after upgrade
run: |
export KUBECONFIG=$(find $(git rev-parse --show-toplevel)/output/kubeconfigs/ -type f -printf %p:)
cmd/bin/subctl upgrade
cmd/bin/subctl version && cmd/bin/subctl show versions
- name: Run e2e tests
run: make e2e
Expand Down
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 df6fb82

Please sign in to comment.