chore: add readme for agent local db to be persistent#232
Conversation
Signed-off-by: Amber Xue <ambermingxin@nvidia.com>
📝 WalkthroughWalkthroughChangesPersistent local state
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 26-29: Update the README state-storage documentation to describe
the non-root fallback path `$HOME/.fleetint/fleetint.state` when the agent
cannot use `/var/lib`. State that this directory, like `/var/lib/fleetint`, must
use persistent local storage across restarts, reboots, upgrades, and reinstalls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bb16a819-324a-42a9-9c97-e8aee6a9904f
📒 Files selected for processing (1)
README.md
| The agent stores its node identity, enrollment metadata, and retained metrics and | ||
| events in `/var/lib/fleetint/fleetint.state` by default. The | ||
| `/var/lib/fleetint` directory must use persistent local storage that survives | ||
| agent and host restarts, reboots, upgrades, and reinstalls. |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Document the non-root default state path.
internal/config/default.go:120-175 falls back to $HOME/.fleetint/fleetint.state when the agent is not running as root or /var/lib is unavailable. As written, operators may persist the wrong directory and lose identity/credentials across restarts or redeployments.
Proposed wording
-The agent stores its node identity, enrollment metadata, and retained metrics and
-events in `/var/lib/fleetint/fleetint.state` by default.
+When running as root with `/var/lib` available, the agent stores its node
+identity, enrollment metadata, and retained metrics and events in
+`/var/lib/fleetint/fleetint.state`. Otherwise, the default is
+`$HOME/.fleetint/fleetint.state`. Persist the path selected for the deployment.Also applies to: 34-35
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 26 - 29, Update the README state-storage
documentation to describe the non-root fallback path
`$HOME/.fleetint/fleetint.state` when the agent cannot use `/var/lib`. State
that this directory, like `/var/lib/fleetint`, must use persistent local storage
across restarts, reboots, upgrades, and reinstalls.
Description
Checklist
Summary by CodeRabbit