Coder Social home page Coder Social logo

Comments (8)

shawn-hurley avatar shawn-hurley commented on May 26, 2024

I am interested in helping with this issue. I was wondering if you had thoughts on how to handle this already or if a design doc or something similar has been created?

from controller-runtime.

pwittrock avatar pwittrock commented on May 26, 2024

@shawn-hurley Not yet, though I think the interface shouldn't change, it should just accept unstructured objects. Would you be willing to put together a 1-2 page doc on the topic before getting started?

From a high level:

  • The client commands and controller.Watch / source. Kind should accept unstructured objects (they already do)
    • Unstructured objects must have the GVK specified in the object
    • client / source should work with the unstructured object the way they would with other runtime.Objects

One question is whether the cache should be shared between unstructured and hard-coded objects for the same GVK. As long as it is consistent and predictable I think either way is good.

from controller-runtime.

pwittrock avatar pwittrock commented on May 26, 2024

@shawn-hurley FWIW, this might already work. I think the first task is to try it and see if it works or not, then dig in deeper.

from controller-runtime.

shawn-hurley avatar shawn-hurley commented on May 26, 2024

@pwittrock I think that it would work with a single unstructured type, but if you used two then the client-cache: https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/client_cache.go#L79-L84 will overwrite the GVK for one fo the types.

Am I correct in that reading of the code?

I will work on getting an example to test this theory as well.

Thanks!

from controller-runtime.

DirectXMan12 avatar DirectXMan12 commented on May 26, 2024

aah, yeah, we probably would need a key that's like TypeOf(obj) unless IsUnstructured(obj) else SpecialUnstructuredKeyWithKind.

from controller-runtime.

DirectXMan12 avatar DirectXMan12 commented on May 26, 2024

or have a separate map for unstructured objects.

from controller-runtime.

shawn-hurley avatar shawn-hurley commented on May 26, 2024

@pwittrock @DirectXMan12 I am working on getting an example of using two different unstructured types to test this theory out and to have something to test with.

Which would you prefer the second map if the type is Unstructured or some other mechanism? I would think that two maps might make it more clear?

from controller-runtime.

DirectXMan12 avatar DirectXMan12 commented on May 26, 2024

Two maps is probably clearer.

from controller-runtime.

Related Issues (20)

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.