Skip to content

Commit 4108feb

Browse files
Benehikovvoland
authored andcommitted
rename function to fit what it is doing
Signed-off-by: Alano Terblanche <[email protected]> (cherry picked from commit 6163c03) Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 8cfe1f7 commit 4108feb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cli/command/cli.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption)
284284

285285
meta, err := cli.contextStore.GetMetadata(cli.currentContext)
286286
if err == nil {
287-
setAllowNegativex509(meta)
287+
setGoDebug(meta)
288288
}
289289

290290
return nil
@@ -480,7 +480,7 @@ func (cli *DockerCli) getDockerEndPoint() (ep docker.Endpoint, err error) {
480480
return resolveDockerEndpoint(cli.contextStore, cn)
481481
}
482482

483-
// setAllowNegativex509 is an escape hatch that sets the GODEBUG environment
483+
// setGoDebug is an escape hatch that sets the GODEBUG environment
484484
// variable value using docker context metadata.
485485
//
486486
// {
@@ -497,7 +497,7 @@ func (cli *DockerCli) getDockerEndPoint() (ep docker.Endpoint, err error) {
497497
// This option should only be used for legacy compatibility and never in
498498
// production environments.
499499
// Use at your own risk.
500-
func setAllowNegativex509(meta store.Metadata) {
500+
func setGoDebug(meta store.Metadata) {
501501
fieldName := "GODEBUG"
502502
godebugEnv := os.Getenv(fieldName)
503503
// early return if GODEBUG is already set. We don't want to override what

cli/command/cli_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ func TestHooksEnabled(t *testing.T) {
355355
})
356356
}
357357

358-
func TestAllowNegativex509(t *testing.T) {
358+
func TestSetGoDebug(t *testing.T) {
359359
t.Run("GODEBUG already set", func(t *testing.T) {
360360
t.Setenv("GODEBUG", "val1,val2")
361361
meta := store.Metadata{}
362-
setAllowNegativex509(meta)
362+
setGoDebug(meta)
363363
assert.Equal(t, "val1,val2", os.Getenv("GODEBUG"))
364364
})
365365
t.Run("GODEBUG in context metadata can set env", func(t *testing.T) {
@@ -370,7 +370,7 @@ func TestAllowNegativex509(t *testing.T) {
370370
},
371371
},
372372
}
373-
setAllowNegativex509(meta)
373+
setGoDebug(meta)
374374
assert.Equal(t, "val1,val2=1", os.Getenv("GODEBUG"))
375375
})
376376
}

0 commit comments

Comments
 (0)