This repository was archived by the owner on Nov 5, 2024. It is now read-only.
Fix CE Extensions deletion#1390
Merged
Merged
Conversation
odacremolbap
approved these changes
Apr 11, 2023
Contributor
|
Hey @tzununbekov I'm trying to test this out while writing the docs for it. Looking at the merge date and the 1.24.4 release date, I was thinking this should be available in the patch. So I've updated my components version: % tmctl config get
context: triggermesh
schemaRegistry: https://registry.staging.triggermesh.io
triggermesh:
version: v1.24.4
broker:
version: v1.2.1
memory:
buffer-size: "100"
produce-timeout: 1s
docker:
timeout: 5sand wrote a transformation: context:
- operation: delete
paths:
- key: Extensions
- operation: add
paths:
- key: source
value: mycustomsourcevalueThe change to the "source" attribute is working, but I'm still seeing the extension. Curl into a CloudEvent source: curl "http://localhost:54590" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: mytype" \
-H "Ce-Source: curl.shell" \
-H "Ce-MyAttribute: my value" \
-H "Content-Type: application/json" \
-H "Ce-Id: 1234-abcd-x" \
-d '{"Hello":"world"}'output in watch: ☁️ cloudevents.Event
Context Attributes,
specversion: 1.0
type: mytype
source: curl.shell
id: 1234-abcd-x
time: 2023-05-12T10:02:57.795670629Z
datacontenttype: application/json
Extensions,
myattribute: my value
Data,
{
"Hello": "world"
}
☁️ cloudevents.Event
Context Attributes,
specversion: 1.0
type: triggermesh-transformation.output
source: mycustomsourcevalue
id: 1234-abcd-x
time: 2023-05-12T10:02:57.795670629Z
datacontenttype: application/json
Extensions,
myattribute: my value
Data,
{
"Hello": "world"
}Do you think I'm not using the right version of the JSON transformation with the fix in it? Here is the PR for the docs in parallel: triggermesh/docs#373 |
Member
Author
context:
- operation: delete
paths:
- key: ExtensionsI don't think this is a valid command. Try to delete the particular extension, not just "extensions". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CE Context transformation re-used the original context variable during the process, therefore deletion operation was ineffective because the end result still had all original keys.
Resolves #1386