@@ -19,6 +19,7 @@ package compose
1919import (
2020 "context"
2121 "encoding/json"
22+ "errors"
2223 "fmt"
2324 "io"
2425 "os"
@@ -30,7 +31,6 @@ import (
3031 "github.com/docker/cli/cli-plugins/socket"
3132 "github.com/docker/compose/v2/pkg/progress"
3233 "github.com/docker/docker/errdefs"
33- "github.com/pkg/errors"
3434 "github.com/spf13/cobra"
3535 "go.opentelemetry.io/otel"
3636 "go.opentelemetry.io/otel/propagation"
@@ -48,8 +48,8 @@ const (
4848 SetEnvType = "setenv"
4949)
5050
51- func (s * composeService ) runPlugin (ctx context.Context , project * types.Project , service types.ServiceConfig , command string ) error {
52- x := * service .External
51+ func (s * composeService ) runPlugin (ctx context.Context , project * types.Project , service types.ServiceConfig , command string ) error { //nolint:gocyclo
52+ x := * service .Provider
5353
5454 // Only support Docker CLI plugins for first iteration. Could support any binary from PATH
5555 plugin , err := manager .GetPlugin (x .Type , s .dockerCli , & cobra.Command {})
@@ -97,7 +97,7 @@ func (s *composeService) runPlugin(ctx context.Context, project *types.Project,
9797 eg .Go (cmd .Wait )
9898
9999 decoder := json .NewDecoder (stdout )
100- defer stdout .Close ()
100+ defer func () { _ = stdout .Close () } ()
101101
102102 variables := types.Mapping {}
103103
@@ -106,7 +106,7 @@ func (s *composeService) runPlugin(ctx context.Context, project *types.Project,
106106 for {
107107 var msg JsonMessage
108108 err = decoder .Decode (& msg )
109- if err == io .EOF {
109+ if errors . Is ( err , io .EOF ) {
110110 break
111111 }
112112 if err != nil {
@@ -132,7 +132,7 @@ func (s *composeService) runPlugin(ctx context.Context, project *types.Project,
132132 err = eg .Wait ()
133133 if err != nil {
134134 pw .Event (progress .ErrorMessageEvent (service .Name , err .Error ()))
135- return errors . Wrapf ( err , "failed to create external service" )
135+ return fmt . Errorf ( "failed to create external service: %s" , err . Error () )
136136 }
137137 pw .Event (progress .CreatedEvent (service .Name ))
138138
0 commit comments