Updating EndpointSliceMirroring controller to wait for cache to be updated

This matches the recent updates to the EndpointSliceTracker for the
EndpointSlice controller in #99345 that accomplished the same thing.
This commit is contained in:
Rob Scott
2021-03-03 19:41:54 -08:00
parent 4f9317596c
commit 06db357e06
6 changed files with 381 additions and 173 deletions

View File

@@ -172,13 +172,13 @@ func newClientset() *fake.Clientset {
endpointSlice.ObjectMeta.Name = fmt.Sprintf("%s-%s", endpointSlice.ObjectMeta.GenerateName, rand.String(8))
endpointSlice.ObjectMeta.GenerateName = ""
}
endpointSlice.ObjectMeta.ResourceVersion = "100"
endpointSlice.ObjectMeta.Generation = 1
return false, endpointSlice, nil
}))
client.PrependReactor("update", "endpointslices", k8stesting.ReactionFunc(func(action k8stesting.Action) (bool, runtime.Object, error) {
endpointSlice := action.(k8stesting.CreateAction).GetObject().(*discovery.EndpointSlice)
endpointSlice.ObjectMeta.ResourceVersion = "200"
endpointSlice.ObjectMeta.Generation++
return false, endpointSlice, nil
}))