mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
fix: use pointer receivers for composeService methods with sync.Once fields
Moving runtimeVersionCache from a package-level var to instance fields on composeService caused copylocks violations in methods using value receivers, since sync.Once contains sync.noCopy. Switch the 4 affected methods to pointer receivers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
This commit is contained in:
parent
5f6f35ed22
commit
c7d1a6030e
2 changed files with 4 additions and 4 deletions
|
|
@ -568,7 +568,7 @@ func dockerFilePath(ctxName string, dockerfile string) string {
|
|||
return dockerfile
|
||||
}
|
||||
|
||||
func (s composeService) dryRunBake(cfg bakeConfig) map[string]string {
|
||||
func (s *composeService) dryRunBake(cfg bakeConfig) map[string]string {
|
||||
bakeResponse := map[string]string{}
|
||||
for name, target := range cfg.Targets {
|
||||
dryRunUUID := fmt.Sprintf("dryRun-%x", sha1.Sum([]byte(name)))
|
||||
|
|
@ -581,7 +581,7 @@ func (s composeService) dryRunBake(cfg bakeConfig) map[string]string {
|
|||
return bakeResponse
|
||||
}
|
||||
|
||||
func (s composeService) displayDryRunBuildEvent(name, dryRunUUID, tag string) {
|
||||
func (s *composeService) displayDryRunBuildEvent(name, dryRunUUID, tag string) {
|
||||
s.events.On(api.Resource{
|
||||
ID: name + " ==>",
|
||||
Status: api.Done,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import (
|
|||
"github.com/docker/compose/v5/pkg/utils"
|
||||
)
|
||||
|
||||
func (s composeService) runHook(ctx context.Context, ctr container.Summary, service types.ServiceConfig, hook types.ServiceHook, listener api.ContainerEventListener) error {
|
||||
func (s *composeService) runHook(ctx context.Context, ctr container.Summary, service types.ServiceConfig, hook types.ServiceHook, listener api.ContainerEventListener) error {
|
||||
wOut := utils.GetWriter(func(line string) {
|
||||
listener(api.ContainerEvent{
|
||||
Type: api.HookEventLog,
|
||||
|
|
@ -96,7 +96,7 @@ func (s composeService) runHook(ctx context.Context, ctr container.Summary, serv
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s composeService) runWaitExec(ctx context.Context, execID string, service types.ServiceConfig, listener api.ContainerEventListener) error {
|
||||
func (s *composeService) runWaitExec(ctx context.Context, execID string, service types.ServiceConfig, listener api.ContainerEventListener) error {
|
||||
_, err := s.apiClient().ExecStart(ctx, execID, client.ExecStartOptions{
|
||||
Detach: listener == nil,
|
||||
TTY: service.Tty,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue