mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Handle overlapping deployments gracefully
1. When overlapping deployments are discovered, annotate them 2. Expose those overlapping annotations as warnings in kubectl describe 3. Only respect the earliest updated one (skip syncing all other overlapping deployments) 4. Use indexer instead of store for deployment lister
This commit is contained in:
@@ -81,7 +81,7 @@ func newFakeDisruptionController() (*DisruptionController, *pdbStates) {
|
||||
podLister: cache.StoreToPodLister{Indexer: cache.NewIndexer(controller.KeyFunc, cache.Indexers{})},
|
||||
rcLister: cache.StoreToReplicationControllerLister{Indexer: cache.NewIndexer(controller.KeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})},
|
||||
rsLister: cache.StoreToReplicaSetLister{Store: cache.NewStore(controller.KeyFunc)},
|
||||
dLister: cache.StoreToDeploymentLister{Store: cache.NewStore(controller.KeyFunc)},
|
||||
dLister: cache.StoreToDeploymentLister{Indexer: cache.NewIndexer(controller.KeyFunc, cache.Indexers{})},
|
||||
getUpdater: func() updater { return ps.Set },
|
||||
broadcaster: record.NewBroadcaster(),
|
||||
}
|
||||
@@ -442,7 +442,7 @@ func TestTwoControllers(t *testing.T) {
|
||||
|
||||
d, _ := newDeployment(t, 11)
|
||||
d.Spec.Selector = newSel(dLabels)
|
||||
add(t, dc.dLister.Store, d)
|
||||
add(t, dc.dLister.Indexer, d)
|
||||
dc.sync(pdbName)
|
||||
ps.VerifyPdbStatus(t, pdbName, true, 4, 4, 11)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user