Skip to content

Commit

Permalink
feat(run): Allow application args overriding from CLI
Browse files Browse the repository at this point in the history
Passing arguments from the CLI directly overrides any
commands from the Kraftfile or Dockerfile. The first argument
of kraft run is the context and any subsequence argument
is considered an application argument.

Signed-off-by: Luca Seritan <[email protected]>
  • Loading branch information
LucaSeri committed Jun 2, 2024
1 parent 7bf661f commit c0b237a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cli/kraft/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ func (opts *RunOptions) Run(ctx context.Context, args []string) error {
machine.Spec.KernelArgs = opts.KernelArgs
}

if len(args) > 1 {
machine.Spec.ApplicationArgs = args[1:]
}

if len(opts.Memory) > 0 {
quantity, err := resource.ParseQuantity(opts.Memory)
if err != nil {
Expand Down

0 comments on commit c0b237a

Please sign in to comment.