• 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
..
daemon Loading commit data...
deployment Loading commit data...
endpoint Loading commit data...
framework Loading commit data...
garbagecollector Loading commit data...
job Loading commit data...
namespace Loading commit data...
node Loading commit data...
persistentvolume Loading commit data...
petset Loading commit data...
podautoscaler Loading commit data...
podgc Loading commit data...
replicaset Loading commit data...
replication Loading commit data...
resourcequota Loading commit data...
route Loading commit data...
service Loading commit data...
serviceaccount Loading commit data...
volume Loading commit data...
OWNERS Loading commit data...
controller_utils.go Loading commit data...
controller_utils_test.go Loading commit data...
doc.go Loading commit data...
lookup_cache.go Loading commit data...