mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: allow templates to specify max_ttl or autostop_requirement (#10920)
This commit is contained in:
@ -35,22 +35,21 @@ const (
|
||||
type FeatureName string
|
||||
|
||||
const (
|
||||
FeatureUserLimit FeatureName = "user_limit"
|
||||
FeatureAuditLog FeatureName = "audit_log"
|
||||
FeatureBrowserOnly FeatureName = "browser_only"
|
||||
FeatureSCIM FeatureName = "scim"
|
||||
FeatureTemplateRBAC FeatureName = "template_rbac"
|
||||
FeatureUserRoleManagement FeatureName = "user_role_management"
|
||||
FeatureHighAvailability FeatureName = "high_availability"
|
||||
FeatureMultipleExternalAuth FeatureName = "multiple_external_auth"
|
||||
FeatureExternalProvisionerDaemons FeatureName = "external_provisioner_daemons"
|
||||
FeatureAppearance FeatureName = "appearance"
|
||||
FeatureAdvancedTemplateScheduling FeatureName = "advanced_template_scheduling"
|
||||
FeatureWorkspaceProxy FeatureName = "workspace_proxy"
|
||||
FeatureExternalTokenEncryption FeatureName = "external_token_encryption"
|
||||
FeatureTemplateAutostopRequirement FeatureName = "template_autostop_requirement"
|
||||
FeatureWorkspaceBatchActions FeatureName = "workspace_batch_actions"
|
||||
FeatureAccessControl FeatureName = "access_control"
|
||||
FeatureUserLimit FeatureName = "user_limit"
|
||||
FeatureAuditLog FeatureName = "audit_log"
|
||||
FeatureBrowserOnly FeatureName = "browser_only"
|
||||
FeatureSCIM FeatureName = "scim"
|
||||
FeatureTemplateRBAC FeatureName = "template_rbac"
|
||||
FeatureUserRoleManagement FeatureName = "user_role_management"
|
||||
FeatureHighAvailability FeatureName = "high_availability"
|
||||
FeatureMultipleExternalAuth FeatureName = "multiple_external_auth"
|
||||
FeatureExternalProvisionerDaemons FeatureName = "external_provisioner_daemons"
|
||||
FeatureAppearance FeatureName = "appearance"
|
||||
FeatureAdvancedTemplateScheduling FeatureName = "advanced_template_scheduling"
|
||||
FeatureWorkspaceProxy FeatureName = "workspace_proxy"
|
||||
FeatureExternalTokenEncryption FeatureName = "external_token_encryption"
|
||||
FeatureWorkspaceBatchActions FeatureName = "workspace_batch_actions"
|
||||
FeatureAccessControl FeatureName = "access_control"
|
||||
)
|
||||
|
||||
// FeatureNames must be kept in-sync with the Feature enum above.
|
||||
@ -65,11 +64,9 @@ var FeatureNames = []FeatureName{
|
||||
FeatureExternalProvisionerDaemons,
|
||||
FeatureAppearance,
|
||||
FeatureAdvancedTemplateScheduling,
|
||||
FeatureTemplateAutostopRequirement,
|
||||
FeatureWorkspaceProxy,
|
||||
FeatureUserRoleManagement,
|
||||
FeatureExternalTokenEncryption,
|
||||
FeatureTemplateAutostopRequirement,
|
||||
FeatureWorkspaceBatchActions,
|
||||
FeatureAccessControl,
|
||||
}
|
||||
@ -1816,10 +1813,10 @@ Write out the current server config as YAML to stdout.`,
|
||||
},
|
||||
{
|
||||
Name: "Default Quiet Hours Schedule",
|
||||
Description: "The default daily cron schedule applied to users that haven't set a custom quiet hours schedule themselves. The quiet hours schedule determines when workspaces will be force stopped due to the template's max TTL, and will round the max TTL up to be within the user's quiet hours window (or default). The format is the same as the standard cron format, but the day-of-month, month and day-of-week must be *. Only one hour and minute can be specified (ranges or comma separated values are not supported).",
|
||||
Description: "The default daily cron schedule applied to users that haven't set a custom quiet hours schedule themselves. The quiet hours schedule determines when workspaces will be force stopped due to the template's autostop requirement, and will round the max deadline up to be within the user's quiet hours window (or default). The format is the same as the standard cron format, but the day-of-month, month and day-of-week must be *. Only one hour and minute can be specified (ranges or comma separated values are not supported).",
|
||||
Flag: "default-quiet-hours-schedule",
|
||||
Env: "CODER_QUIET_HOURS_DEFAULT_SCHEDULE",
|
||||
Default: "",
|
||||
Default: "CRON_TZ=UTC 0 0 * * *",
|
||||
Value: &c.UserQuietHoursSchedule.DefaultSchedule,
|
||||
Group: &deploymentGroupUserQuietHoursSchedule,
|
||||
YAML: "defaultQuietHoursSchedule",
|
||||
@ -2071,20 +2068,6 @@ const (
|
||||
// single tailnet for each agent.
|
||||
ExperimentSingleTailnet Experiment = "single_tailnet"
|
||||
|
||||
// ExperimentTemplateAutostopRequirement allows template admins to have more
|
||||
// control over when workspaces created on a template are required to
|
||||
// stop, and allows users to ensure these restarts never happen during their
|
||||
// business hours.
|
||||
//
|
||||
// This will replace the MaxTTL setting on templates.
|
||||
//
|
||||
// Enables:
|
||||
// - User quiet hours schedule settings
|
||||
// - Template autostop requirement settings
|
||||
// - Changes the max_deadline algorithm to use autostop requirement and user
|
||||
// quiet hours instead of max_ttl.
|
||||
ExperimentTemplateAutostopRequirement Experiment = "template_autostop_requirement"
|
||||
|
||||
// Deployment health page
|
||||
ExperimentDeploymentHealthPage Experiment = "deployment_health_page"
|
||||
|
||||
|
Reference in New Issue
Block a user