mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
fix: allow all environment variables to fallback prefix to HOMEBREW_
(#10050)
See the customer use-case in the code docs.
This commit is contained in:
@ -206,6 +206,26 @@ func TestOptionSet_ParseEnv(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, expected, actual.Value)
|
||||
})
|
||||
|
||||
t.Run("Homebrew", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var agentToken clibase.String
|
||||
|
||||
os := clibase.OptionSet{
|
||||
clibase.Option{
|
||||
Name: "Agent Token",
|
||||
Value: &agentToken,
|
||||
Env: "AGENT_TOKEN",
|
||||
},
|
||||
}
|
||||
|
||||
err := os.ParseEnv([]clibase.EnvVar{
|
||||
{Name: "HOMEBREW_AGENT_TOKEN", Value: "foo"},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, "foo", agentToken)
|
||||
})
|
||||
}
|
||||
|
||||
func TestOptionSet_JsonMarshal(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user