mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: add support for telemetry-required licenses (#6194)
This commit is contained in:
@ -254,6 +254,17 @@ func (api *API) updateEntitlements(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if entitlements.RequireTelemetry && !api.DeploymentConfig.Telemetry.Enable.Value {
|
||||
// We can't fail because then the user couldn't remove the offending
|
||||
// license w/o a restart.
|
||||
api.entitlements.Errors = []string{
|
||||
"License requires telemetry but telemetry is disabled",
|
||||
}
|
||||
api.Logger.Error(ctx, "license requires telemetry enabled")
|
||||
return nil
|
||||
}
|
||||
|
||||
entitlements.Experimental = api.DeploymentConfig.Experimental.Value || len(api.AGPL.Experiments) != 0
|
||||
|
||||
featureChanged := func(featureName codersdk.FeatureName) (changed bool, enabled bool) {
|
||||
|
Reference in New Issue
Block a user