-
Notifications
You must be signed in to change notification settings - Fork 62
fix: Filter incompatible logging driver options in ContainerLogConfig #160
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
base: main
Are you sure you want to change the base?
Changes from all commits
da83c6a
a737068
ec557ad
816cb6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,9 +103,23 @@ func (c DockerConfiguration) ContainerLogConfig() container.LogConfig { | |
| return container.LogConfig{} | ||
| } | ||
|
|
||
| // Filter config options based on the logging driver type | ||
| // The "local" driver has specific options that aren't compatible with other drivers | ||
| config := make(map[string]string) | ||
| for k, v := range c.LogConfig.Config { | ||
| // Only include these options if using the "local" driver | ||
| if c.LogConfig.Type != "local" { | ||
| // Exclude local-specific options for non-local drivers like fluentd, json-file, etc. | ||
| if k == "max-size" || k == "max-file" || k == "compress" || k == "mode" { | ||
| continue | ||
| } | ||
| } | ||
| config[k] = v | ||
| } | ||
|
Comment on lines
+106
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n config/config_docker.go | sed -n '100,125p'Repository: pelican-dev/wings Length of output: 983 🌐 Web query:
💡 Result:
Example (daemon.json): Sources: Fix json-file driver log rotation by excluding only incompatible options. 🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain
🌐 Web query: 💡 Result: Short compatibility summary — which log-opt keys are shared vs driver-specific: Common/available to multiple drivers
json-file (driver-specific options)
local (driver-specific; recommended over json-file)
fluentd (driver-specific)
syslog (driver-specific)
Notes
Sources Task: Implement driver-specific logging option filteringBased on Docker documentation:
Plan:
🏁 Script executed: Length of output: 0 🏁 Script executed: Length of output: 251 🏁 Script executed: Length of output: 408 🏁 Script executed: Length of output: 274 🏁 Script executed: Length of output: 563 Task: Implement driver-specific logging option filteringBased on Docker documentation:
Plan:
💡 For code changes across multiple files, use |
||
|
|
||
| return container.LogConfig{ | ||
| Type: c.LogConfig.Type, | ||
| Config: c.LogConfig.Config, | ||
| Config: config, | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
If wings sets a config value to something else then what you provided then it means its wrong this is not a proper way to fix it imo.
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.
I disagree because the code you marked has nothing to do with that behavior?