-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.15](backport #5438) Fix state store SetAction panic #5455
Merged
Conversation
This file contains 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
* fix state store SetAction panic The state store SetAction did not correctly cover the case where a nil action is passed as parameter. The unenroll handler might pass a nil action if the unenroll is a auto-unenroll, that means, it does not come from fleet Also the unenroll handler does checks for a nil state store anymore, it assumes it's valid just as it does for all other dependencies. (cherry picked from commit c113a26)
This pull request has not been merged yet. Could you please review and merge it @AndersonQ? 🙏 |
/test |
/test |
|
AndersonQ
approved these changes
Sep 12, 2024
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.
The state store SetAction did not correctly cover the case where a nil action is passed as parameter. The unenroll handler might pass a nil action if the unenroll is a auto-unenroll, that means, it does not come from fleet
Also the unenroll handler does checks for a nil state store anymore, it assumes it's valid just as it does for all other dependencies
What does this PR do?
Fixes the state store panicking when receiving an
nil
actionWhy is it important?
Panic is bad, the agent should not panic
Also the unenroll handler sets an
nil
action on the state store if the unenroll is self-inflicted. The agent auto unenroll after the 7th authentication failure against fleet.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragments
using the changelog tool[ ] I have added an integration test or an E2E testDisruptive User Impact
How to test this PR locally
run the tests added on the PR, all work
keep the tests, rever the changes on the state store, they will panic
Related issues
nil
action #5434Questions to ask yourself
This is an automatic backport of pull request #5438 done by [Mergify](https://mergify.com).