Skip to content

Commit cc46d8e

Browse files
authored
fix(instance): allow unknown commerical types (#1500)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent feafe6a commit cc46d8e

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

internal/namespaces/instance/v1/custom_server_create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func serverCreateCommand() *core.Command {
6060
Short: "Server commercial type",
6161
Default: core.DefaultValueSetter("DEV1-S"),
6262
EnumValues: []string{"GP1-XS", "GP1-S", "GP1-M", "GP1-L", "GP1-XL", "DEV1-S", "DEV1-M", "DEV1-L", "DEV1-XL", "RENDER-S"},
63+
ValidateFunc: func(argSpec *core.ArgSpec, value interface{}) error {
64+
// Allow all commercial types
65+
return nil
66+
},
6367
},
6468
{
6569
Name: "name",

internal/namespaces/instance/v1/testdata/test-create-server-errors-error-invalid-instance-type.cassette.yaml

Lines changed: 41 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Invalid value 'MACBOOK1-S' for arg 'type'
4-
5-
Hint:
6-
Accepted values for 'type' are [GP1-XS GP1-S GP1-M GP1-L GP1-XL DEV1-S DEV1-M DEV1-L DEV1-XL RENDER-S]
3+
Bad image label 'ubuntu_bionic' for MACBOOK1-S
74
🟥🟥🟥 JSON STDERR 🟥🟥🟥
85
{
9-
"message": "invalid value 'MACBOOK1-S' for arg 'type'",
10-
"error": {},
11-
"hint": "Accepted values for 'type' are [GP1-XS GP1-S GP1-M GP1-L GP1-XL DEV1-S DEV1-M DEV1-L DEV1-XL RENDER-S]"
6+
"error": "bad image label 'ubuntu_bionic' for MACBOOK1-S"
127
}

0 commit comments

Comments
 (0)