Skip to content

Commit 4bbc6c6

Browse files
gloursndeloof
authored andcommitted
add USER_AGENT variable to cmd when shellouting
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 69f1430 commit 4bbc6c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/compose/shellout.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/compose-spec/compose-go/v2/types"
2424
"github.com/docker/cli/cli-plugins/manager"
2525
"github.com/docker/cli/cli/context/docker"
26+
"github.com/docker/compose/v2/internal"
2627
"go.opentelemetry.io/otel"
2728
"go.opentelemetry.io/otel/propagation"
2829
)
@@ -41,6 +42,7 @@ func (s *composeService) prepareShellOut(gctx context.Context, project *types.Pr
4142
env.Merge(types.Mapping(carrier))
4243

4344
env["DOCKER_CONTEXT"] = s.dockerCli.CurrentContext()
45+
env["USER_AGENT"] = "compose/" + internal.Version
4446

4547
metadata, err := s.dockerCli.ContextStore().GetMetadata(s.dockerCli.CurrentContext())
4648
if err != nil {

0 commit comments

Comments
 (0)