Comments (9)
This looks like a bug, thank you for reporting this @ma-ble. I will work out a fix for this
e:
upon looking at this again i think this is mostly a bug around formatting the multiple keys that are pulled from fieldpath into the tag injection, ill need to ask the cue community about this more
from function-cue-archived.
A workaround would be specifying multiple tags to inject each individual key
from function-cue-archived.
You should also not be specifying that this spec.test
would be converting to a string
within cue, i believe there is a way to have it convert into a cue object thats defined like
#input: {
key1: string
key2: string
karray: [...String]
key3: int
}
#env: #input @tag("test")
Im not certain if that works copy pasta'd
from function-cue-archived.
Thank you very much for the quick reply.
In my specific use case, I would like to copy all fields under spec.test into the managed resource. The number of fields is very large and I did not want to have any dependencies on individual fields in the composition in this case. This would only make it unnecessarily bloated and confusing.
Otherwise, you are of course right that you can simply list each individual field in the composition (CUEInport value) as a workaround.
from function-cue-archived.
I have created a new issue #82 that I think is a better solution to this problem. It seems problematic to have to try to convert nested fields into appropriate tag injections and the solution proposed in #82 I feel is a more crossplane native solution to this problem.
do you think this will work for you @ma-ble ?
from function-cue-archived.
In my opinion, the problems are slightly different, but essentially identical. In my case, I cannot outsource the data to an EnviornmentConfig, as this relates directly to a claim - but in both cases the processing of several fields via the cue functions is required.
from function-cue-archived.
I spoke with paul jolly at the cue project and we have figured out a way that we can do this with a single tag.
Since cue only allows for primitives to be injected, what we could do is take the field that is being injected, if it is an object (has nested fields), we can convert that object into a json strong. From there it will come in as json blob within cue, which the user can then from there the user can use cue's json.Marshal
. It is a bit cumbersome but it will give a single line entry for injecting + 1 more line for Marshaling
from function-cue-archived.
Great, do you have an example?
from function-cue-archived.
Unfortunately this repository is being deprecated and it is going to be merged with https://github.com/elastic/crossplane-function-cue, it is suggested that you move to this repository at your convenience. I have mentioned this functionality to paul before and perhaps we can bring this implementation over to the new repository as well
from function-cue-archived.
Related Issues (11)
- Identifiers do not work
- Migrate to cue.Context() HOT 2
- Support Readiness Checks and readiness propagation
- Use the `cue.fn.crossplane.io` API group? HOT 2
- Support non stdlib import packages HOT 1
- Push to xpkg.upbound.io? HOT 5
- Support #connectionDetail and #readinessCheck per document HOT 3
- Would `Export` make sense as the input kind? HOT 1
- Dependency Dashboard
- Convert Injected EnvironmentConfigs into CUE objects injected into the function run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from function-cue-archived.