mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 20:54:08 +00:00
Remove PDB and its event handlers from the scheduler cache
This commit is contained in:
@@ -18,7 +18,6 @@ package testing
|
||||
|
||||
import (
|
||||
"k8s.io/api/core/v1"
|
||||
policy "k8s.io/api/policy/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
schedulercache "k8s.io/kubernetes/pkg/scheduler/cache"
|
||||
)
|
||||
@@ -79,20 +78,6 @@ func (f *FakeCache) UpdateNodeNameToInfoMap(infoMap map[string]*schedulercache.N
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddPDB is a fake method for testing.
|
||||
func (f *FakeCache) AddPDB(pdb *policy.PodDisruptionBudget) error { return nil }
|
||||
|
||||
// UpdatePDB is a fake method for testing.
|
||||
func (f *FakeCache) UpdatePDB(oldPDB, newPDB *policy.PodDisruptionBudget) error { return nil }
|
||||
|
||||
// RemovePDB is a fake method for testing.
|
||||
func (f *FakeCache) RemovePDB(pdb *policy.PodDisruptionBudget) error { return nil }
|
||||
|
||||
// ListPDBs is a fake method for testing.
|
||||
func (f *FakeCache) ListPDBs(selector labels.Selector) ([]*policy.PodDisruptionBudget, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// List is a fake method for testing.
|
||||
func (f *FakeCache) List(s labels.Selector) ([]*v1.Pod, error) { return nil, nil }
|
||||
|
||||
|
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
apps "k8s.io/api/apps/v1"
|
||||
"k8s.io/api/core/v1"
|
||||
policy "k8s.io/api/policy/v1beta1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
corelisters "k8s.io/client-go/listers/core/v1"
|
||||
@@ -214,3 +215,11 @@ func (f *fakePersistentVolumeClaimNamespaceLister) Get(name string) (*v1.Persist
|
||||
func (f fakePersistentVolumeClaimNamespaceLister) List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error) {
|
||||
return nil, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
// FakePDBLister implements PDBLister on a slice of PodDisruptionBudgets for test purposes.
|
||||
type FakePDBLister []*policy.PodDisruptionBudget
|
||||
|
||||
// List returns a list of PodDisruptionBudgets.
|
||||
func (f FakePDBLister) List(labels.Selector) ([]*policy.PodDisruptionBudget, error) {
|
||||
return f, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user