-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable passing DNS info to the rkt driver #892
Conversation
@@ -183,6 +186,20 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e | |||
// Add CPU isolator | |||
cmdArgs = append(cmdArgs, fmt.Sprintf("--cpu=%vm", int64(task.Resources.CPU))) | |||
|
|||
// Add DNS servers | |||
for _, ip := range driverConfig.DNSServers { | |||
if net.ParseIP(ip) != nil { |
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 err := net.ParseIP(ip); err != nil {
msg := fmt.Errorf("invalid ip address for container dns server %q: %v", ip, err)
d.logger.Printf("[ERR] driver.rkt: %v", msg)
return msg
} else {
cmdArgs = append(cmdArgs, fmt.Sprintf("--dns=%s", ip))
}
LGTM |
@dadgar |
// Add DNS servers | ||
for _, ip := range driverConfig.DNSServers { | ||
if err := net.ParseIP(ip); err == nil { | ||
msg := fmt.Errorf("invalid ip address for container dns server %q: %v", ip, err) |
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.
Ah if it is will then get rid of the ": %v" part and error in the msg
. And now that I think of it, make the log level DEBUG. It is not a Nomad error
Enable passing DNS info to the rkt driver
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Pass DNS servers and search domains to the rkt CLI. These get written to the container's resolv.conf.