Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit f09c6d0

Browse files
committed
Revert "Remove ctx.Context field from Service struct."
Signed-off-by: Josh Curl <[email protected]>
1 parent d81a9bd commit f09c6d0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docker/service/convert.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
composecontainer "github.com/docker/libcompose/docker/container"
1818
"github.com/docker/libcompose/project"
1919
"github.com/docker/libcompose/utils"
20+
// "github.com/docker/libcompose/yaml"
2021
)
2122

2223
// ConfigWrapper wraps Config, HostConfig and NetworkingConfig for a container.

docker/service/service.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/docker/libcompose/docker/ctx"
2323
"github.com/docker/libcompose/docker/image"
2424
"github.com/docker/libcompose/labels"
25-
"github.com/docker/libcompose/logger"
2625
"github.com/docker/libcompose/project"
2726
"github.com/docker/libcompose/project/events"
2827
"github.com/docker/libcompose/project/options"
@@ -37,8 +36,10 @@ type Service struct {
3736
project *project.Project
3837
serviceConfig *config.ServiceConfig
3938
clientFactory composeclient.Factory
40-
loggerFactory logger.Factory
4139
authLookup auth.Lookup
40+
41+
// FIXME(vdemeester) remove this at some point
42+
context *ctx.Context
4243
}
4344

4445
// NewService creates a service
@@ -49,7 +50,7 @@ func NewService(name string, serviceConfig *config.ServiceConfig, context *ctx.C
4950
serviceConfig: serviceConfig,
5051
clientFactory: context.ClientFactory,
5152
authLookup: context.AuthLookup,
52-
loggerFactory: context.LoggerFactory,
53+
context: context,
5354
}
5455
}
5556

@@ -198,7 +199,7 @@ func (s *Service) build(ctx context.Context, buildOptions options.Build) error {
198199
NoCache: buildOptions.NoCache,
199200
ForceRemove: buildOptions.ForceRemove,
200201
Pull: buildOptions.Pull,
201-
LoggerFactory: s.loggerFactory,
202+
LoggerFactory: s.context.LoggerFactory,
202203
}
203204
return builder.Build(ctx, s.imageName())
204205
}
@@ -584,7 +585,7 @@ func (s *Service) Log(ctx context.Context, follow bool) error {
584585
if s.Config().ContainerName != "" {
585586
name = s.Config().ContainerName
586587
}
587-
l := s.loggerFactory.CreateContainerLogger(name)
588+
l := s.context.LoggerFactory.CreateContainerLogger(name)
588589
return c.Log(ctx, l, follow)
589590
})
590591
}

0 commit comments

Comments
 (0)