Skip to content

Commit 72f7933

Browse files
committed
return early if GODEBUG set or context is default
Signed-off-by: Alano Terblanche <[email protected]>
1 parent 6163c03 commit 72f7933

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/command/cli.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption)
281281
}
282282
filterResourceAttributesEnvvar()
283283

284+
// early return if GODEBUG is already set or the docker context is
285+
// the default context, i.e. is a virtual context where we won't override
286+
// any GODEBUG values.
287+
if v := os.Getenv("GODEBUG"); cli.currentContext == DefaultContextName || v != "" {
288+
return nil
289+
}
284290
meta, err := cli.contextStore.GetMetadata(cli.currentContext)
285291
if err == nil {
286292
setGoDebug(meta)

0 commit comments

Comments
 (0)