hook-docker: bracket IPv6 hosts in dockerd syslog log driver URL#328
Open
rahulbabu95 wants to merge 1 commit into
Open
hook-docker: bracket IPv6 hosts in dockerd syslog log driver URL#328rahulbabu95 wants to merge 1 commit into
rahulbabu95 wants to merge 1 commit into
Conversation
f1fbc27 to
8dfd012
Compare
Bare IPv6 addresses passed via the `syslog_host=` kernel cmdline were not bracketed in the dockerd syslog log driver URL, producing a malformed value that dockerd cannot parse. Use net.JoinHostPort so IPv6 is bracketed correctly (e.g. `udp://[fd00:80:66::1]:514`); IPv4 and hostname inputs are unchanged. Also skip configuring the syslog log driver when the syslog host is empty. Signed-off-by: Rahul Ganesh <rahulbabu95@gmail.com> Signed-off-by: Rahul <rahulbabu95@gmail.com>
8dfd012 to
c1eda74
Compare
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.
Bare IPv6 addresses passed via the
syslog_host=kernel cmdline were not bracketed in the dockerd syslog log driver URL, producing a malformed value that dockerd cannot parse. Use net.JoinHostPort so IPv6 is bracketed correctly (e.g.udp://[fd00:80:66::1]:514); IPv4 and hostname inputs are unchanged.Also skip configuring the syslog log driver when the syslog host is empty.
Description
Fixes: #
How Has This Been Tested?
When syslod_host is set to ipv6 address like syslog_host=fd00:80:66::1,
/etc/docker/daemon.json
{
"debug": true,
"log-driver": "syslog",
"log-opts": {
"syslog-address": "udp://fd00:80:66::1:514"
}
}
dockerd crashes with:
After the fix:
{
"debug": true,
"log-driver": "syslog",
"log-opts": {
"syslog-address": "udp://[fd00:80:66::1]:514"
}
}
dockerd is able to initialize properly.
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: