mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Include 'CODER' env var prefix on group mappings (#7015)
* fix: Include 'CODER' env var prefix on group mappings * Unit test to force CODER prefix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package codersdk_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -101,6 +102,12 @@ func TestDeploymentValues_HighlyConfigurable(t *testing.T) {
|
||||
t.Errorf("Option %q is excluded but has an env name", opt.Name)
|
||||
}
|
||||
|
||||
// Also check all env vars are prefixed with CODER_
|
||||
const prefix = "CODER_"
|
||||
if opt.Env != "" && !strings.HasPrefix(opt.Env, prefix) {
|
||||
t.Errorf("Option %q has an env name (%q) that is not prefixed with %s", opt.Name, opt.Env, prefix)
|
||||
}
|
||||
|
||||
delete(excludes, opt.Name)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user