mirror of https://github.com/docker/compose.git
Merge pull request #1852 from ulyssessouza/logs-follow-scale
This commit is contained in:
commit
7a4e111794
|
@ -101,7 +101,7 @@ func (s *composeService) up(ctx context.Context, project *types.Project) error {
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//update stack
|
// update stack
|
||||||
eventName = "Updating Compose stack"
|
eventName = "Updating Compose stack"
|
||||||
w.Event(progress.CreatingEvent(eventName))
|
w.Event(progress.CreatingEvent(eventName))
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ func (s *ServiceProxy) WithInterceptor(interceptors ...Interceptor) *ServiceProx
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
//Build implements Service interface
|
// Build implements Service interface
|
||||||
func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error {
|
func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, options BuildOptions) error {
|
||||||
if s.BuildFn == nil {
|
if s.BuildFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -107,7 +107,7 @@ func (s *ServiceProxy) Build(ctx context.Context, project *types.Project, option
|
||||||
return s.BuildFn(ctx, project, options)
|
return s.BuildFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Push implements Service interface
|
// Push implements Service interface
|
||||||
func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error {
|
func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options PushOptions) error {
|
||||||
if s.PushFn == nil {
|
if s.PushFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -118,7 +118,7 @@ func (s *ServiceProxy) Push(ctx context.Context, project *types.Project, options
|
||||||
return s.PushFn(ctx, project, options)
|
return s.PushFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Pull implements Service interface
|
// Pull implements Service interface
|
||||||
func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error {
|
func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options PullOptions) error {
|
||||||
if s.PullFn == nil {
|
if s.PullFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -129,7 +129,7 @@ func (s *ServiceProxy) Pull(ctx context.Context, project *types.Project, options
|
||||||
return s.PullFn(ctx, project, options)
|
return s.PullFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Create implements Service interface
|
// Create implements Service interface
|
||||||
func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error {
|
func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, options CreateOptions) error {
|
||||||
if s.CreateFn == nil {
|
if s.CreateFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -140,7 +140,7 @@ func (s *ServiceProxy) Create(ctx context.Context, project *types.Project, optio
|
||||||
return s.CreateFn(ctx, project, options)
|
return s.CreateFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Start implements Service interface
|
// Start implements Service interface
|
||||||
func (s *ServiceProxy) Start(ctx context.Context, project *types.Project, options StartOptions) error {
|
func (s *ServiceProxy) Start(ctx context.Context, project *types.Project, options StartOptions) error {
|
||||||
if s.StartFn == nil {
|
if s.StartFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -151,7 +151,7 @@ func (s *ServiceProxy) Start(ctx context.Context, project *types.Project, option
|
||||||
return s.StartFn(ctx, project, options)
|
return s.StartFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Restart implements Service interface
|
// Restart implements Service interface
|
||||||
func (s *ServiceProxy) Restart(ctx context.Context, project *types.Project, options RestartOptions) error {
|
func (s *ServiceProxy) Restart(ctx context.Context, project *types.Project, options RestartOptions) error {
|
||||||
if s.RestartFn == nil {
|
if s.RestartFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -162,7 +162,7 @@ func (s *ServiceProxy) Restart(ctx context.Context, project *types.Project, opti
|
||||||
return s.RestartFn(ctx, project, options)
|
return s.RestartFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Stop implements Service interface
|
// Stop implements Service interface
|
||||||
func (s *ServiceProxy) Stop(ctx context.Context, project *types.Project, options StopOptions) error {
|
func (s *ServiceProxy) Stop(ctx context.Context, project *types.Project, options StopOptions) error {
|
||||||
if s.StopFn == nil {
|
if s.StopFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -173,7 +173,7 @@ func (s *ServiceProxy) Stop(ctx context.Context, project *types.Project, options
|
||||||
return s.StopFn(ctx, project, options)
|
return s.StopFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Up implements Service interface
|
// Up implements Service interface
|
||||||
func (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options UpOptions) error {
|
func (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options UpOptions) error {
|
||||||
if s.UpFn == nil {
|
if s.UpFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -184,7 +184,7 @@ func (s *ServiceProxy) Up(ctx context.Context, project *types.Project, options U
|
||||||
return s.UpFn(ctx, project, options)
|
return s.UpFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Down implements Service interface
|
// Down implements Service interface
|
||||||
func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error {
|
func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOptions) error {
|
||||||
if s.DownFn == nil {
|
if s.DownFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -192,15 +192,15 @@ func (s *ServiceProxy) Down(ctx context.Context, project string, options DownOpt
|
||||||
return s.DownFn(ctx, project, options)
|
return s.DownFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Logs implements Service interface
|
// Logs implements Service interface
|
||||||
func (s *ServiceProxy) Logs(ctx context.Context, project string, consumer LogConsumer, options LogOptions) error {
|
func (s *ServiceProxy) Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error {
|
||||||
if s.LogsFn == nil {
|
if s.LogsFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
}
|
}
|
||||||
return s.LogsFn(ctx, project, consumer, options)
|
return s.LogsFn(ctx, projectName, consumer, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ps implements Service interface
|
// Ps implements Service interface
|
||||||
func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error) {
|
func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions) ([]ContainerSummary, error) {
|
||||||
if s.PsFn == nil {
|
if s.PsFn == nil {
|
||||||
return nil, ErrNotImplemented
|
return nil, ErrNotImplemented
|
||||||
|
@ -208,7 +208,7 @@ func (s *ServiceProxy) Ps(ctx context.Context, project string, options PsOptions
|
||||||
return s.PsFn(ctx, project, options)
|
return s.PsFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//List implements Service interface
|
// List implements Service interface
|
||||||
func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error) {
|
func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack, error) {
|
||||||
if s.ListFn == nil {
|
if s.ListFn == nil {
|
||||||
return nil, ErrNotImplemented
|
return nil, ErrNotImplemented
|
||||||
|
@ -216,7 +216,7 @@ func (s *ServiceProxy) List(ctx context.Context, options ListOptions) ([]Stack,
|
||||||
return s.ListFn(ctx, options)
|
return s.ListFn(ctx, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Convert implements Service interface
|
// Convert implements Service interface
|
||||||
func (s *ServiceProxy) Convert(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error) {
|
func (s *ServiceProxy) Convert(ctx context.Context, project *types.Project, options ConvertOptions) ([]byte, error) {
|
||||||
if s.ConvertFn == nil {
|
if s.ConvertFn == nil {
|
||||||
return nil, ErrNotImplemented
|
return nil, ErrNotImplemented
|
||||||
|
@ -227,7 +227,7 @@ func (s *ServiceProxy) Convert(ctx context.Context, project *types.Project, opti
|
||||||
return s.ConvertFn(ctx, project, options)
|
return s.ConvertFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Kill implements Service interface
|
// Kill implements Service interface
|
||||||
func (s *ServiceProxy) Kill(ctx context.Context, project *types.Project, options KillOptions) error {
|
func (s *ServiceProxy) Kill(ctx context.Context, project *types.Project, options KillOptions) error {
|
||||||
if s.KillFn == nil {
|
if s.KillFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -238,7 +238,7 @@ func (s *ServiceProxy) Kill(ctx context.Context, project *types.Project, options
|
||||||
return s.KillFn(ctx, project, options)
|
return s.KillFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//RunOneOffContainer implements Service interface
|
// RunOneOffContainer implements Service interface
|
||||||
func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error) {
|
func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Project, options RunOptions) (int, error) {
|
||||||
if s.RunOneOffContainerFn == nil {
|
if s.RunOneOffContainerFn == nil {
|
||||||
return 0, ErrNotImplemented
|
return 0, ErrNotImplemented
|
||||||
|
@ -249,7 +249,7 @@ func (s *ServiceProxy) RunOneOffContainer(ctx context.Context, project *types.Pr
|
||||||
return s.RunOneOffContainerFn(ctx, project, options)
|
return s.RunOneOffContainerFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remove implements Service interface
|
// Remove implements Service interface
|
||||||
func (s *ServiceProxy) Remove(ctx context.Context, project *types.Project, options RemoveOptions) error {
|
func (s *ServiceProxy) Remove(ctx context.Context, project *types.Project, options RemoveOptions) error {
|
||||||
if s.RemoveFn == nil {
|
if s.RemoveFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -260,7 +260,7 @@ func (s *ServiceProxy) Remove(ctx context.Context, project *types.Project, optio
|
||||||
return s.RemoveFn(ctx, project, options)
|
return s.RemoveFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Exec implements Service interface
|
// Exec implements Service interface
|
||||||
func (s *ServiceProxy) Exec(ctx context.Context, project *types.Project, options RunOptions) (int, error) {
|
func (s *ServiceProxy) Exec(ctx context.Context, project *types.Project, options RunOptions) (int, error) {
|
||||||
if s.ExecFn == nil {
|
if s.ExecFn == nil {
|
||||||
return 0, ErrNotImplemented
|
return 0, ErrNotImplemented
|
||||||
|
@ -271,7 +271,7 @@ func (s *ServiceProxy) Exec(ctx context.Context, project *types.Project, options
|
||||||
return s.ExecFn(ctx, project, options)
|
return s.ExecFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Copy implements Service interface
|
// Copy implements Service interface
|
||||||
func (s *ServiceProxy) Copy(ctx context.Context, project *types.Project, options CopyOptions) error {
|
func (s *ServiceProxy) Copy(ctx context.Context, project *types.Project, options CopyOptions) error {
|
||||||
if s.CopyFn == nil {
|
if s.CopyFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -282,7 +282,7 @@ func (s *ServiceProxy) Copy(ctx context.Context, project *types.Project, options
|
||||||
return s.CopyFn(ctx, project, options)
|
return s.CopyFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Pause implements Service interface
|
// Pause implements Service interface
|
||||||
func (s *ServiceProxy) Pause(ctx context.Context, project string, options PauseOptions) error {
|
func (s *ServiceProxy) Pause(ctx context.Context, project string, options PauseOptions) error {
|
||||||
if s.PauseFn == nil {
|
if s.PauseFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -290,7 +290,7 @@ func (s *ServiceProxy) Pause(ctx context.Context, project string, options PauseO
|
||||||
return s.PauseFn(ctx, project, options)
|
return s.PauseFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//UnPause implements Service interface
|
// UnPause implements Service interface
|
||||||
func (s *ServiceProxy) UnPause(ctx context.Context, project string, options PauseOptions) error {
|
func (s *ServiceProxy) UnPause(ctx context.Context, project string, options PauseOptions) error {
|
||||||
if s.UnPauseFn == nil {
|
if s.UnPauseFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -298,7 +298,7 @@ func (s *ServiceProxy) UnPause(ctx context.Context, project string, options Paus
|
||||||
return s.UnPauseFn(ctx, project, options)
|
return s.UnPauseFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Top implements Service interface
|
// Top implements Service interface
|
||||||
func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error) {
|
func (s *ServiceProxy) Top(ctx context.Context, project string, services []string) ([]ContainerProcSummary, error) {
|
||||||
if s.TopFn == nil {
|
if s.TopFn == nil {
|
||||||
return nil, ErrNotImplemented
|
return nil, ErrNotImplemented
|
||||||
|
@ -306,7 +306,7 @@ func (s *ServiceProxy) Top(ctx context.Context, project string, services []strin
|
||||||
return s.TopFn(ctx, project, services)
|
return s.TopFn(ctx, project, services)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Events implements Service interface
|
// Events implements Service interface
|
||||||
func (s *ServiceProxy) Events(ctx context.Context, project string, options EventsOptions) error {
|
func (s *ServiceProxy) Events(ctx context.Context, project string, options EventsOptions) error {
|
||||||
if s.EventsFn == nil {
|
if s.EventsFn == nil {
|
||||||
return ErrNotImplemented
|
return ErrNotImplemented
|
||||||
|
@ -314,7 +314,7 @@ func (s *ServiceProxy) Events(ctx context.Context, project string, options Event
|
||||||
return s.EventsFn(ctx, project, options)
|
return s.EventsFn(ctx, project, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Port implements Service interface
|
// Port implements Service interface
|
||||||
func (s *ServiceProxy) Port(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error) {
|
func (s *ServiceProxy) Port(ctx context.Context, project string, service string, port int, options PortOptions) (string, int, error) {
|
||||||
if s.PortFn == nil {
|
if s.PortFn == nil {
|
||||||
return "", 0, ErrNotImplemented
|
return "", 0, ErrNotImplemented
|
||||||
|
@ -322,7 +322,7 @@ func (s *ServiceProxy) Port(ctx context.Context, project string, service string,
|
||||||
return s.PortFn(ctx, project, service, port, options)
|
return s.PortFn(ctx, project, service, port, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Images implements Service interface
|
// Images implements Service interface
|
||||||
func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error) {
|
func (s *ServiceProxy) Images(ctx context.Context, project string, options ImagesOptions) ([]ImageSummary, error) {
|
||||||
if s.ImagesFn == nil {
|
if s.ImagesFn == nil {
|
||||||
return nil, ErrNotImplemented
|
return nil, ErrNotImplemented
|
||||||
|
|
|
@ -20,31 +20,47 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/pkg/api"
|
|
||||||
"github.com/docker/docker/api/types"
|
|
||||||
"github.com/docker/docker/pkg/stdcopy"
|
"github.com/docker/docker/pkg/stdcopy"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
|
"github.com/docker/compose-cli/pkg/api"
|
||||||
"github.com/docker/compose-cli/pkg/utils"
|
"github.com/docker/compose-cli/pkg/utils"
|
||||||
|
"github.com/docker/docker/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) Logs(ctx context.Context, projectName string, consumer api.LogConsumer, options api.LogOptions) error {
|
func (s *composeService) Logs(ctx context.Context, projectName string, consumer api.LogConsumer, options api.LogOptions) error {
|
||||||
containers, err := s.getContainers(ctx, projectName, oneOffExclude, true, options.Services...)
|
containers, err := s.getContainers(ctx, projectName, oneOffExclude, true, options.Services...)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
eg, ctx := errgroup.WithContext(ctx)
|
eg, ctx := errgroup.WithContext(ctx)
|
||||||
|
if options.Follow {
|
||||||
|
eg.Go(func() error {
|
||||||
|
printer := newLogPrinter(consumer)
|
||||||
|
return s.watchContainers(projectName, options.Services, printer.HandleEvent, containers, func(c types.Container) error {
|
||||||
|
return s.logContainers(ctx, consumer, c, options)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
service := c.Labels[api.ServiceLabel]
|
c := c
|
||||||
container, err := s.apiClient.ContainerInspect(ctx, c.ID)
|
eg.Go(func() error {
|
||||||
|
return s.logContainers(ctx, consumer, c, options)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return eg.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *composeService) logContainers(ctx context.Context, consumer api.LogConsumer, c types.Container, options api.LogOptions) error {
|
||||||
|
cnt, err := s.apiClient.ContainerInspect(ctx, c.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
name := getContainerNameWithoutProject(c)
|
service := c.Labels[api.ServiceLabel]
|
||||||
eg.Go(func() error {
|
r, err := s.apiClient.ContainerLogs(ctx, cnt.ID, types.ContainerLogsOptions{
|
||||||
r, err := s.apiClient.ContainerLogs(ctx, container.ID, types.ContainerLogsOptions{
|
|
||||||
ShowStdout: true,
|
ShowStdout: true,
|
||||||
ShowStderr: true,
|
ShowStderr: true,
|
||||||
Follow: options.Follow,
|
Follow: options.Follow,
|
||||||
|
@ -58,16 +74,14 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer
|
||||||
}
|
}
|
||||||
defer r.Close() // nolint errcheck
|
defer r.Close() // nolint errcheck
|
||||||
|
|
||||||
|
name := getContainerNameWithoutProject(c)
|
||||||
w := utils.GetWriter(func(line string) {
|
w := utils.GetWriter(func(line string) {
|
||||||
consumer.Log(name, service, line)
|
consumer.Log(name, service, line)
|
||||||
})
|
})
|
||||||
if container.Config.Tty {
|
if cnt.Config.Tty {
|
||||||
_, err = io.Copy(w, r)
|
_, err = io.Copy(w, r)
|
||||||
} else {
|
} else {
|
||||||
_, err = stdcopy.StdCopy(w, w, r)
|
_, err = stdcopy.StdCopy(w, w, r)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
})
|
|
||||||
}
|
|
||||||
return eg.Wait()
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ func (s *composeService) start(ctx context.Context, project *types.Project, opti
|
||||||
}
|
}
|
||||||
|
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
return s.watchContainers(project, options.AttachTo, listener, attached, func(container moby.Container) error {
|
return s.watchContainers(project.Name, options.AttachTo, listener, attached, func(container moby.Container) error {
|
||||||
return s.attachContainer(ctx, container, listener, project)
|
return s.attachContainer(ctx, container, listener, project)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -69,14 +69,14 @@ func (s *composeService) start(ctx context.Context, project *types.Project, opti
|
||||||
type containerWatchFn func(container moby.Container) error
|
type containerWatchFn func(container moby.Container) error
|
||||||
|
|
||||||
// watchContainers uses engine events to capture container start/die and notify ContainerEventListener
|
// watchContainers uses engine events to capture container start/die and notify ContainerEventListener
|
||||||
func (s *composeService) watchContainers(project *types.Project, services []string, listener api.ContainerEventListener, containers Containers, onStart containerWatchFn) error {
|
func (s *composeService) watchContainers(projectName string, services []string, listener api.ContainerEventListener, containers Containers, onStart containerWatchFn) error {
|
||||||
watched := map[string]int{}
|
watched := map[string]int{}
|
||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
watched[c.ID] = 0
|
watched[c.ID] = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, stop := context.WithCancel(context.Background())
|
ctx, stop := context.WithCancel(context.Background())
|
||||||
err := s.Events(ctx, project.Name, api.EventsOptions{
|
err := s.Events(ctx, projectName, api.EventsOptions{
|
||||||
Services: services,
|
Services: services,
|
||||||
Consumer: func(event api.Event) error {
|
Consumer: func(event api.Event) error {
|
||||||
inspected, err := s.apiClient.ContainerInspect(ctx, event.Container)
|
inspected, err := s.apiClient.ContainerInspect(ctx, event.Container)
|
||||||
|
|
Loading…
Reference in New Issue