rename function to fit what it is doing

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
Alano Terblanche
2025-08-29 14:08:15 +02:00
parent 467305fcea
commit 6163c03b11
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -283,7 +283,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...CLIOption)
meta, err := cli.contextStore.GetMetadata(cli.currentContext)
if err == nil {
setAllowNegativex509(meta)
setGoDebug(meta)
}
return nil
@@ -479,7 +479,7 @@ func (cli *DockerCli) getDockerEndPoint() (ep docker.Endpoint, err error) {
return resolveDockerEndpoint(cli.contextStore, cn)
}
// setAllowNegativex509 is an escape hatch that sets the GODEBUG environment
// setGoDebug is an escape hatch that sets the GODEBUG environment
// variable value using docker context metadata.
//
// {
@@ -496,7 +496,7 @@ func (cli *DockerCli) getDockerEndPoint() (ep docker.Endpoint, err error) {
// This option should only be used for legacy compatibility and never in
// production environments.
// Use at your own risk.
func setAllowNegativex509(meta store.Metadata) {
func setGoDebug(meta store.Metadata) {
fieldName := "GODEBUG"
godebugEnv := os.Getenv(fieldName)
// early return if GODEBUG is already set. We don't want to override what
+3 -3
View File
@@ -354,11 +354,11 @@ func TestHooksEnabled(t *testing.T) {
})
}
func TestAllowNegativex509(t *testing.T) {
func TestSetGoDebug(t *testing.T) {
t.Run("GODEBUG already set", func(t *testing.T) {
t.Setenv("GODEBUG", "val1,val2")
meta := store.Metadata{}
setAllowNegativex509(meta)
setGoDebug(meta)
assert.Equal(t, "val1,val2", os.Getenv("GODEBUG"))
})
t.Run("GODEBUG in context metadata can set env", func(t *testing.T) {
@@ -369,7 +369,7 @@ func TestAllowNegativex509(t *testing.T) {
},
},
}
setAllowNegativex509(meta)
setGoDebug(meta)
assert.Equal(t, "val1,val2=1", os.Getenv("GODEBUG"))
})
}