File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1
- v0.21.0-ske-1
1
+ v0.21.0-ske-2
Original file line number Diff line number Diff line change @@ -8,12 +8,17 @@ import (
8
8
"fmt"
9
9
)
10
10
11
- // NoValidHost is a part of the error message returned when there is no valid host in the zone to deploy a VM.
12
- // Matches:
13
- //
14
- // "No valid host was found."
15
- // "No valid host was found. There are not enough hosts available."
16
- const NoValidHost = "No valid host was found"
11
+ const (
12
+ // NoValidHost is a part of the error message returned when there is no valid host in the zone to deploy a VM.
13
+ // Matches:
14
+ //
15
+ // "No valid host was found."
16
+ // "No valid host was found. There are not enough hosts available."
17
+ NoValidHost = "No valid host was found"
18
+
19
+ // FlavorNotFound is part of the error message returned when a flavor cannot be resolved.
20
+ FlavorNotFound = "error resolving flavor"
21
+ )
17
22
18
23
var (
19
24
// ErrNotFound is returned when the requested resource could not be found.
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ func mapErrorToCode(err error) codes.Code {
69
69
70
70
func mapErrorMessageToCode (err error ) codes.Code {
71
71
errorMessage := err .Error ()
72
- if strings .Contains (errorMessage , executor .NoValidHost ) {
72
+ if strings .Contains (errorMessage , executor .NoValidHost ) ||
73
+ strings .Contains (errorMessage , executor .FlavorNotFound ) {
73
74
return codes .ResourceExhausted
74
75
}
75
76
return codes .Internal
You can’t perform that action at this time.
0 commit comments