Skip to content

Commit a99835b

Browse files
committed
chore: add comment that explains require_telemetry behavior
1 parent 9f1fe2e commit a99835b

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

enterprise/coderd/coderd.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,22 +240,27 @@ func (api *API) updateEntitlements(ctx context.Context) error {
240240
api.entitlementsMu.Lock()
241241
defer api.entitlementsMu.Unlock()
242242

243-
entitlements, err := license.Entitlements(ctx, api.Database, api.Logger, len(api.replicaManager.All()), len(api.GitAuthConfigs), api.Keys, map[codersdk.FeatureName]bool{
244-
codersdk.FeatureAuditLog: api.AuditLogging,
245-
codersdk.FeatureBrowserOnly: api.BrowserOnly,
246-
codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0,
247-
codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "",
248-
codersdk.FeatureMultipleGitAuth: len(api.GitAuthConfigs) > 1,
249-
codersdk.FeatureTemplateRBAC: api.RBAC,
250-
codersdk.FeatureExternalProvisionerDaemons: true,
251-
})
243+
entitlements, err := license.Entitlements(
244+
ctx, api.Database,
245+
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+
})
252254
if err != nil {
253255
return err
254256
}
255257

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

0 commit comments

Comments
 (0)