Skip to content

feat: Disallow using legacy params with rich params #5974

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
Feb 2, 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
Next Next commit
Fix
  • Loading branch information
mtojek committed Feb 2, 2023
commit a517d63abebe44aee524c09df318b3fd4170803c
7 changes: 6 additions & 1 deletion cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ func prepWorkspaceBuild(cmd *cobra.Command, client *codersdk.Client, args prepWo
useRichParameters = true
}

if useRichParameters && (len(args.ExistingParams) > 0 || len(args.ParameterFile) > 0) {
var useLegacyParameters bool
if len(args.ExistingParams) > 0 || len(args.ParameterFile) > 0 {
useLegacyParameters = true
}

if useRichParameters && useLegacyParameters {
return nil, xerrors.Errorf("Rich parameters can't be used together with legacy parameters.")
}

Expand Down
6 changes: 2 additions & 4 deletions coderd/database/dbgen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import (
"testing"
"time"

"github.com/tabbed/pqtype"

"github.com/coder/coder/cryptorand"

"github.com/google/uuid"
"github.com/moby/moby/pkg/namesgenerator"
"github.com/stretchr/testify/require"
"github.com/tabbed/pqtype"

"github.com/coder/coder/coderd/database"
"github.com/coder/coder/cryptorand"
)

// All methods take in a 'seed' object. Any provided fields in the seed will be
Expand Down