Skip to content

Add show boot command implementation#209

Merged
Deepak-Pandey merged 7 commits intoAzure:kubesonicfrom
Deepak-Pandey:deepakpandey/add_show_boot
May 4, 2026
Merged

Add show boot command implementation#209
Deepak-Pandey merged 7 commits intoAzure:kubesonicfrom
Deepak-Pandey:deepakpandey/add_show_boot

Conversation

@Deepak-Pandey
Copy link
Copy Markdown

@Deepak-Pandey Deepak-Pandey commented Apr 25, 2026

MS ADO: 37689797

Why I did it

Added gNMI getter for show boot so client can fetch platform information via gNMI in JSON format.

How I did it

Wrote function DetectBootLoader() which detects aboot, grub or uboot. then based on that specific class functions are called to fetch current, next, available images.

had to mount /host to telemetry container for this to work.

How to verify it

Did not find any device with boot type as uboot. Tests are for grub and aboot

admin@<machine>:~$ show boot
Current: SONiC-OS-20251110.22
Next: SONiC-OS-20251110.22
Available:
SONiC-OS-20251110.22
root@<machine>:/# gnmi_get -xpath_target SHOW -xpath boot -target_addr <ip> -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "boot"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1777036735937644057
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "boot"
      >
    >
    val: <
      json_ietf_val: "{\"current\":\"SONiC-OS-20251110.22\",\"next\":\"SONiC-OS-20251110.22\",\"available\":[\"SONiC-OS-20251110.22\"]}"
    >
  >
>

Output from mellanox device

root@<machine>:/# gnmi_get -xpath_target SHOW -xpath boot -target_addr <machine ip> -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "boot"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1777276457482800698
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "boot"
      >
    >
    val: <
      json_ietf_val: "{\"current\":\"SONiC-OS-20251110.23\",\"next\":\"SONiC-OS-20251110.23\",\"available\":[\"SONiC-OS-20251110.23\"]}"
    >
  >
>

Output from Arista 7060

root@<machine>:/# gnmi_get -xpath_target SHOW -xpath boot -target_addr <macine-ip> -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "boot"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1777356725684318376
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "boot"
      >
    >
    val: <
      json_ietf_val: "{\"current\":\"SONiC-OS-internal.161923156-b9c0b0d2b8\",\"next\":\"SONiC-OS-internal.161923156-b9c0b0d2b8\",\"available\":[\"SONiC-OS-internal.161923156-b9c0b0d2b8\"]}"
    >
  >
>

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Deepak-Pandey Deepak-Pandey marked this pull request as ready for review April 27, 2026 07:55
Comment thread show_client/helpers/boot_helpers/aboot.go Outdated
Comment thread show_client/helpers/boot_helpers/aboot.go Outdated
Comment thread show_client/helpers/boot_helpers/grub.go
Comment thread show_client/helpers/boot_helpers/uboot.go
@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread show_client/helpers/boot_helpers/aboot.go
@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Deepak-Pandey
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@Deepak-Pandey Deepak-Pandey merged commit 0a91e79 into Azure:kubesonic May 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants