actually validate semver in node controller rather than prefix checking

This commit is contained in:
Mike Danese
2015-12-03 14:01:16 -08:00
parent 2c49893733
commit f784be33ac
2 changed files with 44 additions and 2 deletions

View File

@@ -725,6 +725,20 @@ func TestCheckPod(t *testing.T) {
},
prune: true,
},
{
pod: api.Pod{
ObjectMeta: api.ObjectMeta{DeletionTimestamp: &unversioned.Time{}},
Spec: api.PodSpec{NodeName: "older"},
},
prune: true,
},
{
pod: api.Pod{
ObjectMeta: api.ObjectMeta{DeletionTimestamp: &unversioned.Time{}},
Spec: api.PodSpec{NodeName: "oldest"},
},
prune: true,
},
{
pod: api.Pod{
ObjectMeta: api.ObjectMeta{DeletionTimestamp: &unversioned.Time{}},
@@ -763,6 +777,26 @@ func TestCheckPod(t *testing.T) {
},
},
})
nc.nodeStore.Store.Add(&api.Node{
ObjectMeta: api.ObjectMeta{
Name: "older",
},
Status: api.NodeStatus{
NodeInfo: api.NodeSystemInfo{
KubeletVersion: "v0.21.4",
},
},
})
nc.nodeStore.Store.Add(&api.Node{
ObjectMeta: api.ObjectMeta{
Name: "oldest",
},
Status: api.NodeStatus{
NodeInfo: api.NodeSystemInfo{
KubeletVersion: "v0.19.3",
},
},
})
for i, tc := range tcs {
var deleteCalls int