mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: add template max_ttl (#6114)
Co-authored-by: Bruno Quaresma <bruno@coder.com>
This commit is contained in:
@ -21,6 +21,7 @@ import (
|
||||
"github.com/coder/coder/coderd/httpapi"
|
||||
"github.com/coder/coder/coderd/httpmw"
|
||||
"github.com/coder/coder/coderd/rbac"
|
||||
"github.com/coder/coder/coderd/schedule"
|
||||
"github.com/coder/coder/codersdk"
|
||||
"github.com/coder/coder/enterprise/coderd/license"
|
||||
"github.com/coder/coder/enterprise/derpmesh"
|
||||
@ -252,6 +253,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
|
||||
codersdk.FeatureMultipleGitAuth: len(api.GitAuthConfigs) > 1,
|
||||
codersdk.FeatureTemplateRBAC: api.RBAC,
|
||||
codersdk.FeatureExternalProvisionerDaemons: true,
|
||||
codersdk.FeatureAdvancedTemplateScheduling: true,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@ -310,6 +312,17 @@ func (api *API) updateEntitlements(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
if changed, enabled := featureChanged(codersdk.FeatureAdvancedTemplateScheduling); changed {
|
||||
if enabled {
|
||||
store := &enterpriseTemplateScheduleStore{}
|
||||
ptr := schedule.TemplateScheduleStore(store)
|
||||
api.AGPL.TemplateScheduleStore.Store(&ptr)
|
||||
} else {
|
||||
store := schedule.NewAGPLTemplateScheduleStore()
|
||||
api.AGPL.TemplateScheduleStore.Store(&store)
|
||||
}
|
||||
}
|
||||
|
||||
if changed, enabled := featureChanged(codersdk.FeatureHighAvailability); changed {
|
||||
coordinator := agpltailnet.NewCoordinator()
|
||||
if enabled {
|
||||
|
Reference in New Issue
Block a user