Skip to content

Commit b9e15ef

Browse files
Benehikovvoland
authored andcommitted
return early if GODEBUG set or context is default
Signed-off-by: Alano Terblanche <[email protected]> (cherry picked from commit 72f7933) Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 4108feb commit b9e15ef

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
@@ -282,6 +282,12 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption)
282282
}
283283
filterResourceAttributesEnvvar()
284284

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

0 commit comments

Comments
 (0)