mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: disable parameter validatation for dynamic params for all transitions (#17926)
Dynamic params skip parameter validation in coder/coder. This is because conditional parameters cannot be validated with the static parameters in the database.
This commit is contained in:
@@ -839,6 +839,32 @@ func TestWorkspaceBuildWithPreset(t *testing.T) {
|
||||
req.NoError(err)
|
||||
}
|
||||
|
||||
func TestProvisionerVersionSupportsDynamicParameters(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for v, dyn := range map[string]bool{
|
||||
"": false,
|
||||
"na": false,
|
||||
"0.0": false,
|
||||
"0.10": false,
|
||||
"1.4": false,
|
||||
"1.5": false,
|
||||
"1.6": true,
|
||||
"1.7": true,
|
||||
"1.8": true,
|
||||
"2.0": true,
|
||||
"2.17": true,
|
||||
"4.0": true,
|
||||
} {
|
||||
t.Run(v, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
does := wsbuilder.ProvisionerVersionSupportsDynamicParameters(v)
|
||||
require.Equal(t, dyn, does)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
type txExpect func(mTx *dbmock.MockStore)
|
||||
|
||||
func expectDB(t *testing.T, opts ...txExpect) *dbmock.MockStore {
|
||||
|
||||
Reference in New Issue
Block a user