Skip to content
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

don't fail logs when driver:none is set #10107

Merged
merged 1 commit into from Dec 20, 2022
Merged

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Dec 20, 2022

What I did
detect engine response requesting container logs as ErrNotImplemented when logging driver is configured to none. This should not fail the command, just show a warning

bonus:

  • configure logContainers to collect logs after last watch event, so we don't get previous logs repeated after a container restart.
  • detect container will restart using container inspect's Restarting attribute (not sure why we didn't used this before?)
  • thanks to ^ logs can now detect container will not restart and then exits
  • introduced an e2e test to cover --follow

Related issue
fixes: #9030

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@ndeloof ndeloof requested review from a team, nicksieger, StefanScherer, ulyssessouza, glours, milas and laurazard and removed request for a team December 20, 2022 14:32
@ndeloof ndeloof force-pushed the logging_driver_none branch 2 times, most recently from 5ed4bfc to b6e4920 Compare December 20, 2022 14:35
@codecov
Copy link

codecov bot commented Dec 20, 2022

Codecov Report

Base: 76.98% // Head: 75.79% // Decreases project coverage by -1.19% ⚠️

Coverage data is based on head (22d2e83) compared to base (9f5f0b6).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10107      +/-   ##
==========================================
- Coverage   76.98%   75.79%   -1.20%     
==========================================
  Files           2        2              
  Lines         252      252              
==========================================
- Hits          194      191       -3     
- Misses         51       53       +2     
- Partials        7        8       +1     
Impacted Files Coverage Δ
pkg/e2e/framework.go 74.04% <0.00%> (-1.28%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndeloof ndeloof force-pushed the logging_driver_none branch 2 times, most recently from c1c162e to 7b4d94a Compare December 20, 2022 15:15
Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pkg/e2e/fixtures/logs-test/restart.yaml Outdated Show resolved Hide resolved
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copy link
Member

@nicksieger nicksieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@glours glours merged commit bab3050 into docker:v2 Dec 20, 2022
@ndeloof ndeloof deleted the logging_driver_none branch December 20, 2023 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker compose logs with logging driver: none halts log output with error
3 participants