nodeinfo: add boot id system information

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli 2015-03-23 12:30:45 -04:00
parent bf14cbf682
commit afbf401464
7 changed files with 26 additions and 2 deletions

View File

@ -971,6 +971,8 @@ type NodeSystemInfo struct {
MachineID string `json:"machineID"` MachineID string `json:"machineID"`
// SystemUUID is the system-uuid reported by the node // SystemUUID is the system-uuid reported by the node
SystemUUID string `json:"systemUUID"` 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. // NodeStatus is information about the current status of a node.

View File

@ -782,6 +782,8 @@ type NodeSystemInfo struct {
MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"` 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 is the system-uuid reported by the node
SystemUUID string `json:"systemUUID" description:"system uuid 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. // NodeStatus is information about the current status of a node.

View File

@ -783,6 +783,8 @@ type NodeSystemInfo struct {
MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"` 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 is the system-uuid reported by the node
SystemUUID string `json:"systemUUID" description:"system uuid 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. // NodeStatus is information about the current status of a node.

View File

@ -969,6 +969,8 @@ type NodeSystemInfo struct {
MachineID string `json:"machineID"` MachineID string `json:"machineID"`
// SystemUUID is the system-uuid reported by the node // SystemUUID is the system-uuid reported by the node
SystemUUID string `json:"systemUUID"` 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. // NodeStatus is information about the current status of a node.

View File

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

View File

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

View File

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