Skip to content

feat(coderd): add support for presets to the coder API #16526

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 12 commits into from
Feb 12, 2025
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
SasSwart committed Feb 11, 2025
commit e4b5f0d2c350ec3ff0b6a266393c2128efbdea9c
3 changes: 3 additions & 0 deletions coderd/presets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"

"github.com/google/uuid"
"github.com/stretchr/testify/require"

"github.com/coder/coder/v2/coderd/coderdtest"
Expand All @@ -26,11 +27,13 @@ func TestTemplateVersionPresets(t *testing.T) {
provisionerCtx := dbauthz.AsProvisionerd(ctx)

preset, err := db.InsertPreset(provisionerCtx, database.InsertPresetParams{
ID: uuid.New(),
Name: "My Preset",
TemplateVersionID: version.ID,
})
require.NoError(t, err)
_, err = db.InsertPresetParameters(provisionerCtx, database.InsertPresetParametersParams{
ID: uuid.New(),
TemplateVersionPresetID: preset.ID,
Names: []string{"preset_param1", "preset_param2"},
Values: []string{"A1B2C3", "D4E5F6"},
Expand Down
Loading