Skip to content

Commit

Permalink
Added Exec Sink Kamelet
Browse files Browse the repository at this point in the history
  • Loading branch information
oscerd authored and nicolaferraro committed Apr 20, 2021
1 parent 06a745b commit 3627dab
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions exec-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ spec:
title: Exec Sink
description: |-
Execute system commands
The Kamelet expects the following headers to be set:
- `args/ `ce-args`: as the args to be set on the executable.
If the header won't be set the executable will be run without arguments.
required:
- executable
- args
Expand All @@ -20,17 +26,23 @@ spec:
title: Executable command
description: The command to execute
type: string
args:
title: The arguments
description: Arguments to pass to the executables
type: string
flow:
from:
uri: kamelet:source
steps:
- choice:
when:
- simple: "${header[args]}"
steps:
- set-header:
name: CamelExecCommandArgs
simple: "${header[args]}"
- simple: "${header[ce-args]}"
steps:
- set-header:
name: CamelExecCommandArgs
simple: "${header[ce-args]}"
- to:
uri: "exec:{{executable}}"
parameters:
args: "{{args}}"
- set-body:
simple: "${body.stdout}"

0 comments on commit 3627dab

Please sign in to comment.