Fix continuous container restarts after Fleet policy updates#15772
Draft
samuelvl wants to merge 1 commit into
Draft
Fix continuous container restarts after Fleet policy updates#15772samuelvl wants to merge 1 commit into
samuelvl wants to merge 1 commit into
Conversation
💔 Build Failed
Failed CI Steps
Historycc @samuelvl |
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.
What does this PR do?
Fixes an infinite restart loop in container deployments after a Fleet logging policy update.
Containers without
LOGS_PATHstart with logging directed to stderr:The policy handler used
NewFromConfigfor checking configuration changes, which starts with the normal file-logging defaults before applying the policy:The handler then compared these values with the current container settings:
The agent reconciled the logging change and restarted. After the restart, container logging went back to stderr and the same policy caused another restart.
The solution is using the container logging settings as the baseline for each Fleet policy update. Fleet values override that baseline only when they are explicitly provided.
Why is it important?
It prevents containers from restarting indefinitely after a normal Fleet policy update.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog toolDisruptive User Impact
None expected. Existing container logging settings are preserved unless Fleet explicitly changes them.
How to test this PR locally
Run the following integration test locally:
Related issues