Conversation
|
Welcome @yuminn-k! It looks like this is your first PR to knative/func 🎉 |
|
Hi @yuminn-k. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lkingland, yuminn-k The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Follow-ups from knative#3346: - Reject --extension names that are not [a-z0-9]+ as required by the CloudEvents spec, before the function is resolved or contacted. - Test the cloudevent-only guard for --extension, including the fallback to the func.yaml invoke format. - Assert extensions round-trip through sendEvent to the receiver. Signed-off-by: YuMin Kim <kim.yumin@nextbeat.net>
56d667c to
f312681
Compare
|
Rebased onto main after #4142 merged. Both added a test at the same spot in /lgtm |
Changes
Remaining follow-ups from the second-pass review on #3347, listed when #3346 was reopened. The dead branch, malformed
-e foo, and range iteration items were already handled in #3839, #3852 and #3913.func invoke --extensionnow rejects names that are not[a-z0-9]+, which the CloudEvents spec requires for attribute names. Before this change,-e my-ext=vonly failed after the function had been resolved, with the SDK's message wrapped asunable to invoke: ....-e MyExt=vwas lower-cased without warning. Both now fail early with a flag-specific error.--extension: withinvokeset in func.yaml, with the-fflag overriding it in both directions, and with the fallback tof.Invokewhen-fis not given.sendEvent, so the receiver getsmyext=myvalue. This extends the existingTestClient_Invoke_CloudEvent./kind bug
Fixes #3346
Testing
go test ./cmd/ ./pkg/functions/ -count=1andgo vet ./cmd/ ./pkg/functions/pass.TestInvokeExtensionsMapMalformed(hyphen, underscore, upper case) fail onmainand pass with this change.TestInvokeExtensionsRequireCloudEventfails if the guard is disabled (the http cases) or if thef.Invokefallback is removed (the func.yaml cloudevent case).TestClient_Invoke_CloudEventfails withexpected extension myext=myvalue, got <nil>if theSetExtensionloop insendEventis removed.Release Note
Docs
Assisted-by: Claude Opus 5.5 (Claude Code)