-
Notifications
You must be signed in to change notification settings - Fork 321
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
Remove log_driver limitations #792
Conversation
docker is a classthat may have no external impact to Forge modules. This module is declared in 6 of 578 indexed public
|
Can this be reviewed please? |
Closing and reopening PR to rekick automated testing. |
@timdeluxe Thanks for this suggestion. I'm not 100% sure removing the validation is the right way to go with this. I wonder if a better approach would be to validate against the log drivers that are currently available? For example, the following command will return the log drivers: docker system info --format '{{json .Plugins.Log}}'
["awslogs","fluentd","gcplogs","gelf","journald","json-file","local","logentries","splunk","syslog"] One could parse the list returned and validate the user-input against it. |
@chelnak Hm, yeah, that is an option. It is a bit more complicated as i feel not so familiar with structured ruby facts, which would be required here in my opinion. |
hmmm, that is an interesting analysis. I can certainly see that happening in the case where an invalid driver is passed. The question is, could we move that validation elsewhere so that it would fail on the first run... |
Hit me with ideas! How about validating it, but just issue a warning instead of a fail, if it does not fit? This way it still would be validated, but it wouldn't fail on the first run. Not perfect but would be at least a compromise... |
One additional idea: |
I think that would actually be a good non destructive option. However if it's incorrect, we should warn and fall back to a known default.. edit: I missed out a crucial word there! |
Yeah this is certainly another way to approach it. However I'm not a massive fan of things taking more than one puppet run to apply unless we have no choice. Warning and falling back to a known default seems more reasonable here to me. What do you think? |
Hey @timdeluxe , did you get chance to think over my suggestion? |
@chelnak sorry for missing feedback, was busy with some actions around my own (round) birthday, please apologize. I am sorry, but i don't get you at...
...what do you mean with "falling back to a known default"? Do you mean the validation should just been done to a known set of log_drivers like done in the current code but the set just will extend with f.e. the currently missing "local" one? In my opinion the only alternatives are: But maybe i did not understand you at some point - in that case, please explain in more detail. Thanks! |
Hey - no problem. 😄 I'm actually leaning towards removing the validation right now. There doesn't seem to be a sensible trade off between value and implementation. I've raised this internally with the team to see what they say.. also if any other community members see this, please feel free to share your opinions. |
FYI: Saw that needs-rebase label by david - will do that, once the decision chelnak descibed is made. |
@chelnak Any update here? |
Hey @timdeluxe It's community day today - i'll bring it up in our triage meeting 😄 |
Hey @timdeluxe, Are you able to rebase? Talked this through and I think this is the right way to go at this moment in time. I think there might be value in adding something to the README or parameter description to explain that the log driver names must be verified prior to be included. |
@chelnak Sorry, for the delay. Yes, i am able to rebase and i can include the parameter description (i think that is enough). Will try to do that tomorrow morning (meaning european morning) and update the PR here then. |
248d976
to
791cfb1
Compare
@timdeluxe Thanks for getting this updated. The test failures are not related to this PR so I am happy to get this merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you!
Current docker versions come with a bunch of new log drivers (see https://docs.docker.com/config/containers/logging/configure/#supported-logging-drivers), most importantly "local", which is not included in the validation of this module.
With this PR i removed the validation for log_driver completely, because one can also integrate other log drivers via plugins, which should be possible.
Fixes #791