fix(unikontainers): warn on vAccel misconfiguration#699
Open
Chennamma-Hotkar wants to merge 3 commits into
Open
fix(unikontainers): warn on vAccel misconfiguration#699Chennamma-Hotkar wants to merge 3 commits into
Chennamma-Hotkar wants to merge 3 commits into
Conversation
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>
✅ Deploy Preview for urunc canceled.
|
✅ Deploy Preview for urunc canceled.
|
Contributor
|
Hello @Chennamma-Hotkar , please read the contribution guide |
Author
|
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. |
Contributor
|
Hello @Chennamma-Hotkar , you will also need to add yourself on https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml |
Author
|
Hi @cmainas, I have included my name in |
82faa31 to
bd5f83b
Compare
Signed-off-by: Chennamma-Hotkar <channuhotkar@gmail.com>
bd5f83b to
1e044a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).