• Ihar Hrachyshka's avatar
    Expose object tracker for fake clientsets · d68cd8a0
    Ihar Hrachyshka authored
    Not every object kind can be registered via tracker .Add() called as
    part of SimpleClientset initialization. This is because .Add() relies
    on UnsafeGuessKindToResource to convert object kinds into resource
    type names, which is broken for some resources. An example of an
    affected kind is NetworkAttachmentDefinitions CRD that uses
    network-attachment-definitions as its resource type name. When
    UnsafeGuessKindToResource is called for this kind, it returns
    networkattachmentdefinitions (without dashes).
    
    As per the comment inside .Add, kinds affected by
    UnsafeGuessKindToResource deficiencies should instead register objects
    using tracker .Create() method.  Problem is, current SimpleClientset
    struct definition doesn't expose the object tracker in any way, which
    makes it impossible to properly register these kinds at all.
    
    To address the issue, this change modifies the definition of
    SimpleClientset struct to expose the object tracker used via Tracker()
    method.
    d68cd8a0
Name
Last commit
Last update
..
clientset_generated Loading commit data...
conditions Loading commit data...
leaderelectionconfig Loading commit data...
metrics Loading commit data...
testdata Loading commit data...
tests Loading commit data...
OWNERS Loading commit data...