Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 0b124e5

Browse files
πŸ› Fix use of extra-args for command & arguments in rig deploy (#1271)
1 parent 277ffb1 commit 0b124e5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

β€Žcmd/rig/cmd/capsule/deploy/deploy.goβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ func (c *Cmd) deploy(ctx context.Context, cmd *cobra.Command, args []string) err
191191
}
192192

193193
func (c *Cmd) getNewSpec(ctx context.Context, cmd *cobra.Command, args []string) (*platformv1.Capsule, error) {
194+
var extraArgs []string
195+
if cmd.ArgsLenAtDash() >= 0 {
196+
extraArgs = args[cmd.ArgsLenAtDash():]
197+
args = args[:cmd.ArgsLenAtDash()]
198+
}
199+
194200
if file != "" {
195201
if environmentVariables != nil ||
196202
removeEnvironmentVariables != nil ||
@@ -453,8 +459,7 @@ func (c *Cmd) getNewSpec(ctx context.Context, cmd *cobra.Command, args []string)
453459
}
454460

455461
// Command and arguments.
456-
if idx := cmd.ArgsLenAtDash(); idx >= 0 {
457-
extraArgs := args[idx:]
462+
if extraArgs != nil {
458463
if len(extraArgs) == 0 {
459464
spec.Spec.Command = ""
460465
spec.Spec.Args = nil

0 commit comments

Comments
Β (0)