Skip to content

[backport camel-4.18.x] CAMEL-24354: camel-aws2-lambda - updateFunction never sets the code source - #25353

Merged
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:fix/CAMEL-24354-4.18.x
Aug 5, 2026
Merged

[backport camel-4.18.x] CAMEL-24354: camel-aws2-lambda - updateFunction never sets the code source#25353
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:fix/CAMEL-24354-4.18.x

Conversation

@oscerd

@oscerd oscerd commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Backport of #25343 to camel-4.18.x.

Lambda2Producer.updateFunction() validated that a body / S3 bucket / S3 key was present, then discarded them and built an UpdateFunctionCodeRequest with only functionName (+ optional publish). AWS UpdateFunctionCode requires a code source, so every call failed and the operation was unusable in the default (non-pojoRequest) mode. Now the code source (S3 bucket/key/object-version, ZIP_FILE header path, message body) is assembled on the request, mirroring createFunction. Also fixes the misleading deleteEventSourceMapping validation message (said "Arn" but validates the UUID).

Adds LambdaProducerTest.lambdaUpdateFunctionTest; full LambdaProducerTest green (32 tests) on this branch.

🤖 Generated with Claude Code

… so UpdateFunctionCode no longer fails

Lambda2Producer.updateFunction() built an UpdateFunctionCodeRequest that only
ever carried functionName and (optionally) publish: it validated that a body,
S3 bucket, or S3 key was present and then discarded them, never setting
zipFile/s3Bucket/s3Key/s3ObjectVersion. AWS UpdateFunctionCode requires a code
source, so every call failed with InvalidParameterValueException and the
operation was unusable in the default (non-pojoRequest) mode.

Assemble the code source on the request builder from the same headers/body as
createFunction (S3 bucket/key/object-version, the ZIP_FILE header path, and the
message body), and add a test asserting the request carries it.

Also corrects deleteEventSourceMapping's validation message, which read
"Event Source Arn must be specified" although it validates the event source
mapping UUID.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd
oscerd requested review from Croway and davsclaus August 5, 2026 08:24
@oscerd oscerd added the bug Something isn't working label Aug 5, 2026
@oscerd oscerd added this to the 4.18.4 milestone Aug 5, 2026
@oscerd
oscerd merged commit 17adac1 into apache:camel-4.18.x Aug 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants