Skip to content

Commit e8c1315

Browse files
committed
make fmt
1 parent 73921aa commit e8c1315

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

codersdk/deployment_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ func (f *featureVariants) variant(new func(f *codersdk.Feature)) {
429429
new(&cpy)
430430
newVariants = append(newVariants, v, cpy)
431431
}
432+
f.variants = newVariants
432433
}
433434

434435
func (f *featureVariants) Features() []codersdk.Feature {

enterprise/coderd/license/license.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func Entitlements(
4646
ReplicaCount: replicaCount,
4747
ExternalAuthCount: externalAuthCount,
4848
})
49+
if err != nil {
50+
return entitlements, err
51+
}
4952

5053
return entitlements, nil
5154
}
@@ -73,7 +76,6 @@ func LicensesEntitlements(
7376
keys map[string]ed25519.PublicKey,
7477
featureArguments FeatureArguments,
7578
) (codersdk.Entitlements, error) {
76-
7779
// Default all entitlements to be disabled.
7880
entitlements := codersdk.Entitlements{
7981
Features: map[codersdk.FeatureName]codersdk.Feature{
@@ -374,17 +376,6 @@ func keyFunc(keys map[string]ed25519.PublicKey) func(*jwt.Token) (interface{}, e
374376
}
375377
}
376378

377-
// maxEntitlement is the "greater" entitlement between the given values
378-
func maxEntitlement(e1, e2 codersdk.Entitlement) codersdk.Entitlement {
379-
if e1 == codersdk.EntitlementEntitled || e2 == codersdk.EntitlementEntitled {
380-
return codersdk.EntitlementEntitled
381-
}
382-
if e1 == codersdk.EntitlementGracePeriod || e2 == codersdk.EntitlementGracePeriod {
383-
return codersdk.EntitlementGracePeriod
384-
}
385-
return codersdk.EntitlementNotEntitled
386-
}
387-
388379
// licenseExpirationWarning adds a warning message if the license is expiring soon.
389380
func licenseExpirationWarning(entitlements *codersdk.Entitlements, now time.Time, claims *Claims) {
390381
// Add warning if license is expiring soon

enterprise/coderd/license/testdata/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Licensing in Coderd defines what features are allowed to be used by a given deployment. Without a license, or with a license that grants 0 features, Coderd will refuse to execute code paths for some features. These features are typically gated with a middleware that checks the license before allowing the request to proceed.
44

5-
65
## Terms
76

87
- **Feature**: A specific functionality that Coderd provides, such as external provisioners. Features are defined in the `Feature` enum in [`codersdk/deployment.go`](https://github.com/coder/coder/blob/main/codersdk/deployment.go#L36-L60). A feature can be "entitled", "grace period", or "not entitled". Additionally, a feature can be "disabled" that prevents usage of the feature even if the deployment is entitled to it. Disabled features are a configuration option by the deployment operator.

0 commit comments

Comments
 (0)