fix(unikontainers): warn on vAccel misconfiguration#699
Conversation
✅ Deploy Preview for urunc canceled.
|
✅ Deploy Preview for urunc canceled.
|
|
Hello @Chennamma-Hotkar , please read the contribution guide |
|
Hi @cmainas, I added the contribution guide template to the PR description including the following things. A description of the files changed, how it was tested, LLM disclosure and a checklist. Please let me know if there are any other things that need to be fixed. |
|
Hello @Chennamma-Hotkar , you will also need to add yourself on https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml |
|
Hi @cmainas, I have included my name in |
bd5f83b to
1e044a8
Compare
|
Hello @Chennamma-Hotkar , can you rebase over main and remove the merge commit? |
Introduce ErrVAccelDisabled to distinguish missing vAccel config from actual misconfiguration. Log Warn instead of Debug on error. Fixes: urunc-dev#698 Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com>
Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com>
953b7a2 to
cfd4cdb
Compare
|
Hi @cmainas, I have rebased over main and removed the merge commit. |
cmainas
left a comment
There was a problem hiding this comment.
Thank you @Chennamma-Hotkar for the fix.
Introduce ErrVAccelDisabled to distinguish missing vAccel config from actual misconfiguration. Log Warn instead of Debug on error. PR: #699 Fixes: #698 Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
PR: #699 Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Introduce ErrVAccelDisabled to distinguish missing vAccel config from actual misconfiguration. Log Warn instead of Debug on error. PR: #699 Fixes: #698 Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
PR: #699 Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com> Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk> Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Description
When calling
resolveVAccelConfig()inpkg/unikontainers/unikontainers.go, we only print the error at DEBUG level. The function returns the same error type in 2 different cases:1) when vAccel is disabled and
2) when a bad configuration is detected (i.e. missing or bad RPCAddress).
Therefore the error is always ignored and the container launched in with no vAccel but with no warning of the situation.
The fix adds a sentinel error
ErrVAccelDisabledto treat the two cases differently. When vAccel is not configured, we expect an error and log it at Debug. When there is a genuine misconfiguration, we Warn so operators can see theissue without having to enable debug log level. Added unit tests for all four paths in
resolveVAccelConfig.Files changed:
pkg/unikontainers/vaccel.go— addedErrVAccelDisabledsentinel errorpkg/unikontainers/unikontainers.go— log Warn on misconfigurationpkg/unikontainers/vaccel_test.go— 4 new unit testsRelated issues
How was this tested?
All existing unit tests pass (
make unittest). Build passes (make). Four new unit tests added covering disabled, missing address, malformed address and valid address cases.LLM usage
N/A
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).