Giter Site home page Giter Site logo

Comments (9)

Mitsuwa avatar Mitsuwa commented on September 26, 2024 1

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.

Mitsuwa avatar Mitsuwa commented on September 26, 2024

A workaround would be specifying multiple tags to inject each individual key

from function-cue-archived.

Mitsuwa avatar Mitsuwa commented on September 26, 2024

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.

ma-ble avatar ma-ble commented on September 26, 2024

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.

Mitsuwa avatar Mitsuwa commented on September 26, 2024

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.

ma-ble avatar ma-ble commented on September 26, 2024

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.

Mitsuwa avatar Mitsuwa commented on September 26, 2024

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.

ma-ble avatar ma-ble commented on September 26, 2024

Great, do you have an example?

from function-cue-archived.

Mitsuwa avatar Mitsuwa commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.