Fix an issue that a Pod's nominatedNodeName cannot be cleared when the nominated node is deleted

This commit is contained in:
Wei Huang
2020-06-03 17:33:58 -07:00
parent c18bc7e9f7
commit 369a9001c6
4 changed files with 93 additions and 8 deletions

View File

@@ -1455,7 +1455,7 @@ func TestUpdatePod(t *testing.T) {
expectedPatchDataPattern: `{"status":{"\$setElementOrder/conditions":\[{"type":"currentType"}],"conditions":\[{"lastProbeTime":"2020-05-13T01:01:01Z","message":"newMessage","reason":"newReason","type":"currentType"}]}}`,
},
{
name: "Should not make patch request if pod condition already exists and is identical and nominated node name is not set",
name: "Should make patch request if pod condition already exists and is identical but nominated node name is different",
currentPodConditions: []v1.PodCondition{
{
Type: "currentType",
@@ -1475,7 +1475,7 @@ func TestUpdatePod(t *testing.T) {
Message: "currentMessage",
},
currentNominatedNodeName: "node1",
expectedPatchRequests: 0,
expectedPatchRequests: 1,
},
{
name: "Should make patch request if pod condition already exists and is identical but nominated node name is set and different",