Skip to content

Commit 364f648

Browse files
authored
fix(server_create): pass down error on bad image label (#2370)
1 parent f971117 commit 364f648

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/namespaces/instance/v1/custom_server_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func instanceServerCreateRun(ctx context.Context, argsI interface{}) (i interfac
231231
CommercialType: serverReq.CommercialType,
232232
})
233233
if err != nil {
234-
return nil, fmt.Errorf("bad image label '%s' for %s", args.Image, serverReq.CommercialType)
234+
return nil, err
235235
}
236236
serverReq.Image = imageID
237237
default:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Bad image label 'macos' for DEV1-S
3+
Scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)
44
🟥🟥🟥 JSON STDERR 🟥🟥🟥
55
{
6-
"error": "bad image label 'macos' for DEV1-S"
6+
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (macos), zone (fr-par-1) and commercial type (DEV1-S)"
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Bad image label 'ubuntu_bionic' for MACBOOK1-S
3+
Scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)
44
🟥🟥🟥 JSON STDERR 🟥🟥🟥
55
{
6-
"error": "bad image label 'ubuntu_bionic' for MACBOOK1-S"
6+
"error": "scaleway-sdk-go: couldn't find a matching image for the given label (ubuntu_bionic), zone (fr-par-1) and commercial type (MACBOOK1-S): couldn't find compatible local image for this image version (47d38b1a-71a9-4f29-80bc-2dbb7bda7f9f)"
77
}

0 commit comments

Comments
 (0)