[PR #5650] [MERGED] [client] Add health check flag to status command and expose daemon status in output #26356

Closed
opened 2026-08-05 07:07:13 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5650
Author: @lixmal
Created: 3/22/2026
Status: Merged
Merged: 3/22/2026
Merged by: @mlsmaycon

Base: mainHead: feat/status-health-checks


📝 Commits (1)

  • 44f69f3 Add health check flag to status command and expose daemon status in output

📊 Changes

9 files changed (+197 additions, -76 deletions)

View changed files

📝 client/Dockerfile (+2 -2)
📝 client/Dockerfile-rootless (+2 -2)
📝 client/cmd/status.go (+101 -6)
📝 client/internal/debug/debug.go (+4 -2)
📝 client/netbird-entrypoint.sh (+33 -45)
📝 client/status/status.go (+40 -5)
📝 client/status/status_test.go (+7 -1)
📝 client/wasm/cmd/main.go (+1 -2)
📝 proxy/internal/debug/handler.go (+7 -11)

📄 Description

Describe your changes

  • Add --check flag to netbird status for container/orchestrator health probes (live, ready, startup)

  • Expose daemonStatus field in JSON/YAML output so structured output is returned for all daemon states, including auth-required states that previously only printed plain text

  • Introduce ConvertOptions struct to replace the 10 positional parameters in ConvertToStatusOutputOverview

  • Add ParseDaemonStatus to validate raw status strings against known constants instead of raw casting

  • Update Docker entrypoint to use status --check instead of log file parsing for startup detection

  • live and ready use lightweight status RPC (no full peer status), startup requests full status with fresh probes

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/665

Summary by CodeRabbit

  • New Features

    • Added --check flag to the status command to validate daemon health (liveness, readiness, and startup checks).
  • Improvements

    • Increased Docker container entrypoint service and login timeouts from 5 to 30 seconds for more reliable startup.
    • Refactored startup verification to use health checks instead of log file monitoring.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5650 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 3/22/2026 **Status:** ✅ Merged **Merged:** 3/22/2026 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `feat/status-health-checks` --- ### 📝 Commits (1) - [`44f69f3`](https://github.com/netbirdio/netbird/commit/44f69f351867c736e8564f1d9e4467580539a4a4) Add health check flag to status command and expose daemon status in output ### 📊 Changes **9 files changed** (+197 additions, -76 deletions) <details> <summary>View changed files</summary> 📝 `client/Dockerfile` (+2 -2) 📝 `client/Dockerfile-rootless` (+2 -2) 📝 `client/cmd/status.go` (+101 -6) 📝 `client/internal/debug/debug.go` (+4 -2) 📝 `client/netbird-entrypoint.sh` (+33 -45) 📝 `client/status/status.go` (+40 -5) 📝 `client/status/status_test.go` (+7 -1) 📝 `client/wasm/cmd/main.go` (+1 -2) 📝 `proxy/internal/debug/handler.go` (+7 -11) </details> ### 📄 Description ## Describe your changes - Add `--check` flag to `netbird status` for container/orchestrator health probes (live, ready, startup) - Expose `daemonStatus` field in JSON/YAML output so structured output is returned for all daemon states, including auth-required states that previously only printed plain text - Introduce `ConvertOptions` struct to replace the 10 positional parameters in `ConvertToStatusOutputOverview` - Add `ParseDaemonStatus` to validate raw status strings against known constants instead of raw casting - Update Docker entrypoint to use `status --check` instead of log file parsing for startup detection - `live` and `ready` use lightweight status RPC (no full peer status), `startup` requests full status with fresh probes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/665 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added `--check` flag to the status command to validate daemon health (liveness, readiness, and startup checks). * **Improvements** * Increased Docker container entrypoint service and login timeouts from 5 to 30 seconds for more reliable startup. * Refactored startup verification to use health checks instead of log file monitoring. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:07:13 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#26356