File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
2323 "github.com/aws/aws-sdk-go/aws"
2424 "github.com/aws/aws-sdk-go/service/servicequotas"
2525 "github.com/cortexlabs/cortex/pkg/lib/errors"
26+ "github.com/cortexlabs/cortex/pkg/lib/pointer"
2627 "github.com/cortexlabs/cortex/pkg/lib/sets/strset"
2728)
2829
@@ -42,7 +43,7 @@ func (c *Client) VerifyInstanceQuota(instanceType string) error {
4243 instancePrefix = "standard"
4344 }
4445
45- var cpuLimit int
46+ var cpuLimit * int
4647 err := c .ServiceQuotas ().ListServiceQuotasPages (
4748 & servicequotas.ListServiceQuotasInput {
4849 ServiceCode : aws .String ("ec2" ),
@@ -62,7 +63,7 @@ func (c *Client) VerifyInstanceQuota(instanceType string) error {
6263 }
6364
6465 if strings .ToLower (* metricClass ) == instancePrefix + "/ondemand" {
65- cpuLimit = int (* quota .Value ) // quota is specified in number of vCPU permitted per family
66+ cpuLimit = pointer . Int ( int (* quota .Value ) ) // quota is specified in number of vCPU permitted per family
6667 return false
6768 }
6869 }
@@ -73,7 +74,7 @@ func (c *Client) VerifyInstanceQuota(instanceType string) error {
7374 return errors .WithStack (err )
7475 }
7576
76- if cpuLimit == 0 {
77+ if cpuLimit != nil && * cpuLimit == 0 {
7778 return ErrorInstanceTypeLimitIsZero (instanceType , c .Region )
7879 }
7980
You can’t perform that action at this time.
0 commit comments