Skip to content

Commit e2e4148

Browse files
author
OpenShift Bot
committed
Merge pull request #209 from csrwng/undo_dns_params
Merged by openshift-bot
2 parents ab3485c + 496edec commit e2e4148

File tree

4 files changed

+2
-30
lines changed

4 files changed

+2
-30
lines changed

pkg/api/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ type Config struct {
6969
// Specify a relative directory inside the application repository that should
7070
// be used as a root directory for the application.
7171
ContextDir string
72-
73-
// DNS servers to use when running build container
74-
DNS []string
75-
76-
// DNS search suffixes to use when running build container
77-
DNSSearch []string
7872
}
7973

8074
// DockerConfig contains the configuration for a Docker connection

pkg/build/strategies/sti/sti.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ func (b *STI) Save(config *api.Config) (err error) {
312312
Stdout: outWriter,
313313
Stderr: errWriter,
314314
OnStart: extractFunc,
315-
DNS: config.DNS,
316-
DNSSearch: config.DNSSearch,
317315
}
318316

319317
go streamContainerError(errReader, nil, config)
@@ -371,8 +369,6 @@ func (b *STI) Execute(command string, config *api.Config) error {
371369
Command: command,
372370
Env: buildEnv,
373371
PostExec: b.postExecutor,
374-
DNS: config.DNS,
375-
DNSSearch: config.DNSSearch,
376372
}
377373
if !config.LayeredBuild {
378374
opts.Stdin = tarFile

pkg/docker/docker.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ type RunContainerOptions struct {
8888
Stderr io.Writer
8989
OnStart func() error
9090
PostExec PostExecutor
91-
DNS []string
92-
DNSSearch []string
9391
}
9492

9593
// CommitContainerOptions are options passed in to the CommitContainer method
@@ -348,16 +346,9 @@ func (d *stiDocker) RunContainer(opts RunContainerOptions) (err error) {
348346
if opts.Stdout != nil {
349347
config.AttachStdout = true
350348
}
351-
var hostConfig *docker.HostConfig
352-
if opts.DNS != nil || opts.DNSSearch != nil {
353-
hostConfig = &docker.HostConfig{
354-
DNS: opts.DNS,
355-
DNSSearch: opts.DNSSearch,
356-
}
357-
}
358349

359-
glog.V(2).Infof("Creating container using config: %+v and host config: %+v", config, hostConfig)
360-
container, err := d.client.CreateContainer(docker.CreateContainerOptions{Name: "", Config: &config, HostConfig: hostConfig})
350+
glog.V(2).Infof("Creating container using config: %+v", config)
351+
container, err := d.client.CreateContainer(docker.CreateContainerOptions{Name: "", Config: &config})
361352
if err != nil {
362353
return err
363354
}

pkg/docker/docker_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ func TestRunContainer(t *testing.T) {
426426
AttachToContainerSleep: 200 * time.Millisecond,
427427
}
428428
dh := getDocker(fakeDocker)
429-
dnsServers := []string{"dnsserver1", "dnsserver2"}
430429
err := dh.RunContainer(RunContainerOptions{
431430
Image: "test/image",
432431
PullImage: true,
@@ -438,7 +437,6 @@ func TestRunContainer(t *testing.T) {
438437
Stdin: os.Stdin,
439438
Stdout: os.Stdout,
440439
Stderr: os.Stdout,
441-
DNS: dnsServers,
442440
})
443441
if err != nil {
444442
t.Errorf("%s: Unexpected error: %v", desc, err)
@@ -458,13 +456,6 @@ func TestRunContainer(t *testing.T) {
458456
t.Errorf("%s: Unexpected stdin flags for createConfig: OpenStdin - %v"+
459457
" StdinOnce - %v", desc, createConfig.OpenStdin, createConfig.StdinOnce)
460458
}
461-
hostConfig := fakeDocker.CreateContainerOpts.HostConfig
462-
if hostConfig == nil {
463-
t.Errorf("%s: Expected a valid hostConfig in createContainerOpts")
464-
}
465-
if hostConfig != nil && !reflect.DeepEqual(hostConfig.DNS, dnsServers) {
466-
t.Errorf("%s: Unexpected hostConfig DNS value: %#v", hostConfig.DNS)
467-
}
468459

469460
// Verify that remove container was called
470461
if fakeDocker.RemoveContainerOpts.ID != "12345-test" {

0 commit comments

Comments
 (0)