Skip to content

fix!: support empty or default fields when updating templates #19256

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

Merged
merged 8 commits into from
Aug 12, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix pointer issues in tests
  • Loading branch information
rafrdz committed Aug 8, 2025
commit 0665980611c9b236a1ab18dd429f9c1d3ad6cbb4
12 changes: 6 additions & 6 deletions enterprise/cli/templateedit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func TestTemplateEdit(t *testing.T) {
var (
expectedName = "template"
expectedDisplayName = "template_display"
expectedDescription = ptr.Ref("My description")
expectedIcon = ptr.Ref("icon.pjg")
expectedDescription = "My description"
expectedIcon = "icon.pjg"
expectedDefaultTTLMillis = time.Hour.Milliseconds()
expectedAllowAutostart = false
expectedAllowAutostop = false
Expand Down Expand Up @@ -220,8 +220,8 @@ func TestTemplateEdit(t *testing.T) {
template, err := ownerClient.UpdateTemplateMeta(ctx, dbtemplate.ID, codersdk.UpdateTemplateMeta{
Name: expectedName,
DisplayName: expectedDisplayName,
Description: expectedDescription,
Icon: expectedIcon,
Description: &expectedDescription,
Icon: &expectedIcon,
DefaultTTLMillis: expectedDefaultTTLMillis,
AllowUserAutostop: expectedAllowAutostop,
AllowUserAutostart: expectedAllowAutostart,
Expand Down Expand Up @@ -268,8 +268,8 @@ func TestTemplateEdit(t *testing.T) {
template, err = ownerClient.UpdateTemplateMeta(ctx, dbtemplate.ID, codersdk.UpdateTemplateMeta{
Name: expectedName,
DisplayName: expectedDisplayName,
Description: expectedDescription,
Icon: expectedIcon,
Description: &expectedDescription,
Icon: &expectedIcon,
DefaultTTLMillis: expectedDefaultTTLMillis,
AllowUserAutostop: expectedAllowAutostop,
AllowUserAutostart: expectedAllowAutostart,
Expand Down
Loading