Skip to content

Commit

Permalink
ref(docker.go): export ApplyConfigurationOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Vaughn Dice <vadice@microsoft.com>
  • Loading branch information
vdice committed Apr 22, 2020
1 parent bc0cd79 commit af934e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions driver/docker/docker.go
Expand Up @@ -200,7 +200,7 @@ func (d *Driver) exec(op *driver.Operation) (driver.OperationResult, error) {
}

d.containerHostCfg = &container.HostConfig{}
if err := d.applyConfigurationOptions(); err != nil {
if err := d.ApplyConfigurationOptions(); err != nil {
return driver.OperationResult{}, err
}

Expand Down Expand Up @@ -293,7 +293,8 @@ func (d *Driver) exec(op *driver.Operation) (driver.OperationResult, error) {
return opResult, err
}

func (d *Driver) applyConfigurationOptions() error {
// ApplyConfigurationOptions applies the configuration options set on the driver
func (d *Driver) ApplyConfigurationOptions() error {
for _, opt := range d.dockerConfigurationOptions {
if err := opt(d.containerCfg, d.containerHostCfg); err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions driver/docker/docker_test.go
Expand Up @@ -18,7 +18,7 @@ func TestDriver_GetConfigurationOptions(t *testing.T) {
d.containerCfg = &container.Config{}
d.containerHostCfg = &container.HostConfig{}

err := d.applyConfigurationOptions()
err := d.ApplyConfigurationOptions()
is.NoError(err)

cfg, err := d.GetContainerConfig()
Expand All @@ -39,7 +39,7 @@ func TestDriver_GetConfigurationOptions(t *testing.T) {
return nil
})

err := d.applyConfigurationOptions()
err := d.ApplyConfigurationOptions()
is.NoError(err)

expectedContainerCfg := container.Config{
Expand Down

0 comments on commit af934e4

Please sign in to comment.