• k8s-merge-robot's avatar
    Merge pull request #26680 from olegshaldybin/fake-clientset-registry · 7f3da674
    k8s-merge-robot authored
    Automatic merge from submit-queue
    
    Track object modifications in fake clientset
    
    Fake clientset is used by unit tests extensively but it has some
    shortcomings:
    
    - no filtering on namespace and name: tests that want to test objects in
      multiple namespaces end up getting all objects from this clientset,
      as it doesn't perform any filtering based on name and namespace;
    
    - updates and deletes don't modify the clientset state, so some tests
      can get unexpected results if they modify/delete objects using the
      clientset;
    
    - it's possible to insert multiple objects with the same
      kind/name/namespace, this leads to confusing behavior, as retrieval is
      based on the insertion order, but anchors on the last added object as
      long as no more objects are added.
    
    This change changes core.ObjectRetriever implementation to track object
    adds, updates and deletes.
    
    Some unit tests were depending on the previous (and somewhat incorrect)
    behavior. These are fixed in the following few commits.
    7f3da674
Name
Last commit
Last update
..
apis Loading commit data...
client Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
manifests Loading commit data...
pkg Loading commit data...
registry/cluster Loading commit data...
OWNERS Loading commit data...