Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coderd/database/databasefake/databasefake.go
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ func (q *fakeQuerier) UpdateTemplateMetaByID(_ context.Context, arg database.Upd
tpl.Name = arg.Name
tpl.Description = arg.Description
tpl.Icon = arg.Icon
tpl.DefaultTtl = arg.DefaultTtl
tpl.DefaultTTL = arg.DefaultTTL
q.templates[idx] = tpl
return tpl, nil
}
Expand Down Expand Up @@ -2236,7 +2236,7 @@ func (q *fakeQuerier) InsertTemplate(_ context.Context, arg database.InsertTempl
Provisioner: arg.Provisioner,
ActiveVersionID: arg.ActiveVersionID,
Description: arg.Description,
DefaultTtl: arg.DefaultTtl,
DefaultTTL: arg.DefaultTTL,
CreatedBy: arg.CreatedBy,
UserACL: arg.UserACL,
GroupACL: arg.GroupACL,
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions coderd/database/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ rename:
user_acl: UserACL
group_acl: GroupACL
troubleshooting_url: TroubleshootingURL
default_ttl: DefaultTTL
10 changes: 5 additions & 5 deletions coderd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (api *API) postTemplateByOrganization(rw http.ResponseWriter, r *http.Reque
Provisioner: importJob.Provisioner,
ActiveVersionID: templateVersion.ID,
Description: createTemplate.Description,
DefaultTtl: int64(ttl),
DefaultTTL: int64(ttl),
CreatedBy: apiKey.UserID,
UserACL: database.TemplateACL{},
GroupACL: database.TemplateACL{
Expand Down Expand Up @@ -473,7 +473,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
if req.Name == template.Name &&
req.Description == template.Description &&
req.Icon == template.Icon &&
req.DefaultTTLMillis == time.Duration(template.DefaultTtl).Milliseconds() {
req.DefaultTTLMillis == time.Duration(template.DefaultTTL).Milliseconds() {
return nil
}

Expand All @@ -496,7 +496,7 @@ func (api *API) patchTemplateMeta(rw http.ResponseWriter, r *http.Request) {
Name: name,
Description: desc,
Icon: icon,
DefaultTtl: int64(maxTTL),
DefaultTTL: int64(maxTTL),
})
if err != nil {
return err
Expand Down Expand Up @@ -640,7 +640,7 @@ func (api *API) autoImportTemplate(ctx context.Context, opts autoImportTemplateO
Provisioner: job.Provisioner,
ActiveVersionID: templateVersion.ID,
Description: "This template was auto-imported by Coder.",
DefaultTtl: 0,
DefaultTTL: 0,
CreatedBy: opts.userID,
UserACL: database.TemplateACL{},
GroupACL: database.TemplateACL{
Expand Down Expand Up @@ -745,7 +745,7 @@ func (api *API) convertTemplate(
BuildTimeStats: buildTimeStats,
Description: template.Description,
Icon: template.Icon,
DefaultTTLMillis: time.Duration(template.DefaultTtl).Milliseconds(),
DefaultTTLMillis: time.Duration(template.DefaultTTL).Milliseconds(),
CreatedByID: template.CreatedBy,
CreatedByName: createdByName,
}
Expand Down
4 changes: 2 additions & 2 deletions coderd/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
return
}

dbTTL, err := validWorkspaceTTLMillis(createWorkspace.TTLMillis, template.DefaultTtl)
dbTTL, err := validWorkspaceTTLMillis(createWorkspace.TTLMillis, template.DefaultTTL)
if err != nil {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Invalid Workspace Time to Shutdown.",
Expand Down Expand Up @@ -729,7 +729,7 @@ func (api *API) putWorkspaceTTL(rw http.ResponseWriter, r *http.Request) {
return xerrors.Errorf("fetch workspace template: %w", err)
}

dbTTL, err = validWorkspaceTTLMillis(req.TTLMillis, template.DefaultTtl)
dbTTL, err = validWorkspaceTTLMillis(req.TTLMillis, template.DefaultTTL)
if err != nil {
return codersdk.ValidationError{Field: "ttl_ms", Detail: err.Error()}
}
Expand Down
2 changes: 1 addition & 1 deletion enterprise/audit/diff_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func Test_diff(t *testing.T) {
Name: "rust",
Provisioner: database.ProvisionerTypeTerraform,
ActiveVersionID: uuid.UUID{3},
DefaultTtl: int64(time.Hour),
DefaultTTL: int64(time.Hour),
CreatedBy: uuid.UUID{4},
},
exp: audit.Map{
Expand Down