Przeglądaj źródła

use compose service methods when exist instead of directly service.dockerCli

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours 2 lat temu
rodzic
commit
5a2b7b83cd
3 zmienionych plików z 3 dodań i 3 usunięć
  1. 1 1
      pkg/compose/attach.go
  2. 1 1
      pkg/compose/pull.go
  3. 1 1
      pkg/compose/run.go

+ 1 - 1
pkg/compose/attach.go

@@ -86,7 +86,7 @@ func (s *composeService) attachContainer(ctx context.Context, container moby.Con
 		})
 	})
 
-	inspect, err := s.dockerCli.Client().ContainerInspect(ctx, container.ID)
+	inspect, err := s.apiClient().ContainerInspect(ctx, container.ID)
 	if err != nil {
 		return err
 	}

+ 1 - 1
pkg/compose/pull.go

@@ -235,7 +235,7 @@ func (s *composeService) pullServiceImage(ctx context.Context, service types.Ser
 		Text:   "Pulled",
 	})
 
-	inspected, _, err := s.dockerCli.Client().ImageInspectWithRaw(ctx, service.Image)
+	inspected, _, err := s.apiClient().ImageInspectWithRaw(ctx, service.Image)
 	if err != nil {
 		return "", err
 	}

+ 1 - 1
pkg/compose/run.go

@@ -56,7 +56,7 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
 
 	applyRunOptions(project, &service, opts)
 
-	if err := s.dockerCli.In().CheckTty(opts.Interactive, service.Tty); err != nil {
+	if err := s.stdin().CheckTty(opts.Interactive, service.Tty); err != nil {
 		return "", err
 	}