mirror of https://github.com/kubernetes/kops.git
Add support for --dns flag in Docker config
This commit adds support for the --dns flag which is provided as a Docker daemon startup flag. The flag is used to set the IP address of the DNS server that the daemon injects into containers. Multiple --dns flags are supported.
This commit is contained in:
parent
19ab734a89
commit
311d58e604
|
|
@ -732,6 +732,11 @@ spec:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
dns:
|
||||||
|
description: DNS is the IP address of the DNS server
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
execOpt:
|
execOpt:
|
||||||
description: ExecOpt is a series of options passed to the runtime
|
description: ExecOpt is a series of options passed to the runtime
|
||||||
items:
|
items:
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,18 @@ func TestDockerBuilder_BuildFlags(t *testing.T) {
|
||||||
kops.DockerConfig{InsecureRegistries: []string{"registry1", "registry2"}},
|
kops.DockerConfig{InsecureRegistries: []string{"registry1", "registry2"}},
|
||||||
"--insecure-registry=registry1 --insecure-registry=registry2",
|
"--insecure-registry=registry1 --insecure-registry=registry2",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
kops.DockerConfig{DNS: []string{}},
|
||||||
|
"",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
kops.DockerConfig{DNS: []string{"8.8.4.4"}},
|
||||||
|
"--dns=8.8.4.4",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
kops.DockerConfig{DNS: []string{"8.8.4.4", "8.8.8.8"}},
|
||||||
|
"--dns=8.8.4.4 --dns=8.8.8.8",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, g := range grid {
|
for _, g := range grid {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ type DockerConfig struct {
|
||||||
DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"`
|
DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"`
|
||||||
// DefaultRuntime is the default OCI runtime for containers (default "runc")
|
// DefaultRuntime is the default OCI runtime for containers (default "runc")
|
||||||
DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"`
|
DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"`
|
||||||
|
// DNS is the IP address of the DNS server
|
||||||
|
DNS []string `json:"dns,omitempty" flag:"dns,repeat"`
|
||||||
// ExecOpt is a series of options passed to the runtime
|
// ExecOpt is a series of options passed to the runtime
|
||||||
ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"`
|
ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"`
|
||||||
// ExecRoot is the root directory for execution state files (default "/var/run/docker")
|
// ExecRoot is the root directory for execution state files (default "/var/run/docker")
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ type DockerConfig struct {
|
||||||
DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"`
|
DefaultUlimit []string `json:"defaultUlimit,omitempty" flag:"default-ulimit,repeat"`
|
||||||
// DefaultRuntime is the default OCI runtime for containers (default "runc")
|
// DefaultRuntime is the default OCI runtime for containers (default "runc")
|
||||||
DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"`
|
DefaultRuntime *string `json:"defaultRuntime,omitempty" flag:"default-runtime"`
|
||||||
|
// DNS is the IP address of the DNS server
|
||||||
|
DNS []string `json:"dns,omitempty" flag:"dns,repeat"`
|
||||||
// ExecOpt is a series of options passed to the runtime
|
// ExecOpt is a series of options passed to the runtime
|
||||||
ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"`
|
ExecOpt []string `json:"execOpt,omitempty" flag:"exec-opt,repeat"`
|
||||||
// ExecRoot is the root directory for execution state files (default "/var/run/docker")
|
// ExecRoot is the root directory for execution state files (default "/var/run/docker")
|
||||||
|
|
|
||||||
|
|
@ -3211,6 +3211,7 @@ func autoConvert_v1alpha2_DockerConfig_To_kops_DockerConfig(in *DockerConfig, ou
|
||||||
out.DataRoot = in.DataRoot
|
out.DataRoot = in.DataRoot
|
||||||
out.DefaultUlimit = in.DefaultUlimit
|
out.DefaultUlimit = in.DefaultUlimit
|
||||||
out.DefaultRuntime = in.DefaultRuntime
|
out.DefaultRuntime = in.DefaultRuntime
|
||||||
|
out.DNS = in.DNS
|
||||||
out.ExecOpt = in.ExecOpt
|
out.ExecOpt = in.ExecOpt
|
||||||
out.ExecRoot = in.ExecRoot
|
out.ExecRoot = in.ExecRoot
|
||||||
out.Experimental = in.Experimental
|
out.Experimental = in.Experimental
|
||||||
|
|
@ -3258,6 +3259,7 @@ func autoConvert_kops_DockerConfig_To_v1alpha2_DockerConfig(in *kops.DockerConfi
|
||||||
out.DataRoot = in.DataRoot
|
out.DataRoot = in.DataRoot
|
||||||
out.DefaultUlimit = in.DefaultUlimit
|
out.DefaultUlimit = in.DefaultUlimit
|
||||||
out.DefaultRuntime = in.DefaultRuntime
|
out.DefaultRuntime = in.DefaultRuntime
|
||||||
|
out.DNS = in.DNS
|
||||||
out.ExecOpt = in.ExecOpt
|
out.ExecOpt = in.ExecOpt
|
||||||
out.ExecRoot = in.ExecRoot
|
out.ExecRoot = in.ExecRoot
|
||||||
out.Experimental = in.Experimental
|
out.Experimental = in.Experimental
|
||||||
|
|
|
||||||
|
|
@ -1376,6 +1376,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) {
|
||||||
*out = new(string)
|
*out = new(string)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.DNS != nil {
|
||||||
|
in, out := &in.DNS, &out.DNS
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.ExecOpt != nil {
|
if in.ExecOpt != nil {
|
||||||
in, out := &in.ExecOpt, &out.ExecOpt
|
in, out := &in.ExecOpt, &out.ExecOpt
|
||||||
*out = make([]string, len(*in))
|
*out = make([]string, len(*in))
|
||||||
|
|
|
||||||
|
|
@ -1499,6 +1499,11 @@ func (in *DockerConfig) DeepCopyInto(out *DockerConfig) {
|
||||||
*out = new(string)
|
*out = new(string)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.DNS != nil {
|
||||||
|
in, out := &in.DNS, &out.DNS
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
if in.ExecOpt != nil {
|
if in.ExecOpt != nil {
|
||||||
in, out := &in.ExecOpt, &out.ExecOpt
|
in, out := &in.ExecOpt, &out.ExecOpt
|
||||||
*out = make([]string, len(*in))
|
*out = make([]string, len(*in))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue