Skip to content

Commit ed79cc0

Browse files
committed
Change field name from MaxMemory to MaxContainerMemory
Signed-off-by: TanmayArya-1p <[email protected]>
1 parent 0bca123 commit ed79cc0

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ require (
8181
github.com/sergi/go-diff v1.1.0 // indirect
8282
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
8383
github.com/src-d/gcfg v1.4.0 // indirect
84-
github.com/stretchr/testify v1.10.0 // indirect
8584
github.com/tklauser/go-sysconf v0.3.12 // indirect
8685
github.com/tklauser/numcpus v0.6.1 // indirect
8786
github.com/ugorji/go/codec v1.1.7 // indirect

go.sum

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
130130
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
131131
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
132132
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
133-
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
134-
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
135133
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
134+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
136135
github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg=
137136
github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg=
138137
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
@@ -300,8 +299,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
300299
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
301300
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
302301
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
303-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
304-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
305302
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
306303
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
307304
github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
@@ -470,5 +467,5 @@ gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
470467
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
471468
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
472469
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
473-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
474-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
470+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
471+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

services/appmaker/controller.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func (s *server) Create(ctx context.Context, body *pb.RequestBody) (*pb.Response
4444
maxCount := configs.ServiceConfig.AppMaker.AppLimit
4545
rateCount := configs.ServiceConfig.RateLimit
4646
timeInterval := configs.ServiceConfig.RateInterval
47-
if !user.IsAdmin(){
48-
if maxCount >= 0{
47+
if !user.IsAdmin() {
48+
if maxCount >= 0 {
4949
rateLimitCount := mongo.CountInstanceInTimeFrame(body.GetOwner(), mongo.AppInstance, timeInterval)
5050
totalCount := mongo.CountInstancesByUser(body.GetOwner(), mongo.AppInstance)
5151
if totalCount < maxCount {
@@ -56,13 +56,13 @@ func (s *server) Create(ctx context.Context, body *pb.RequestBody) (*pb.Response
5656
return nil, fmt.Errorf("cannot deploy more than %d app instances", maxCount)
5757
}
5858
}
59-
if app.Resources.Memory > configs.ServiceConfig.AppMaker.MaxMemory {
60-
return nil, fmt.Errorf("memory limit cannot exceed %f MB", configs.ServiceConfig.AppMaker.MaxMemory)
59+
if app.Resources.Memory > configs.ServiceConfig.AppMaker.MaxContainerMemory {
60+
return nil, fmt.Errorf("memory limit cannot exceed %f MB", configs.ServiceConfig.AppMaker.MaxContainerMemory)
6161
}
62-
if app.Resources.CPU > configs.ServiceConfig.AppMaker.MaxCPU {
63-
return nil, fmt.Errorf("cpu limit cannot exceed %f", configs.ServiceConfig.AppMaker.MaxCPU)
62+
if app.Resources.CPU > configs.ServiceConfig.AppMaker.MaxContainerCPU {
63+
return nil, fmt.Errorf("cpu limit cannot exceed %f", configs.ServiceConfig.AppMaker.MaxContainerCPU)
6464
}
65-
}
65+
}
6666

6767
app.SetLanguage(language)
6868
app.SetOwner(body.GetOwner())

0 commit comments

Comments
 (0)