Merge pull request #2059 from ndeloof/volumes_from

update project's volumes_from before retrieving service
This commit is contained in:
Ulysses Souza 2021-09-01 02:00:31 -07:00 committed by GitHub
commit 13dea3cef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -127,6 +127,9 @@ func (s *composeService) runInteractive(ctx context.Context, containerID string,
}
func (s *composeService) prepareRun(ctx context.Context, project *types.Project, opts api.RunOptions) (string, error) {
if err := prepareVolumes(project); err != nil { // all dependencies already checked, but might miss service img
return "", err
}
service, err := project.GetService(opts.Service)
if err != nil {
return "", err
@ -146,9 +149,6 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
}
service.Labels = service.Labels.Add(api.SlugLabel, slug)
service.Labels = service.Labels.Add(api.OneoffLabel, "True")
if err := prepareVolumes(project); err != nil { // all dependencies already checked, but might miss service img
return "", err
}
if err := s.ensureImagesExists(ctx, project, false); err != nil { // all dependencies already checked, but might miss service img
return "", err