Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default value for keyName in aws-s3-sink.kamelet.yaml #919

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions kamelets/aws-s3-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ spec:

When using a default Credentials Provider the S3 client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.

The Kamelet can use the following header to be set:
The Kamelet can use the following headers to be set to:

- `file` / `ce-file`: as the file name to upload
- `file` / `ce-file`: as the file name to be uploaded

If the header won't be set, the Kamelet parameter `keyName` should be populated. The `keyName` parameter could be a simple value language from the Apache Camel.
If neither of those headers are set and the Kamelet parameter `keyName` is not populated, then the default file name used will be the `exchange id`.
required:
- bucketNameOrArn
- region
Expand Down Expand Up @@ -121,6 +121,12 @@ spec:
- set-header:
name: CamelAwsS3Key
simple: "${header[ce-file]}"
- simple: "${properties:keyName:null} == 'null'"
steps:
- set-header:
name: CamelAwsS3Key
simple: "${exchangeId}"
# this can be simplified when https://issues.apache.org/jira/browse/CAMEL-18070 is resolved
- to:
uri: "aws2-s3:{{bucketNameOrArn}}"
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ spec:

When using a default Credentials Provider the S3 client will load the credentials through this provider and won't use the static credential. This is reason for not having the access key and secret key as mandatory parameter for this Kamelet.

The Kamelet can use the following header to be set:
The Kamelet can use the following headers to be set to:

- `file` / `ce-file`: as the file name to upload
- `file` / `ce-file`: as the file name to be uploaded

If the header won't be set, the Kamelet parameter `keyName` should be populated. The `keyName` parameter could be a simple value language from the Apache Camel.
If neither of those headers are set and the Kamelet parameter `keyName` is not populated, then the default file name used will be the `exchange id`.
required:
- bucketNameOrArn
- region
Expand Down Expand Up @@ -121,6 +121,12 @@ spec:
- set-header:
name: CamelAwsS3Key
simple: "${header[ce-file]}"
- simple: "${properties:keyName:null} == 'null'"
steps:
- set-header:
name: CamelAwsS3Key
simple: "${exchangeId}"
# this can be simplified when https://issues.apache.org/jira/browse/CAMEL-18070 is resolved
- to:
uri: "aws2-s3:{{bucketNameOrArn}}"
parameters:
Expand Down