Skip to content

Commit

Permalink
feat(client): add node kernel name info to GetNodeInfo payload (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
niladrih authored Nov 10, 2023
1 parent ec872cc commit 3988532
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/client/k8s/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,19 @@ func GetOSAndKernelVersion() (string, error) {
}

// GetNodeInfo gathers details from the first Kubernetes Node and returns -- OS, Kernel version and Arch.
func GetNodeInfo() (nodeOs, nodeKernelVersion, nodeArch string, err error) {
func GetNodeInfo() (nodeOs, nodeKernelName, nodeKernelVersion, nodeArch string, err error) {
nodes := Node()
firstNode, err := nodes.List(metav1.ListOptions{Limit: 1})
if err != nil {
return "unknown",
"unknown",
"unknown",
errors.Wrapf(err, "failed to get the os kernel/arch")
"unknown",
errors.Wrapf(err, "failed to get kubernetes Node os/kernel/arch")
}

nodeOs = firstNode.Items[0].Status.NodeInfo.OSImage
nodeKernelName = firstNode.Items[0].Status.NodeInfo.OperatingSystem
nodeKernelVersion = firstNode.Items[0].Status.NodeInfo.KernelVersion
nodeArch = firstNode.Items[0].Status.NodeInfo.Architecture

Expand Down

0 comments on commit 3988532

Please sign in to comment.