mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-23 10:32:03 +00:00
DaemonController doesn't take any actions when being deleted.
This commit is contained in:
parent
629f3c159e
commit
d8958257c4
@ -661,7 +661,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dsNeedsSync := dsc.expectations.SatisfiedExpectations(dsKey)
|
dsNeedsSync := dsc.expectations.SatisfiedExpectations(dsKey)
|
||||||
if dsNeedsSync {
|
if dsNeedsSync && ds.DeletionTimestamp == nil {
|
||||||
dsc.manage(ds)
|
dsc.manage(ds)
|
||||||
}
|
}
|
||||||
|
|
@ -289,6 +289,24 @@ func TestSufficentCapacityNodeDaemonLaunchesPod(t *testing.T) {
|
|||||||
syncAndValidateDaemonSets(t, manager, ds, podControl, 1, 0)
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DaemonSets not take any actions when being deleted
|
||||||
|
func TestDontDoAnythingIfBeingDeleted(t *testing.T) {
|
||||||
|
podSpec := resourcePodSpec("not-too-much-mem", "75M", "75m")
|
||||||
|
manager, podControl := newTestController()
|
||||||
|
node := newNode("not-too-much-mem", nil)
|
||||||
|
node.Status.Allocatable = allocatableResources("200M", "200m")
|
||||||
|
manager.nodeStore.Add(node)
|
||||||
|
manager.podStore.Add(&api.Pod{
|
||||||
|
Spec: podSpec,
|
||||||
|
})
|
||||||
|
ds := newDaemonSet("foo")
|
||||||
|
ds.Spec.Template.Spec = podSpec
|
||||||
|
now := unversioned.Now()
|
||||||
|
ds.DeletionTimestamp = &now
|
||||||
|
manager.dsStore.Add(ds)
|
||||||
|
syncAndValidateDaemonSets(t, manager, ds, podControl, 0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
// DaemonSets should not place onto nodes that would cause port conflicts
|
// DaemonSets should not place onto nodes that would cause port conflicts
|
||||||
func TestPortConflictNodeDaemonDoesNotLaunchPod(t *testing.T) {
|
func TestPortConflictNodeDaemonDoesNotLaunchPod(t *testing.T) {
|
||||||
podSpec := api.PodSpec{
|
podSpec := api.PodSpec{
|
Loading…
Reference in New Issue
Block a user