Skip to content

Commit

Permalink
πŸ› Fix use of extra-args for command & arguments in rig deploy (#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersjohnsen authored Oct 10, 2024
1 parent 277ffb1 commit 0b124e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/rig/cmd/capsule/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ func (c *Cmd) deploy(ctx context.Context, cmd *cobra.Command, args []string) err
}

func (c *Cmd) getNewSpec(ctx context.Context, cmd *cobra.Command, args []string) (*platformv1.Capsule, error) {
var extraArgs []string
if cmd.ArgsLenAtDash() >= 0 {
extraArgs = args[cmd.ArgsLenAtDash():]
args = args[:cmd.ArgsLenAtDash()]
}

if file != "" {
if environmentVariables != nil ||
removeEnvironmentVariables != nil ||
Expand Down Expand Up @@ -453,8 +459,7 @@ func (c *Cmd) getNewSpec(ctx context.Context, cmd *cobra.Command, args []string)
}

// Command and arguments.
if idx := cmd.ArgsLenAtDash(); idx >= 0 {
extraArgs := args[idx:]
if extraArgs != nil {
if len(extraArgs) == 0 {
spec.Spec.Command = ""
spec.Spec.Args = nil
Expand Down

0 comments on commit 0b124e5

Please sign in to comment.