Skip to content

fix: prevent change in defaults if user unsets in template edit #10793

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 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
Merge remote-tracking branch 'origin/main' into stevenmasley/template…
…_edit_unset
  • Loading branch information
Emyrk committed Nov 20, 2023
commit ebc5110fc0007ca0ca58e9ee508337900c7daabf
5 changes: 5 additions & 0 deletions cli/templateedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
displayName = template.DisplayName
}

var deprecated *string
if !userSetOption(inv, "deprecated") {
deprecated = &deprecationMessage
}

req := codersdk.UpdateTemplateMeta{
Name: name,
DisplayName: displayName,
Expand Down
1 change: 1 addition & 0 deletions cli/templateedit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,5 +1085,6 @@ func TestTemplateEdit(t *testing.T) {
assert.Equal(t, template.Icon, updated.Icon)
assert.Equal(t, template.DisplayName, updated.DisplayName)
assert.Equal(t, template.Description, updated.Description)
assert.Equal(t, template.DeprecationMessage, updated.DeprecationMessage)
})
}
You are viewing a condensed version of this merge commit. You can view the full changes here.