mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
nodeinfo: add boot id system information
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
@@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user