mirror of
https://github.com/docker/compose.git
synced 2026-05-13 13:58:02 +00:00
lint fix
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
This commit is contained in:
parent
0c854a6ab7
commit
6a35be5112
1 changed files with 11 additions and 7 deletions
|
|
@ -98,13 +98,7 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
|
|||
Add(api.OneoffLabel, "True")
|
||||
|
||||
// Only ensure image exists for the target service, dependencies were already handled by startDependencies
|
||||
var buildOpts *api.BuildOptions
|
||||
if opts.Build != nil {
|
||||
// Create a copy of build options and restrict to only the target service
|
||||
buildOptsCopy := *opts.Build
|
||||
buildOptsCopy.Services = []string{opts.Service}
|
||||
buildOpts = &buildOptsCopy
|
||||
}
|
||||
buildOpts := prepareBuildOptions(opts)
|
||||
if err := s.ensureImagesExists(ctx, project, buildOpts, opts.QuietPull); err != nil { // all dependencies already checked, but might miss service img
|
||||
return "", err
|
||||
}
|
||||
|
|
@ -155,6 +149,16 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
|
|||
return created.ID, err
|
||||
}
|
||||
|
||||
func prepareBuildOptions(opts api.RunOptions) *api.BuildOptions {
|
||||
if opts.Build == nil {
|
||||
return nil
|
||||
}
|
||||
// Create a copy of build options and restrict to only the target service
|
||||
buildOptsCopy := *opts.Build
|
||||
buildOptsCopy.Services = []string{opts.Service}
|
||||
return &buildOptsCopy
|
||||
}
|
||||
|
||||
func applyRunOptions(project *types.Project, service *types.ServiceConfig, opts api.RunOptions) {
|
||||
service.Tty = opts.Tty
|
||||
service.StdinOpen = opts.Interactive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue