Skip to content

Provide more complex examples in template for accessing XR data #48

@davejhahn

Description

@davejhahn

What problem are you facing?

When working with data provided in the XR, from my perspective, it is going to be more complicated than simple strings or an array of strings. Those are the two examples included in the template.

What I am struggling with, and I'll admit part of the struggle is that I am just not very familiar with Go, Python was my first choice, but I couldn't get it to build, and after seeing the provider type integration with Go I changed my mind.

An example:

containers:
  - name: test1
     containerAccessType: Private
  - name: test2
    containerAccessType: Private

I just want to be able to access for the example above, "spec.containers", get an array of something, and be able to iterate over a list and have access to the underlying data.

I spent a bit of time looking at the request returned from GetObservedCompositeResource, e.g. GetString, GetStringObject, GetList, GetValue, etc... and I didn't really find anything that was what the intended way of doing this was because as far as I can find it isn't documented and it isn't in the example template. So I went off several directions, ultimately didn't get to what I had hoped, so still kind of not sure of the best approach, but I have to assume I am missing something, it can't be that hard.

So, given the likelihood of just a simple string array or string value not being something that will scale to anything useful, a decent example of more complex data I think would be extremely valuable.

The ask is for either a V2 template or an improved one with more robust capabilities. Also, if anyone has some pointers as to what approach I would use that aligns with the intended use for functions would be create (citing above example above).

Thanks!

How could this Function help solve your problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions