Merge pull request #5818 from simon3z/boot-id

nodecontroller: record node reboot event
This commit is contained in:
David Oppenheimer
2015-03-25 13:50:21 -07:00
12 changed files with 62 additions and 17 deletions

View File

@@ -1922,6 +1922,7 @@ func (kl *Kubelet) tryUpdateNodeStatus() error {
} else {
node.Status.NodeInfo.MachineID = info.MachineID
node.Status.NodeInfo.SystemUUID = info.SystemUUID
node.Status.NodeInfo.BootID = info.BootID
node.Spec.Capacity = CapacityFromMachineInfo(info)
}

View File

@@ -3128,7 +3128,13 @@ func TestUpdateNewNodeStatus(t *testing.T) {
kubeClient.MinionsList = api.NodeList{Items: []api.Node{
{ObjectMeta: api.ObjectMeta{Name: "testnode"}},
}}
machineInfo := &cadvisorApi.MachineInfo{MachineID: "123", SystemUUID: "abc", NumCores: 2, MemoryCapacity: 1024}
machineInfo := &cadvisorApi.MachineInfo{
MachineID: "123",
SystemUUID: "abc",
BootID: "1b3",
NumCores: 2,
MemoryCapacity: 1024,
}
mockCadvisor.On("MachineInfo").Return(machineInfo, nil)
expectedNode := &api.Node{
ObjectMeta: api.ObjectMeta{Name: "testnode"},
@@ -3151,6 +3157,7 @@ func TestUpdateNewNodeStatus(t *testing.T) {
NodeInfo: api.NodeSystemInfo{
MachineID: "123",
SystemUUID: "abc",
BootID: "1b3",
},
},
}
@@ -3205,7 +3212,13 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
},
},
}}
machineInfo := &cadvisorApi.MachineInfo{MachineID: "123", SystemUUID: "abc", NumCores: 2, MemoryCapacity: 1024}
machineInfo := &cadvisorApi.MachineInfo{
MachineID: "123",
SystemUUID: "abc",
BootID: "1b3",
NumCores: 2,
MemoryCapacity: 1024,
}
mockCadvisor.On("MachineInfo").Return(machineInfo, nil)
expectedNode := &api.Node{
ObjectMeta: api.ObjectMeta{Name: "testnode"},
@@ -3228,6 +3241,7 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
NodeInfo: api.NodeSystemInfo{
MachineID: "123",
SystemUUID: "abc",
BootID: "1b3",
},
},
}

View File

@@ -341,6 +341,7 @@ func (s *Server) handleNodeInfoVersioned(w http.ResponseWriter, req *http.Reques
NodeSystemInfo: api.NodeSystemInfo{
MachineID: info.MachineID,
SystemUUID: info.SystemUUID,
BootID: info.BootID,
},
})