-
Notifications
You must be signed in to change notification settings - Fork 887
feat: enforce template-level constraints for TTL and autostart #2018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1713431
f11f942
c5c9a7a
74f4dee
7da27a0
5ad048b
65b980e
aa298a6
a5ec9bf
a6255d6
245795e
709db5b
c4a0927
244e479
60ef479
c9aab8b
f997af2
d7f697b
ebe4c15
08ef2eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,15 @@ type CreateTemplateRequest struct { | |
// templates, but it doesn't make sense for users. | ||
VersionID uuid.UUID `json:"template_version_id" validate:"required"` | ||
ParameterValues []CreateParameterRequest `json:"parameter_values,omitempty"` | ||
|
||
// MaxTTLMillis allows optionally specifying the maximum allowable TTL | ||
// for all workspaces created from this template. | ||
MaxTTLMillis *int64 `json:"max_ttl_ms,omitempty"` | ||
|
||
// MinAutostartIntervalMillis allows optionally specifying the minimum | ||
// allowable duration between autostarts for all workspaces created from | ||
// this template. | ||
MinAutostartIntervalMillis *int64 `json:"min_autostart_interval_ms,omitempty"` | ||
Comment on lines
+65
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making these optional in creation; if preferred I can make them mandatory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this so you don't have some autostart config that says start my workspace every minute? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thought: Can we make he zero values useful here? Or can these be set to zero to disable them entirely? If zero doesn't need to disable, we can treat it as not set, avoiding the use of pointers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FE prefers to consume null instead of zero-values; hence the pointers. |
||
} | ||
|
||
// CreateWorkspaceRequest provides options for creating a new workspace. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question(gut-check): Should there be a similar case for AboveTemplateConstraint ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any reason to enforce an upper bound on the interval between successive autostarts.