Skip to content

Commit 5e4931e

Browse files
authored
chore: add comment that explains require_telemetry behavior (#6211)
1 parent 5e60879 commit 5e4931e

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

enterprise/coderd/coderd.go

+14-9
Original file line numberDiff line numberDiff line change
@@ -242,22 +242,27 @@ func (api *API) updateEntitlements(ctx context.Context) error {
242242
api.entitlementsMu.Lock()
243243
defer api.entitlementsMu.Unlock()
244244

245-
entitlements, err := license.Entitlements(ctx, api.Database, api.Logger, len(api.replicaManager.All()), len(api.GitAuthConfigs), api.Keys, map[codersdk.FeatureName]bool{
246-
codersdk.FeatureAuditLog: api.AuditLogging,
247-
codersdk.FeatureBrowserOnly: api.BrowserOnly,
248-
codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0,
249-
codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "",
250-
codersdk.FeatureMultipleGitAuth: len(api.GitAuthConfigs) > 1,
251-
codersdk.FeatureTemplateRBAC: api.RBAC,
252-
codersdk.FeatureExternalProvisionerDaemons: true,
253-
})
245+
entitlements, err := license.Entitlements(
246+
ctx, api.Database,
247+
api.Logger, len(api.replicaManager.All()), len(api.GitAuthConfigs), api.Keys, map[codersdk.FeatureName]bool{
248+
codersdk.FeatureAuditLog: api.AuditLogging,
249+
codersdk.FeatureBrowserOnly: api.BrowserOnly,
250+
codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0,
251+
codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "",
252+
codersdk.FeatureMultipleGitAuth: len(api.GitAuthConfigs) > 1,
253+
codersdk.FeatureTemplateRBAC: api.RBAC,
254+
codersdk.FeatureExternalProvisionerDaemons: true,
255+
})
254256
if err != nil {
255257
return err
256258
}
257259

258260
if entitlements.RequireTelemetry && !api.DeploymentConfig.Telemetry.Enable.Value {
259261
// We can't fail because then the user couldn't remove the offending
260262
// license w/o a restart.
263+
//
264+
// We don't simply append to entitlement.Errors since we don't want any
265+
// enterprise features enabled.
261266
api.entitlements.Errors = []string{
262267
"License requires telemetry but telemetry is disabled",
263268
}

0 commit comments

Comments
 (0)