• Kubernetes Submit Queue's avatar
    Merge pull request #25526 from lavalamp/fix-generated-code · c73b96d6
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Fix code generators-- make scheme building composable
    
    I needed to make some changes to make my other refactoring possible and this got rather large. 
    
    We now provide a "SchemeBuilder" to help all of the api packages provide their scheme-building functions (addKnownTypes and friends) in a standardized way. This also allows generated deepcopies & conversions to be entirely self contained, the project will now build without them being present (as they can add themselves to the SchemeBuilder). (Although if you actually build without them, you will get reduced performance!)
    
    Previously, there was no way to construct your own runtime.Scheme (e.g., to test), you had to use the api.Scheme object, which has all sorts of non-hermetic cruft in it. Now you can get everything from a package by calling the scheme builder's AddToScheme, including the generated functions, if they are present.
    
    Next steps are to allow for declaring dependencies, and to standardize the registration & install code. (#25434)
    
    <!-- Reviewable:start -->
    ---
    This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/25526)
    <!-- Reviewable:end -->
    c73b96d6
Name
Last commit
Last update
..
cmd/kube-scheduler Loading commit data...
pkg Loading commit data...
OWNERS Loading commit data...