Repository navigation
validate empty sentinel file path in NewFileRebootChecker - #1372
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request improves robustness of the file-based reboot sentinel checker by validating the sentinel file path early, preventing silent misconfiguration when an empty/blank --reboot-sentinel value is provided.
Changes:
- Add upfront validation in
NewFileRebootCheckerto reject empty/blank file paths. - Remove the outdated TODO now that validation exists.
- Add a unit test covering empty/blank input and a valid path case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/checkers/checker.go | Adds input validation to NewFileRebootChecker to prevent empty/blank sentinel paths. |
| pkg/checkers/checker_test.go | Adds a unit test verifying error behavior for empty/blank paths and success for a valid path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
evrardjp
left a comment
There was a problem hiding this comment.
let's follow copilot suggestion
|
Done, trimming once and storing the trimmed path now. |
|
This PR was automatically considered stale due to lack of activity. Please refresh it and/or join our slack channels to highlight it, before it automatically closes (in 7 days). |
|
@evrardjp the trim change is in, |
|
I have to put that into the context of the other changes, but yeah I will work on it when I can. Thanks for your contribution. |
|
@Ahmad-Faraj we generally request for commits to be signed for your user (you can use git gpg/ssh signing, and adding those keys into your github user). This (kinda, as you could share private keys, but that's another topic) makes sure it's not someone else developing it for you (legal reasons). If you can't I will find a solution, but this is not my favorite path. |
Signed-off-by: Ahmad-Faraj <ahmedfrag4040@gmail.com>
Signed-off-by: Ahmad Faraj <ahmedfrag4040@gmail.com>
5527c78 to
a59adf3
Compare
|
@evrardjp Signed now. Rebased on |
NewFileRebootChecker already returns an error but never actually used it. if you pass an empty --reboot-sentinel the checker just stats "" forever and silently never reports a reboot, which is annoying to debug.
so this rejects an empty/blank path up front instead. dropped the old TODO and added a small test.