mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-29 14:16:26 +00:00
daemonset: Remove unnecessary error returns in strategy code
The nodeShouldRunDaemonPod method does not need to return an error because there are no scenarios under which it fails. Remove the error return path for its direct calls as well.
This commit is contained in:
@@ -1983,7 +1983,6 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
|
||||
nodeUnschedulable bool
|
||||
ds *apps.DaemonSet
|
||||
shouldRun, shouldContinueRunning bool
|
||||
err error
|
||||
}{
|
||||
{
|
||||
predicateName: "ShouldRunDaemonPod",
|
||||
@@ -2262,7 +2261,7 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
|
||||
manager.podNodeIndex.Add(p)
|
||||
}
|
||||
c.ds.Spec.UpdateStrategy = *strategy
|
||||
shouldRun, shouldContinueRunning, err := manager.nodeShouldRunDaemonPod(node, c.ds)
|
||||
shouldRun, shouldContinueRunning := manager.nodeShouldRunDaemonPod(node, c.ds)
|
||||
|
||||
if shouldRun != c.shouldRun {
|
||||
t.Errorf("[%v] strategy: %v, predicateName: %v expected shouldRun: %v, got: %v", i, c.ds.Spec.UpdateStrategy.Type, c.predicateName, c.shouldRun, shouldRun)
|
||||
@@ -2270,9 +2269,6 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
|
||||
if shouldContinueRunning != c.shouldContinueRunning {
|
||||
t.Errorf("[%v] strategy: %v, predicateName: %v expected shouldContinueRunning: %v, got: %v", i, c.ds.Spec.UpdateStrategy.Type, c.predicateName, c.shouldContinueRunning, shouldContinueRunning)
|
||||
}
|
||||
if err != c.err {
|
||||
t.Errorf("[%v] strategy: %v, predicateName: %v expected err: %v, got: %v", i, c.predicateName, c.ds.Spec.UpdateStrategy.Type, c.err, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user