mirror of
https://github.com/docker/compose.git
synced 2025-09-22 17:27:50 +02:00
inject secrets/config just before container is started
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
b3207c455d
commit
aadce87b16
@ -756,14 +756,7 @@ func (s *composeService) createMobyContainer(ctx context.Context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return created, nil
|
||||||
err = s.injectSecrets(ctx, project, service, created.ID)
|
|
||||||
if err != nil {
|
|
||||||
return created, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = s.injectConfigs(ctx, project, service, created.ID)
|
|
||||||
return created, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// getLinks mimics V1 compose/service.py::Service::_get_links()
|
// getLinks mimics V1 compose/service.py::Service::_get_links()
|
||||||
@ -897,6 +890,17 @@ func (s *composeService) startService(ctx context.Context,
|
|||||||
if ctr.State == ContainerRunning {
|
if ctr.State == ContainerRunning {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.injectSecrets(ctx, project, service, ctr.ID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = s.injectConfigs(ctx, project, service, ctr.ID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
eventName := getContainerProgressName(ctr)
|
eventName := getContainerProgressName(ctr)
|
||||||
w.Event(progress.StartingEvent(eventName))
|
w.Event(progress.StartingEvent(eventName))
|
||||||
err = s.apiClient().ContainerStart(ctx, ctr.ID, containerType.StartOptions{})
|
err = s.apiClient().ContainerStart(ctx, ctr.ID, containerType.StartOptions{})
|
||||||
|
@ -127,7 +127,14 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return created.ID, nil
|
|
||||||
|
err = s.injectSecrets(ctx, project, service, created.ID)
|
||||||
|
if err != nil {
|
||||||
|
return created.ID, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = s.injectConfigs(ctx, project, service, created.ID)
|
||||||
|
return created.ID, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyRunOptions(project *types.Project, service *types.ServiceConfig, opts api.RunOptions) {
|
func applyRunOptions(project *types.Project, service *types.ServiceConfig, opts api.RunOptions) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user