mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix: template: enforce bounds of template max_ttl (#3662)
This PR makes the following changes: - enforces lower and upper limits on template `max_ttl_ms` - adds a migration to enforce 7-day cap on `max_ttl` - allows setting template `max_ttl` to 0 - updates template edit CLI help to be clearer
This commit is contained in:
@ -1564,10 +1564,6 @@ func (q *fakeQuerier) InsertTemplate(_ context.Context, arg database.InsertTempl
|
||||
q.mutex.Lock()
|
||||
defer q.mutex.Unlock()
|
||||
|
||||
// default values
|
||||
if arg.MaxTtl == 0 {
|
||||
arg.MaxTtl = int64(168 * time.Hour)
|
||||
}
|
||||
if arg.MinAutostartInterval == 0 {
|
||||
arg.MinAutostartInterval = int64(time.Hour)
|
||||
}
|
||||
|
Reference in New Issue
Block a user