Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit 8be0d98

Browse files
authored
fix: supply config on init (#14) [EE-1474]
1 parent ef24824 commit 8be0d98

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

compose/internal/composebinary/composebinary.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ func NewComposeWrapper(binaryPath, configPath string) (libstack.Deployer, error)
3131
return &ComposeWrapper{binaryPath: binaryPath, configPath: configPath}, nil
3232
}
3333

34-
// Up create and start containers
34+
// Deploy creates and starts containers
3535
func (wrapper *ComposeWrapper) Deploy(ctx context.Context, workingDir, host, projectName string, filePaths []string, envFilePath string) error {
36-
output, err := wrapper.Command(newUpCommand(filePaths), workingDir, host, projectName, envFilePath, wrapper.configPath)
36+
output, err := wrapper.Command(newUpCommand(filePaths), workingDir, host, projectName, envFilePath)
3737
if len(output) != 0 {
3838
log.Printf("[libstack,composebinary] [message: finish deploying] [output: %s] [err: %s]", output, err)
3939
}
4040

4141
return err
4242
}
4343

44-
// Down stop and remove containers
44+
// Remove stops and removes containers
4545
func (wrapper *ComposeWrapper) Remove(ctx context.Context, workingDir, host, projectName string, filePaths []string) error {
46-
output, err := wrapper.Command(newDownCommand(filePaths), workingDir, host, projectName, "", "")
46+
output, err := wrapper.Command(newDownCommand(filePaths), workingDir, host, projectName, "")
4747
if len(output) != 0 {
4848
log.Printf("[libstack,composebinary] [message: finish deploying] [output: %s] [err: %s]", output, err)
4949
}
5050

5151
return err
5252
}
5353

54-
// Command exectue a docker-compose commanåd
55-
func (wrapper *ComposeWrapper) Command(command composeCommand, workingDir, host, projectName, envFilePath, configPath string) ([]byte, error) {
54+
// Command executes a docker-compose command
55+
func (wrapper *ComposeWrapper) Command(command composeCommand, workingDir, host, projectName, envFilePath string) ([]byte, error) {
5656
program := utils.ProgramPath(wrapper.binaryPath, "docker-compose")
5757

5858
if projectName != "" {
@@ -71,9 +71,9 @@ func (wrapper *ComposeWrapper) Command(command composeCommand, workingDir, host,
7171
cmd := exec.Command(program, command.ToArgs()...)
7272
cmd.Dir = workingDir
7373

74-
if configPath != "" {
74+
if wrapper.configPath != "" {
7575
cmd.Env = os.Environ()
76-
cmd.Env = append(cmd.Env, fmt.Sprintf("DOCKER_CONFIG=%s", configPath))
76+
cmd.Env = append(cmd.Env, fmt.Sprintf("DOCKER_CONFIG=%s", wrapper.configPath))
7777
}
7878

7979
cmd.Stderr = &stderr

0 commit comments

Comments
 (0)