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:
Steven Masley
2023-04-05 17:47:40 +00:00
committed by GitHub
parent 00d468b964
commit a361673ad8
+7
View File
@@ -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)
}