-
Notifications
You must be signed in to change notification settings - Fork 57
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
"init" option to copy in a custom docker-compose.override.yml file #285
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Philip-21 <[email protected]>
Signed-off-by: Philip-21 <[email protected]>
The E2E tests are failing with this error:
|
internal/stacks/stack_manager.go
Outdated
if err := s.copyToDockerComposeOverride(options.CustomPath); err != nil { | ||
return fmt.Errorf("failed to copy file data to docker-compose.override.yml: %s", 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.
I think you need a check around this to see if options.CustomPath
has been set or not. Right now the tests seem to indicate that the CLI fails to initialize a stack if this flag is not set.
Signed-off-by: Philip-21 <[email protected]>
Signed-off-by: Philip-21 <[email protected]>
@nguyer I have corrected it, all checks pass successfully, and the docker -override works |
Signed-off-by: Philip Obiora <[email protected]>
Signed-off-by: Philip-21 <[email protected]>
internal/stacks/stack_manager.go
Outdated
@@ -188,6 +188,11 @@ func (s *StackManager) InitStack(options *types.InitOptions) (err error) { | |||
if err := s.writeDockerComposeOverride(compose); err != nil { | |||
return fmt.Errorf("failed to write docker-compose.override.yml: %s", err) | |||
} | |||
if options.CustomPath == "docker-compose.yml" { |
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.
I think this check now enforces that you can only ever pass in a file named docker-compose.yml
in the current directory. I would think we would just want to check to see if this is an empty string here (and then maybe validate the file exists).
dockerPath := filepath.Join(s.Stack.StackDir, dockerComposePath) | ||
overrideComposeContent, err := os.ReadFile(dockerPath) |
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 I'm reading this right, this means we will read the automatically generated docker-compose.override.yml
, append it to a comment, and write it back out again to the same file.
From my understanding the goal here is to allow the user to pass in a yaml file from anywhere on their system, and we will use that as or merge it with the existing docker-compose.override.yml
file. I'm not sure this function actually creates any new functionality as-is.
Signed-off-by: Philip-21 <[email protected]>
Hi @nguyer is this pr still open or i should close it ? |
This is pr fixes for #184