mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add experimental flag (#4364)
This commit is contained in:
@@ -68,5 +68,6 @@ func TestFeaturesList(t *testing.T) {
|
||||
assert.Equal(t, codersdk.EntitlementNotEntitled,
|
||||
entitlements.Features[codersdk.FeatureWorkspaceQuota].Entitlement)
|
||||
assert.False(t, entitlements.HasLicense)
|
||||
assert.False(t, entitlements.Experimental)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -346,8 +346,9 @@ func (*fakeLicenseAPI) entitlements(rw http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.Entitlements{
|
||||
Features: features,
|
||||
Warnings: []string{testWarning},
|
||||
HasLicense: true,
|
||||
Features: features,
|
||||
Warnings: []string{testWarning},
|
||||
HasLicense: true,
|
||||
Experimental: true,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -237,9 +237,10 @@ func (api *API) serveEntitlements(rw http.ResponseWriter, r *http.Request) {
|
||||
api.entitlementsMu.RUnlock()
|
||||
|
||||
resp := codersdk.Entitlements{
|
||||
Features: make(map[string]codersdk.Feature),
|
||||
Warnings: make([]string, 0),
|
||||
HasLicense: entitlements.hasLicense,
|
||||
Features: make(map[string]codersdk.Feature),
|
||||
Warnings: make([]string, 0),
|
||||
HasLicense: entitlements.hasLicense,
|
||||
Experimental: api.Experimental,
|
||||
}
|
||||
|
||||
if entitlements.activeUsers.Limit != nil {
|
||||
|
||||
Reference in New Issue
Block a user