-
Notifications
You must be signed in to change notification settings - Fork 163
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
Parse (expr) step to extract JSON/YAML file contents #3240
Comments
For the http step, we allowed expr-lang expressions to be used to extract stuff from the structured response body. I'm not 100% against exec'ing out to jq/yq, but reusing the approach the http step used seems like a nice starting point because it introduces no new binaries to the image and has the added benefit of being consistent with something we've already done. Unstructured data is a different story... Is there a specific use case for unstructured data being used in a promotion process? It might be worth tackling structured first and revisiting unstructured later. |
Great suggestion. I forgot that expr already has a very powerful way to extract data, and we have precedent with http. I like the idea of using that over I also agree we should try not to exec out to other binaries. Luckily, I think there would be a go library for all forms of parsing we would want to support. Let me check with some stake holders how important dealing with unstructured data is. |
I checked, and JSON/YAML seem to be the only need. So, I'm reducing the scope further to just support JSON/YAML files with expr extraction. |
Proposed Feature
It has been requested to extract a portion of a file's contents after cloning, so that the file's contents can be used in a subsequent step. e.g. something like a
parse-file
step.Motivation
This would allow Kargo to use git repository monitoring feature in a more powerful way. e.g. A user could configure Kargo to watch a single file in for changes, similar to how we watch a OCI/Helm/Git repo for changes, but then act on specific changes to that file, possibly even in a different repo.
We already have a copy step which is close to this and consider this a variation of the
copy
step.Suggested Implementation
Implementation will probably be similar to our
copy
step, which deals with files on disk.The big question would be how to extract information from a file. But we should be as good as:jq(not needed. use expr instead)yq(not needed. use expr instead)EDIT:
Expr
jq/yqshould be our choice for structured data.unstructured data may need grep/sed/awk-like syntax, but will be considered out of scope for this feature.
The text was updated successfully, but these errors were encountered: