Coder Social home page Coder Social logo

Comments (7)

pwittrock avatar pwittrock commented on July 25, 2024

Interesting. Adding some documentation seems like a good workaround for now. We should try to decouple initializing the storage from the type definitions so that every client doesn't exercise this logic.

from apiserver-builder-alpha.

pwittrock avatar pwittrock commented on July 25, 2024

@ibazhitov You interested in filing a PR?

from apiserver-builder-alpha.

ibazhitov avatar ibazhitov commented on July 25, 2024

OK, I'll create a PR with changes in the documentation.

from apiserver-builder-alpha.

ibazhitov avatar ibazhitov commented on July 25, 2024

We should try to decouple initializing the storage from the type definitions so that every client doesn't exercise this logic.

I'll check whether this is possible.

from apiserver-builder-alpha.

ibazhitov avatar ibazhitov commented on July 25, 2024

On the first glance, replacing a direct call to NewXxxREST() in v1/zz_generated.api.register.go with a function pointer would do the trick.
Also, there's a mention of some mysterious RESTFunc in the definition of versionedResourceBuilder:

	// Store is used to modify the default storage, mutually exclusive with RESTFunc
	StorageBuilder StorageBuilder

	// REST a rest.Store implementation, mutually exclusive with StoreFunc
	REST rest.Storage

I haven't found other mentions of RESTFunc in git history though. Maybe there was some plan to actually replace rest.Storage with RESTFunc in versionedResourceBuilder?

from apiserver-builder-alpha.

ibazhitov avatar ibazhitov commented on July 25, 2024

Tested this approach with #97, looks like it works.

from apiserver-builder-alpha.

ibazhitov avatar ibazhitov commented on July 25, 2024

Ugh, I should have closed #96 before submitting #97, sorry.
Now we have both bug fix and the workaround in the documentation merged.
@pwittrock, could you please revert #96 since we no longer need a workaround?

from apiserver-builder-alpha.

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.