From d208919f61a07aca3bf906f2ab2bab3aa228768f Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Thu, 4 Jul 2024 10:02:15 -0300 Subject: [PATCH] Remove redundant replace directives (#227) * Remove redundant replace directives The replace directives for the packages github.com/ajg/form and github.com/samalba/dockerclient are both redundant. We can require github.com/cezarsa/form directly and bypass the replace. gofmt -w -r '"github.com/ajg/form" -> "github.com/cezarsa/form"' . The second replaced package does not seem to be in use according to `go list -m all`. This also requires a recent enough commit of tsuru after tsuru/tsuru!2703. There is a hidden bonus that `go install github.com/tsuru/tsuru-client/tsuru@latest` is now a thing. * fixes for tsuru latest --- go.mod | 20 ++++++---------- go.sum | 44 +++++++++++++++++++++-------------- tsuru/admin/suite_test.go | 2 +- tsuru/client/apps.go | 2 +- tsuru/client/env.go | 2 +- tsuru/client/env_test.go | 2 +- tsuru/client/event.go | 2 +- tsuru/client/plan.go | 33 ++++++++++++++++---------- tsuru/client/plan_test.go | 2 +- tsuru/client/router.go | 2 +- tsuru/client/services.go | 2 +- tsuru/client/services_test.go | 2 +- tsuru/client/suite_test.go | 2 +- tsuru/client/volume.go | 2 +- tsuru/client/volume_test.go | 2 +- tsuru/main.go | 2 +- 16 files changed, 67 insertions(+), 56 deletions(-) diff --git a/go.mod b/go.mod index afc42649..578d81cf 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.21 require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f github.com/antihax/optional v1.0.0 + github.com/cezarsa/form v0.0.0-20210510165411-863b166467b9 github.com/ghodss/yaml v1.0.0 github.com/hashicorp/go-version v1.2.0 github.com/iancoleman/orderedmap v0.2.0 @@ -18,11 +18,11 @@ require ( github.com/tsuru/gnuflag v0.0.0-20151217162021-86b8c1b864aa github.com/tsuru/go-tsuruclient v0.0.0-20240409125509-22a1e08326f4 github.com/tsuru/tablecli v0.0.0-20190131152944-7ded8a3383c6 - github.com/tsuru/tsuru v0.0.0-20240430173126-10560a3c53fd - golang.org/x/net v0.20.0 + github.com/tsuru/tsuru v0.0.0-20240625142113-718fa2c41d3d + golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.16.0 - golang.org/x/sys v0.16.0 - golang.org/x/term v0.16.0 + golang.org/x/sys v0.20.0 + golang.org/x/term v0.20.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c gopkg.in/yaml.v2 v2.4.0 k8s.io/apimachinery v0.26.2 @@ -71,10 +71,9 @@ require ( github.com/sajari/fuzzy v1.0.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/tsuru/config v0.0.0-20201023175036-375aaee8b560 // indirect - golang.org/x/crypto v0.18.0 // indirect + golang.org/x/crypto v0.23.0 // indirect golang.org/x/mod v0.8.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.6.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514 // indirect @@ -89,8 +88,3 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) - -replace ( - github.com/ajg/form => github.com/cezarsa/form v0.0.0-20210510165411-863b166467b9 - github.com/samalba/dockerclient => github.com/cezarsa/dockerclient v0.0.0-20190924055524-af5052a88081 -) diff --git a/go.sum b/go.sum index 455f1e5d..f83d1860 100644 --- a/go.sum +++ b/go.sum @@ -348,6 +348,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -496,6 +498,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/montanaflynn/stats v0.7.0 h1:r3y12KyNxj/Sb/iOE46ws+3mS1+MZca1wlHQFPsY/JU= +github.com/montanaflynn/stats v0.7.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -679,12 +683,8 @@ github.com/tsuru/go-tsuruclient v0.0.0-20240409125509-22a1e08326f4 h1:MGmG6AxKP8 github.com/tsuru/go-tsuruclient v0.0.0-20240409125509-22a1e08326f4/go.mod h1:qwh/KJ6ypa2GISRI79XFOHhnSjGOe1cZVPHF3nfrf18= github.com/tsuru/tablecli v0.0.0-20190131152944-7ded8a3383c6 h1:1XDdWFAjIbCSG1OjN9v9KdWhuM8UtYlFcfHe/Ldkchk= github.com/tsuru/tablecli v0.0.0-20190131152944-7ded8a3383c6/go.mod h1:ztYpOhW+u1k21FEqp7nZNgpWbr0dUKok5lgGCZi+1AQ= -github.com/tsuru/tsuru v0.0.0-20240411165438-543d3861334a h1:O0fPdqtXD4RQXaptD1AjezS/4Ryo5Fxjrm38jKZRYkE= -github.com/tsuru/tsuru v0.0.0-20240411165438-543d3861334a/go.mod h1:QxMVXEjpb6mPnlaLMQdxJ3XCg+vOa4/MwZWLk3/naec= -github.com/tsuru/tsuru v0.0.0-20240426210150-8ecd7f486345 h1:A6SbQLCBGgdJOKoXUrUmiCDVLNyy+cHV3omW9vgua8M= -github.com/tsuru/tsuru v0.0.0-20240426210150-8ecd7f486345/go.mod h1:QxMVXEjpb6mPnlaLMQdxJ3XCg+vOa4/MwZWLk3/naec= -github.com/tsuru/tsuru v0.0.0-20240430173126-10560a3c53fd h1:Al7qvBMn76Pb3Ci3AzULVTNUlv2SIn6MtjrLfbM0dlg= -github.com/tsuru/tsuru v0.0.0-20240430173126-10560a3c53fd/go.mod h1:QxMVXEjpb6mPnlaLMQdxJ3XCg+vOa4/MwZWLk3/naec= +github.com/tsuru/tsuru v0.0.0-20240625142113-718fa2c41d3d h1:dJ9qls1l4VutZFF7h/BdAIq1VdWCfxU+hY9wlYYjwaI= +github.com/tsuru/tsuru v0.0.0-20240625142113-718fa2c41d3d/go.mod h1:970tWlYqsWh9THcytd1YFBB27BeqhzJWlMC3l/aKJAg= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -698,11 +698,19 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= @@ -712,6 +720,8 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= +go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc= +go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -734,8 +744,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -802,8 +812,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -888,27 +898,25 @@ golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/tsuru/admin/suite_test.go b/tsuru/admin/suite_test.go index f5911842..bf441fda 100644 --- a/tsuru/admin/suite_test.go +++ b/tsuru/admin/suite_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/tsuru-client/tsuru/formatter" tsuruHTTP "github.com/tsuru/tsuru-client/tsuru/http" check "gopkg.in/check.v1" diff --git a/tsuru/client/apps.go b/tsuru/client/apps.go index 99dca436..0d6c8dad 100644 --- a/tsuru/client/apps.go +++ b/tsuru/client/apps.go @@ -21,7 +21,7 @@ import ( "text/template" "time" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/lnquy/cron" "github.com/tsuru/gnuflag" "github.com/tsuru/go-tsuruclient/pkg/config" diff --git a/tsuru/client/env.go b/tsuru/client/env.go index 5bef989e..df3e6834 100644 --- a/tsuru/client/env.go +++ b/tsuru/client/env.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/gnuflag" "github.com/tsuru/go-tsuruclient/pkg/config" "github.com/tsuru/tsuru-client/tsuru/formatter" diff --git a/tsuru/client/env_test.go b/tsuru/client/env_test.go index d415d1d8..90fb1ed4 100644 --- a/tsuru/client/env_test.go +++ b/tsuru/client/env_test.go @@ -10,7 +10,7 @@ import ( "net/http" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/tsuru/cmd" "github.com/tsuru/tsuru/cmd/cmdtest" "github.com/tsuru/tsuru/io" diff --git a/tsuru/client/event.go b/tsuru/client/event.go index b1c3d1b9..47a3c751 100644 --- a/tsuru/client/event.go +++ b/tsuru/client/event.go @@ -16,7 +16,7 @@ import ( "strings" "time" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/ghodss/yaml" "github.com/iancoleman/orderedmap" "github.com/tsuru/gnuflag" diff --git a/tsuru/client/plan.go b/tsuru/client/plan.go index c8bf743b..60c81c86 100644 --- a/tsuru/client/plan.go +++ b/tsuru/client/plan.go @@ -89,14 +89,16 @@ func renderPlans(plans []apptypes.Plan, opts renderPlansOpts) string { } cpuMilli := p.CPUMilli - if p.Override.CPUMilli != nil { + + override := p.Override + if override != nil && override.CPUMilli != nil { cpuMilli = *p.Override.CPUMilli cpu = fmt.Sprintf("%g", float64(*p.Override.CPUMilli)/10) + "% (override)" } else if p.CPUMilli > 0 { cpu = fmt.Sprintf("%g", float64(p.CPUMilli)/10) + "%" } - if p.Override.Memory != nil { + if p.Override != nil && p.Override.Memory != nil { memory = resource.NewQuantity(*p.Override.Memory, resource.BinarySI).String() + " (override)" } @@ -109,7 +111,7 @@ func renderPlans(plans []apptypes.Plan, opts renderPlansOpts) string { if showBurstColumn { cpuBurst := p.CPUBurst.Default cpuBurstObservation := "" - if p.Override.CPUBurst != nil { + if p.Override != nil && p.Override.CPUBurst != nil { cpuBurst = *p.Override.CPUBurst cpuBurstObservation = " (override)" } @@ -134,13 +136,16 @@ func renderProcessPlan(appPlan apptypes.Plan, planByProcess map[string]string) s table.Headers = []string{"Process", "Plan"} appProcessOverrides := []string{} - if appPlan.Override.CPUMilli != nil { - appProcessOverrides = append(appProcessOverrides, fmt.Sprintf("CPU: %g%%", float64(*appPlan.Override.CPUMilli)/10)) - } + override := appPlan.Override + if override != nil { + if override.CPUMilli != nil { + appProcessOverrides = append(appProcessOverrides, fmt.Sprintf("CPU: %g%%", float64(*appPlan.Override.CPUMilli)/10)) + } - if appPlan.Override.Memory != nil { - memory := resource.NewQuantity(*appPlan.Override.Memory, resource.BinarySI).String() - appProcessOverrides = append(appProcessOverrides, fmt.Sprintf("Memory: %s", memory)) + if override.Memory != nil { + memory := resource.NewQuantity(*appPlan.Override.Memory, resource.BinarySI).String() + appProcessOverrides = append(appProcessOverrides, fmt.Sprintf("Memory: %s", memory)) + } } appRow := []string{ @@ -201,7 +206,11 @@ func renderPlansK8SFriendly(plans []apptypes.Plan, showMaxBurstAllowed bool) str for _, p := range plans { memory := resource.NewQuantity(p.Memory, resource.BinarySI).String() cpuRequest := resource.NewMilliQuantity(int64(p.CPUMilli), resource.DecimalSI).String() - maxCPULimit := resource.NewMilliQuantity(int64(float64(p.CPUMilli)*p.CPUBurst.MaxAllowed), resource.DecimalSI).String() + maxAllowed := 1.0 + if p.CPUBurst != nil { + maxAllowed = p.CPUBurst.MaxAllowed + } + maxCPULimit := resource.NewMilliQuantity(int64(float64(p.CPUMilli)*maxAllowed), resource.DecimalSI).String() row := []string{ p.Name, @@ -233,11 +242,11 @@ func hasBurst(p apptypes.Plan) bool { if p.CPUMilli == 0 { return false } - if p.CPUBurst.Default != 0 { + if p.CPUBurst != nil && p.CPUBurst.Default != 0 { return true } - if p.Override.CPUBurst != nil { + if p.Override != nil && p.Override.CPUBurst != nil { return true } return false diff --git a/tsuru/client/plan_test.go b/tsuru/client/plan_test.go index b2908a88..b02b0636 100644 --- a/tsuru/client/plan_test.go +++ b/tsuru/client/plan_test.go @@ -362,7 +362,7 @@ func (s *S) TestRenderProcessPlan(c *check.C) { { appPlan: appTypes.Plan{ Name: "c1m2", - Override: appTypes.PlanOverride{ + Override: &appTypes.PlanOverride{ CPUMilli: func(d int) *int { return &d }(1000), Memory: func(d int64) *int64 { return &d }(1024 * 1024 * 1024), }, diff --git a/tsuru/client/router.go b/tsuru/client/router.go index f8e30360..7ca24adf 100644 --- a/tsuru/client/router.go +++ b/tsuru/client/router.go @@ -13,7 +13,7 @@ import ( "sort" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/pkg/errors" "github.com/tsuru/gnuflag" "github.com/tsuru/go-tsuruclient/pkg/config" diff --git a/tsuru/client/services.go b/tsuru/client/services.go index 10d28991..c70bedab 100644 --- a/tsuru/client/services.go +++ b/tsuru/client/services.go @@ -15,8 +15,8 @@ import ( "strconv" "strings" - "github.com/ajg/form" "github.com/antihax/optional" + "github.com/cezarsa/form" osb "github.com/pmorie/go-open-service-broker-client/v2" "github.com/tsuru/gnuflag" "github.com/tsuru/go-tsuruclient/pkg/config" diff --git a/tsuru/client/services_test.go b/tsuru/client/services_test.go index 13affead..2494a668 100644 --- a/tsuru/client/services_test.go +++ b/tsuru/client/services_test.go @@ -12,7 +12,7 @@ import ( "net/http" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/go-tsuruclient/pkg/tsuru" tsuruHTTP "github.com/tsuru/tsuru-client/tsuru/http" "github.com/tsuru/tsuru/cmd" diff --git a/tsuru/client/suite_test.go b/tsuru/client/suite_test.go index 46cf40c5..ca592498 100644 --- a/tsuru/client/suite_test.go +++ b/tsuru/client/suite_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/go-tsuruclient/pkg/config" "github.com/tsuru/tsuru-client/tsuru/formatter" tsuruHTTP "github.com/tsuru/tsuru-client/tsuru/http" diff --git a/tsuru/client/volume.go b/tsuru/client/volume.go index ad37ec21..dcc11ca6 100644 --- a/tsuru/client/volume.go +++ b/tsuru/client/volume.go @@ -13,7 +13,7 @@ import ( "sort" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/gnuflag" "github.com/tsuru/go-tsuruclient/pkg/config" "github.com/tsuru/tablecli" diff --git a/tsuru/client/volume_test.go b/tsuru/client/volume_test.go index 66ecddcf..f88848b0 100644 --- a/tsuru/client/volume_test.go +++ b/tsuru/client/volume_test.go @@ -9,7 +9,7 @@ import ( "net/http" "strings" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/tsuru/tsuru/cmd" "github.com/tsuru/tsuru/cmd/cmdtest" volumeTypes "github.com/tsuru/tsuru/types/volume" diff --git a/tsuru/main.go b/tsuru/main.go index fe14b9c8..2463cdd3 100644 --- a/tsuru/main.go +++ b/tsuru/main.go @@ -11,7 +11,7 @@ import ( "net/http" "os" - "github.com/ajg/form" + "github.com/cezarsa/form" "github.com/pkg/errors" goTsuruClient "github.com/tsuru/go-tsuruclient/pkg/client" "github.com/tsuru/go-tsuruclient/pkg/config"