mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
nodeinfo: add boot id system information
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
parent
bf14cbf682
commit
afbf401464
@ -971,6 +971,8 @@ type NodeSystemInfo struct {
|
||||
MachineID string `json:"machineID"`
|
||||
// SystemUUID is the system-uuid reported by the node
|
||||
SystemUUID string `json:"systemUUID"`
|
||||
// BootID is the boot-id reported by the node
|
||||
BootID string `json:"bootID"`
|
||||
}
|
||||
|
||||
// NodeStatus is information about the current status of a node.
|
||||
|
@ -782,6 +782,8 @@ type NodeSystemInfo struct {
|
||||
MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"`
|
||||
// SystemUUID is the system-uuid reported by the node
|
||||
SystemUUID string `json:"systemUUID" description:"system uuid is the system-uuid reported by the node"`
|
||||
// BootID is the boot-id reported by the node
|
||||
BootID string `json:"bootID" description:"boot id is the boot-id reported by the node"`
|
||||
}
|
||||
|
||||
// NodeStatus is information about the current status of a node.
|
||||
|
@ -783,6 +783,8 @@ type NodeSystemInfo struct {
|
||||
MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"`
|
||||
// SystemUUID is the system-uuid reported by the node
|
||||
SystemUUID string `json:"systemUUID" description:"system uuid is the system-uuid reported by the node"`
|
||||
// BootID is the boot-id reported by the node
|
||||
BootID string `json:"bootID" description:"boot id is the boot-id reported by the node"`
|
||||
}
|
||||
|
||||
// NodeStatus is information about the current status of a node.
|
||||
|
@ -969,6 +969,8 @@ type NodeSystemInfo struct {
|
||||
MachineID string `json:"machineID"`
|
||||
// SystemUUID is the system-uuid reported by the node
|
||||
SystemUUID string `json:"systemUUID"`
|
||||
// BootID is the boot-id reported by the node
|
||||
BootID string `json:"bootID" description:"boot id is the boot-id reported by the node"`
|
||||
}
|
||||
|
||||
// NodeStatus is information about the current status of a node.
|
||||
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user