feat: refactor deployment config (#6347)

This commit is contained in:
Ammar Bandukwala
2023-03-07 15:10:01 -06:00
committed by GitHub
parent bb0a996fc2
commit 3b73321a6c
102 changed files with 5643 additions and 6682 deletions

View File

@ -259,7 +259,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
return err
}
if entitlements.RequireTelemetry && !api.DeploymentConfig.Telemetry.Enable.Value {
if entitlements.RequireTelemetry && !api.DeploymentValues.Telemetry.Enable.Value() {
// We can't fail because then the user couldn't remove the offending
// license w/o a restart.
//
@ -272,8 +272,6 @@ func (api *API) updateEntitlements(ctx context.Context) error {
return nil
}
entitlements.Experimental = api.DeploymentConfig.Experimental.Value || len(api.AGPL.Experiments) != 0
featureChanged := func(featureName codersdk.FeatureName) (changed bool, enabled bool) {
if api.entitlements.Features == nil {
return true, entitlements.Features[featureName].Enabled