Browse Source

Switch to the latest tool container and to upstream gogo/protobuf. (#15970)

Martin Taillefer 2 months ago
parent
commit
02319b98c3
100 changed files with 9408 additions and 7769 deletions
  1. 1
    1
      bin/counterfeiter.sh
  2. 3
    3
      bin/mixer_codegen.sh
  3. 1
    1
      bin/protoc.sh
  4. 4
    8
      go.mod
  5. 10
    18
      go.sum
  6. 3
    2
      mixer/adapter/bypass/bypass_test.go
  7. 36
    32
      mixer/adapter/bypass/config/config.pb.go
  8. 64
    49
      mixer/adapter/circonus/config/config.pb.go
  9. 98
    87
      mixer/adapter/cloudwatch/config/config.pb.go
  10. 37
    34
      mixer/adapter/denier/config/config.pb.go
  11. 1
    1
      mixer/adapter/denier/denier.go
  12. 110
    99
      mixer/adapter/dogstatsd/config/config.pb.go
  13. 50
    48
      mixer/adapter/fluentd/config/config.pb.go
  14. 34
    31
      mixer/adapter/kubernetesenv/config/config.pb.go
  15. 393
    314
      mixer/adapter/kubernetesenv/template/template_handler_service.pb.go
  16. 68
    72
      mixer/adapter/list/config/config.pb.go
  17. 1
    1
      mixer/adapter/list/list.go
  18. 2
    1
      mixer/adapter/list/list_test.go
  19. 121
    93
      mixer/adapter/memquota/config/config.pb.go
  20. 2
    1
      mixer/adapter/metadata/inventory.go
  21. 1
    1
      mixer/adapter/noop/noop.go
  22. 1
    1
      mixer/adapter/noop/noop_test.go
  23. 33
    37
      mixer/adapter/opa/config/config.pb.go
  24. 1
    1
      mixer/adapter/opa/opa_test.go
  25. 235
    175
      mixer/adapter/prometheus/config/config.pb.go
  26. 126
    97
      mixer/adapter/redisquota/config/config.pb.go
  27. 92
    76
      mixer/adapter/signalfx/config/config.pb.go
  28. 111
    107
      mixer/adapter/solarwinds/config/config.pb.go
  29. 447
    350
      mixer/adapter/stackdriver/config/config.pb.go
  30. 1
    1
      mixer/adapter/stackdriver/contextgraph/send.go
  31. 85
    78
      mixer/adapter/statsd/config/config.pb.go
  32. 65
    62
      mixer/adapter/stdio/config/config.pb.go
  33. 24
    22
      mixer/adapter/zipkin/config/config.pb.go
  34. 2
    1
      mixer/cmd/mixc/cmd/util.go
  35. 2
    1
      mixer/cmd/mixc/cmd/util_test.go
  36. 1
    1
      mixer/pkg/adapter/check.go
  37. 1
    1
      mixer/pkg/adapter/quotas.go
  38. 2
    1
      mixer/pkg/api/grpcServer.go
  39. 2
    1
      mixer/pkg/api/grpcServer_test.go
  40. 1
    1
      mixer/pkg/mockapi/handler.go
  41. 2
    1
      mixer/pkg/mockapi/server.go
  42. 2
    1
      mixer/pkg/mockapi/server_test.go
  43. 1132
    1088
      mixer/pkg/protobuf/yaml/testdata/all/types.pb.go
  44. 2
    1
      mixer/pkg/runtime/dispatcher/dispatcher_test.go
  45. 2
    1
      mixer/pkg/runtime/dispatcher/session.go
  46. 1
    1
      mixer/pkg/runtime/dispatcher/session_test.go
  47. 2
    1
      mixer/pkg/runtime/dispatcher/tracing.go
  48. 2
    1
      mixer/pkg/runtime/dispatcher/tracing_test.go
  49. 2
    1
      mixer/pkg/status/status.go
  50. 2
    1
      mixer/pkg/status/status_test.go
  51. 154
    111
      mixer/template/apikey/template_handler_service.pb.go
  52. 384
    296
      mixer/template/authorization/template_handler_service.pb.go
  53. 90
    58
      mixer/template/checknothing/template_handler_service.pb.go
  54. 281
    217
      mixer/template/edge/template_handler_service.pb.go
  55. 108
    73
      mixer/template/listentry/template_handler_service.pb.go
  56. 237
    191
      mixer/template/logentry/template_handler_service.pb.go
  57. 227
    183
      mixer/template/metric/template_handler_service.pb.go
  58. 148
    113
      mixer/template/quota/template_handler_service.pb.go
  59. 95
    58
      mixer/template/reportnothing/template_handler_service.pb.go
  60. 791
    652
      mixer/template/sample/apa/Apa_handler_service.pb.go
  61. 578
    481
      mixer/template/sample/check/CheckTesterTemplate_handler_service.pb.go
  62. 629
    532
      mixer/template/sample/quota/QuotaTesterTemplate_handler_service.pb.go
  63. 827
    695
      mixer/template/sample/report/ReportTesterTemplate_handler_service.pb.go
  64. 387
    316
      mixer/template/tracespan/tracespan_handler_service.pb.go
  65. 2
    1
      mixer/test/client/env/mixer_server.go
  66. 1
    1
      mixer/test/client/env/setup.go
  67. 1
    1
      mixer/test/client/failed_request/failed_request_test.go
  68. 1
    1
      mixer/test/client/mixer_internal_fail/mixer_internal_fail_test.go
  69. 1
    1
      mixer/test/client/quota/quota_test.go
  70. 1
    1
      mixer/test/client/route_directive/route_directive_test.go
  71. 1
    1
      mixer/test/client/tcp_filter/tcp_filter_test.go
  72. 2
    1
      mixer/test/keyval/adapter.go
  73. 28
    25
      mixer/test/keyval/config.pb.go
  74. 144
    95
      mixer/test/keyval/template_handler_service.pb.go
  75. 249
    194
      mixer/test/spyAdapter/template/apa/tmpl_handler_service.pb.go
  76. 101
    67
      mixer/test/spyAdapter/template/check/tmpl_handler_service.pb.go
  77. 178
    127
      mixer/test/spyAdapter/template/checkoutput/tmpl_handler_service.pb.go
  78. 148
    113
      mixer/test/spyAdapter/template/quota/quotatmpl_handler_service.pb.go
  79. 164
    123
      mixer/test/spyAdapter/template/report/reporttmpl_handler_service.pb.go
  80. 2
    1
      mixer/test/spybackend/nosession_integration_test.go
  81. 2
    1
      mixer/test/spybackend/session_integration_test.go
  82. 0
    12
      pilot/pkg/networking/core/v1alpha3/envoyfilter/listener_patch.go
  83. 2
    1
      pilot/pkg/proxy/envoy/v2/init_test.go
  84. 1
    1
      pilot/pkg/proxy/envoy/v2/monitoring.go
  85. 2
    1
      pkg/mcp/internal/test/types.go
  86. 1
    1
      pkg/mcp/sink/client_sink.go
  87. 2
    1
      pkg/mcp/sink/journal_test.go
  88. 2
    1
      pkg/mcp/sink/server_sink_test.go
  89. 1
    1
      pkg/mcp/sink/sink.go
  90. 1
    2
      pkg/mcp/source/client_source.go
  91. 1
    1
      pkg/mcp/source/server_source_test.go
  92. 1
    1
      pkg/mcp/source/source.go
  93. 1
    1
      pkg/mcp/source/source_test.go
  94. 3
    1
      pkg/mcp/status/status.go
  95. 2
    1
      pkg/test/fakes/policy/backend.go
  96. 1
    1
      pkg/test/framework/components/mixer/mixer.go
  97. 1
    1
      scripts/run_gobindata.sh
  98. 2
    1
      security/pkg/caclient/protocol/protocol_test.go
  99. 1
    2
      security/pkg/nodeagent/cache/secretcache.go
  100. 0
    0
      security/pkg/probe/controller_test.go

+ 1
- 1
bin/counterfeiter.sh View File

@@ -22,7 +22,7 @@ if [ "$ROOTDIR" != "${GOPATH-$HOME/go}/src/istio.io/istio" ]; then
22 22
   die "Istio not found in GOPATH/src/istio.io/"
23 23
 fi
24 24
 
25
-gen_img=gcr.io/istio-testing/api-build-tools:2019-07-30
25
+gen_img=gcr.io/istio-testing/api-build-tools:2019-07-31
26 26
 
27 27
 docker run  -i --volume /var/run/docker.sock:/var/run/docker.sock \
28 28
   -e "GOPATH=/go:$GOPATH" --rm --entrypoint counterfeiter -v "$ROOTDIR:$ROOTDIR" -w "$(pwd)" $gen_img "$@"

+ 3
- 3
bin/mixer_codegen.sh View File

@@ -84,9 +84,9 @@ mappings=(
84 84
   "google/protobuf/duration.proto=github.com/gogo/protobuf/types"
85 85
   "google/protobuf/timestamp.proto=github.com/gogo/protobuf/types"
86 86
   "google/protobuf/struct.proto=github.com/gogo/protobuf/types"
87
-  "google/rpc/status.proto=github.com/gogo/googleapis/google/rpc"
88
-  "google/rpc/code.proto=github.com/gogo/googleapis/google/rpc"
89
-  "google/rpc/error_details.proto=github.com/gogo/googleapis/google/rpc"
87
+  "google/rpc/status.proto=istio.io/gogo-genproto/googleapis/google/rpc"
88
+  "google/rpc/code.proto=istio.io/gogo-genproto/googleapis/google/rpc"
89
+  "google/rpc/error_details.proto=istio.io/gogo-genproto/googleapis/google/rpc"
90 90
 )
91 91
 
92 92
 MAPPINGS=""

+ 1
- 1
bin/protoc.sh View File

@@ -27,7 +27,7 @@ if [ "$ROOTDIR" != "${GOPATH-$HOME/go}/src/istio.io/istio" ]; then
27 27
   die "Istio not found in GOPATH/src/istio.io/"
28 28
 fi
29 29
 
30
-gen_img=gcr.io/istio-testing/api-build-tools:2019-07-30
30
+gen_img=gcr.io/istio-testing/api-build-tools:2019-07-31
31 31
 
32 32
 docker run  -i --volume /var/run/docker.sock:/var/run/docker.sock \
33 33
   --rm --entrypoint /usr/bin/protoc -v "$ROOTDIR:$ROOTDIR" -w "$(pwd)" $gen_img "$@"

+ 4
- 8
go.mod View File

@@ -8,8 +8,6 @@ replace k8s.io/klog => github.com/istio/klog v0.0.0-20190424230111-fb7481ea8bcf
8 8
 
9 9
 replace github.com/spf13/viper => github.com/istio/viper v1.3.3-0.20190515210538-2789fed3109c
10 10
 
11
-replace github.com/gogo/protobuf => github.com/istio/gogo-protobuf v1.2.2
12
-
13 11
 require (
14 12
 	cloud.google.com/go v0.37.4
15 13
 	contrib.go.opencensus.io/exporter/prometheus v0.1.0
@@ -56,7 +54,7 @@ require (
56 54
 	github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f // indirect
57 55
 	github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
58 56
 	github.com/emicklei/go-restful v2.6.0+incompatible
59
-	github.com/envoyproxy/go-control-plane v0.8.3
57
+	github.com/envoyproxy/go-control-plane v0.8.4
60 58
 	github.com/evanphx/json-patch v3.0.0+incompatible
61 59
 	github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
62 60
 	github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 // indirect
@@ -71,9 +69,7 @@ require (
71 69
 	github.com/go-sql-driver/mysql v1.4.1 // indirect
72 70
 	github.com/gobwas/glob v0.2.3 // indirect
73 71
 	github.com/gocql/gocql v0.0.0-20190423091413-b99afaf3b163 // indirect
74
-	github.com/gogo/googleapis v1.2.0
75
-	github.com/gogo/protobuf v1.2.1
76
-	github.com/gogo/status v1.0.3
72
+	github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48
77 73
 	github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
78 74
 	github.com/golang/groupcache v0.0.0-20180203143532-66deaeb636df // indirect
79 75
 	github.com/golang/protobuf v1.3.0
@@ -186,8 +182,8 @@ require (
186 182
 	gopkg.in/stack.v1 v1.7.0 // indirect
187 183
 	gopkg.in/yaml.v2 v2.2.2
188 184
 	gotest.tools v2.2.0+incompatible // indirect
189
-	istio.io/api v0.0.0-20190730171035-f306601671d2
190
-	istio.io/gogo-genproto v0.0.0-20190614210408-e88dc8b0e4db
185
+	istio.io/api v0.0.0-20190801054801-27c01d9b4132
186
+	istio.io/gogo-genproto v0.0.0-20190731221249-06e20ada0df2
191 187
 	istio.io/pkg v0.0.0-20190710182420-c26792dead42
192 188
 	k8s.io/api v0.0.0-20190222213804-5cb15d344471
193 189
 	k8s.io/apiextensions-apiserver v0.0.0-20190221221350-bfb440be4b87

+ 10
- 18
go.sum View File

@@ -121,8 +121,8 @@ github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhP
121 121
 github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
122 122
 github.com/emicklei/go-restful v2.6.0+incompatible h1:luAX89wpjId5gV+GJV11MFD56GpAJTG2eUqCeDDgB98=
123 123
 github.com/emicklei/go-restful v2.6.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
124
-github.com/envoyproxy/go-control-plane v0.8.3 h1:Sqcub1O4SnINoXxNmqbNSeNcZ7O/mkk5jq2Ou6JF7HU=
125
-github.com/envoyproxy/go-control-plane v0.8.3/go.mod h1:EWRTAFN6uuDZIa6KOuUfrOMJ7ySgXZ44rVKiTWjKe34=
124
+github.com/envoyproxy/go-control-plane v0.8.4 h1:moNlmfa71yZkzDxAb4Fz5qwaW1giZmTtwn6P/gYIK6E=
125
+github.com/envoyproxy/go-control-plane v0.8.4/go.mod h1:XB9+ce7x+IrsjgIVnRnql0O61gj/np0/bGDfhJI3sCU=
126 126
 github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109 h1:FNgqGzbOm637YKRbYGKb9cqGo8i50++w/LWvMau7jrw=
127 127
 github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
128 128
 github.com/evanphx/json-patch v3.0.0+incompatible h1:l91aby7TzBXBdmF8heZqjskeH9f3g7ZOL8/sSe+vTlU=
@@ -158,12 +158,10 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
158 158
 github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
159 159
 github.com/gocql/gocql v0.0.0-20190423091413-b99afaf3b163 h1:qhRRAuxNlCti1V4OXPSd9JUBd9klnnfTPk/wn+iKy/c=
160 160
 github.com/gocql/gocql v0.0.0-20190423091413-b99afaf3b163/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0=
161
-github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI=
162
-github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
163
-github.com/gogo/googleapis v1.2.0 h1:Z0v3OJDotX9ZBpdz2V+AI7F4fITSZhVE5mg6GQppwMM=
164
-github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU=
165
-github.com/gogo/status v1.0.3 h1:WkVBY59mw7qUNTr/bLwO7J2vesJ0rQ2C3tMXrTd3w5M=
166
-github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc=
161
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
162
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
163
+github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48 h1:X+zN6RZXsvnrSJaAIQhZezPfAfvsqihKKR8oiLHid34=
164
+github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
167 165
 github.com/golang/groupcache v0.0.0-20180203143532-66deaeb636df h1:Sf/EWTqecLGj5mn9KFu3L4Cc4O/6kGnbtbDtXrjzv5A=
168 166
 github.com/golang/groupcache v0.0.0-20180203143532-66deaeb636df/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
169 167
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -277,15 +275,12 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
277 275
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
278 276
 github.com/huandu/xstrings v1.0.0 h1:pO2K/gKgKaat5LdpAhxhluX2GPQMaI3W5FUz/I/UnWk=
279 277
 github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
280
-github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
281 278
 github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
282 279
 github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
283 280
 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
284 281
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
285 282
 github.com/istio/glog v0.0.0-20190424172949-d7cfb6fa2ccd h1:AJnLAbRpHRy2stiICRI1hcp0f8EExPEiZLgeOmCGnuE=
286 283
 github.com/istio/glog v0.0.0-20190424172949-d7cfb6fa2ccd/go.mod h1:gF8UB8w1Mqkddo9AqNOPkiduBosB3HHkpC5ra96cDzw=
287
-github.com/istio/gogo-protobuf v1.2.2 h1:owVNB2poNF89y6PVv7cqvbiEc64Oxmisu8DElon23wM=
288
-github.com/istio/gogo-protobuf v1.2.2/go.mod h1:vfjn3j3y5/f0PSoVc2mvjpkYi6onwEz0eC1iLQrg8yY=
289 284
 github.com/istio/klog v0.0.0-20190424230111-fb7481ea8bcf h1:AshFubsUWsHMYfGoz5XLZOOF87wnop5O/Fjjnqjk8lY=
290 285
 github.com/istio/klog v0.0.0-20190424230111-fb7481ea8bcf/go.mod h1:9gnFtvcm4y+2DZMNXbO8Q7Ke2kUDomg7HhR/mEs5wVA=
291 286
 github.com/istio/viper v1.3.3-0.20190515210538-2789fed3109c h1:EFWADU43GY2T7NIYYbIHWdrG2hRiWyGSHeON57ZADBE=
@@ -323,7 +318,6 @@ github.com/lestrrat-go/jwx v0.9.0 h1:Fnd0EWzTm0kFrBPzE/PEPp9nzllES5buMkksPMjEKpM
323 318
 github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk=
324 319
 github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
325 320
 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
326
-github.com/lyft/protoc-gen-star v0.4.10/go.mod h1:mE8fbna26u7aEA2QCVvvfBU/ZrPgocG1206xAFPcs94=
327 321
 github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
328 322
 github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
329 323
 github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
@@ -444,8 +438,6 @@ github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2
444 438
 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
445 439
 github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
446 440
 github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
447
-github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
448
-github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
449 441
 github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
450 442
 github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
451 443
 github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
@@ -611,10 +603,10 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh
611 603
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
612 604
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
613 605
 istio.io/api v0.0.0-20190515205759-982e5c3888c6/go.mod h1:hhLFQmpHia8zgaM37vb2ml9iS5NfNfqZGRt1pS9aVEo=
614
-istio.io/api v0.0.0-20190730171035-f306601671d2 h1:2Mn/xW9qvnxexyV4/y2nF77i4pYiIX41pIbJaBJSGPs=
615
-istio.io/api v0.0.0-20190730171035-f306601671d2/go.mod h1:URPGot5W4KDWuSaNKijQqtJFlHXpdrLw+ufMlzCSCX4=
616
-istio.io/gogo-genproto v0.0.0-20190614210408-e88dc8b0e4db h1:a++JUbz/eKj16759379pFBhuoiSxUTmnut6ITM/9FEs=
617
-istio.io/gogo-genproto v0.0.0-20190614210408-e88dc8b0e4db/go.mod h1:eIDJ6jNk/IeJz6ODSksHl5Aiczy5JUq6vFhJWI5OtiI=
606
+istio.io/api v0.0.0-20190801054801-27c01d9b4132 h1:OPlAZD4XkOFNLD4G08zNry25qjgHBvczM5efiFyoiWo=
607
+istio.io/api v0.0.0-20190801054801-27c01d9b4132/go.mod h1:42cBjnu/rTJcCaKi8nLdIvq0n71RcLrkgZ9IQSvDdSQ=
608
+istio.io/gogo-genproto v0.0.0-20190731221249-06e20ada0df2 h1:AZ+aTgKSBmBc6KtZU+P+Wr2dOdPriJu09cU8wGMG+/M=
609
+istio.io/gogo-genproto v0.0.0-20190731221249-06e20ada0df2/go.mod h1:IjvrbUlRbbw4JCpsgvgihcz9USUwEoNTL/uwMtyV5yk=
618 610
 istio.io/pkg v0.0.0-20190710182420-c26792dead42 h1:2GOb5IEH8Q4tbv4sw6OabHV/xcRK4qQD5lLieiYe64s=
619 611
 istio.io/pkg v0.0.0-20190710182420-c26792dead42/go.mod h1:QuX5yn89LMkQdwuz0OyikOs3DBN45poAUNBAlOmFIvQ=
620 612
 k8s.io/api v0.0.0-20190222213804-5cb15d344471 h1:MzQGt8qWQCR+39kbYRd0uQqsvSidpYqJLFeWiJ9l4OE=

+ 3
- 2
mixer/adapter/bypass/bypass_test.go View File

@@ -24,10 +24,11 @@ import (
24 24
 	"testing"
25 25
 	"time"
26 26
 
27
-	"github.com/gogo/googleapis/google/rpc"
28
-	google_rpc "github.com/gogo/googleapis/google/rpc"
29 27
 	"google.golang.org/grpc"
30 28
 
29
+	google_rpc "istio.io/gogo-genproto/googleapis/google/rpc"
30
+	rpc "istio.io/gogo-genproto/googleapis/google/rpc"
31
+
31 32
 	"istio.io/api/mixer/adapter/model/v1beta1"
32 33
 	istio_mixer_adapter_model_v1beta11 "istio.io/api/mixer/adapter/model/v1beta1"
33 34
 	"istio.io/istio/mixer/adapter/bypass/config"

+ 36
- 32
mixer/adapter/bypass/config/config.pb.go View File

@@ -34,6 +34,7 @@ import (
34 34
 	types "github.com/gogo/protobuf/types"
35 35
 	io "io"
36 36
 	math "math"
37
+	math_bits "math/bits"
37 38
 	reflect "reflect"
38 39
 	strings "strings"
39 40
 )
@@ -72,7 +73,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
72 73
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
73 74
 	} else {
74 75
 		b = b[:cap(b)]
75
-		n, err := m.MarshalTo(b)
76
+		n, err := m.MarshalToSizedBuffer(b)
76 77
 		if err != nil {
77 78
 			return nil, err
78 79
 		}
@@ -123,7 +124,7 @@ var fileDescriptor_f65603491c411b72 = []byte{
123 124
 func (m *Params) Marshal() (dAtA []byte, err error) {
124 125
 	size := m.Size()
125 126
 	dAtA = make([]byte, size)
126
-	n, err := m.MarshalTo(dAtA)
127
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
127 128
 	if err != nil {
128 129
 		return nil, err
129 130
 	}
@@ -131,47 +132,57 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
131 132
 }
132 133
 
133 134
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
134
-	var i int
135
+	size := m.Size()
136
+	return m.MarshalToSizedBuffer(dAtA[:size])
137
+}
138
+
139
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
140
+	i := len(dAtA)
135 141
 	_ = i
136 142
 	var l int
137 143
 	_ = l
138
-	if len(m.BackendAddress) > 0 {
139
-		dAtA[i] = 0xa
140
-		i++
141
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.BackendAddress)))
142
-		i += copy(dAtA[i:], m.BackendAddress)
143
-	}
144
-	if m.Params != nil {
145
-		dAtA[i] = 0x12
146
-		i++
147
-		i = encodeVarintConfig(dAtA, i, uint64(m.Params.Size()))
148
-		n1, err := m.Params.MarshalTo(dAtA[i:])
149
-		if err != nil {
150
-			return 0, err
151
-		}
152
-		i += n1
153
-	}
154 144
 	if m.SessionBased {
155
-		dAtA[i] = 0x18
156
-		i++
145
+		i--
157 146
 		if m.SessionBased {
158 147
 			dAtA[i] = 1
159 148
 		} else {
160 149
 			dAtA[i] = 0
161 150
 		}
162
-		i++
151
+		i--
152
+		dAtA[i] = 0x18
163 153
 	}
164
-	return i, nil
154
+	if m.Params != nil {
155
+		{
156
+			size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
157
+			if err != nil {
158
+				return 0, err
159
+			}
160
+			i -= size
161
+			i = encodeVarintConfig(dAtA, i, uint64(size))
162
+		}
163
+		i--
164
+		dAtA[i] = 0x12
165
+	}
166
+	if len(m.BackendAddress) > 0 {
167
+		i -= len(m.BackendAddress)
168
+		copy(dAtA[i:], m.BackendAddress)
169
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.BackendAddress)))
170
+		i--
171
+		dAtA[i] = 0xa
172
+	}
173
+	return len(dAtA) - i, nil
165 174
 }
166 175
 
167 176
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
177
+	offset -= sovConfig(v)
178
+	base := offset
168 179
 	for v >= 1<<7 {
169 180
 		dAtA[offset] = uint8(v&0x7f | 0x80)
170 181
 		v >>= 7
171 182
 		offset++
172 183
 	}
173 184
 	dAtA[offset] = uint8(v)
174
-	return offset + 1
185
+	return base
175 186
 }
176 187
 func (m *Params) Size() (n int) {
177 188
 	if m == nil {
@@ -194,14 +205,7 @@ func (m *Params) Size() (n int) {
194 205
 }
195 206
 
196 207
 func sovConfig(x uint64) (n int) {
197
-	for {
198
-		n++
199
-		x >>= 7
200
-		if x == 0 {
201
-			break
202
-		}
203
-	}
204
-	return n
208
+	return (math_bits.Len64(x|1) + 6) / 7
205 209
 }
206 210
 func sozConfig(x uint64) (n int) {
207 211
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))

+ 64
- 49
mixer/adapter/circonus/config/config.pb.go View File

@@ -16,6 +16,7 @@ import (
16 16
 	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
17 17
 	io "io"
18 18
 	math "math"
19
+	math_bits "math/bits"
19 20
 	reflect "reflect"
20 21
 	strconv "strconv"
21 22
 	strings "strings"
@@ -83,7 +84,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
83 84
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
84 85
 	} else {
85 86
 		b = b[:cap(b)]
86
-		n, err := m.MarshalTo(b)
87
+		n, err := m.MarshalToSizedBuffer(b)
87 88
 		if err != nil {
88 89
 			return nil, err
89 90
 		}
@@ -122,7 +123,7 @@ func (m *Params_MetricInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
122 123
 		return xxx_messageInfo_Params_MetricInfo.Marshal(b, m, deterministic)
123 124
 	} else {
124 125
 		b = b[:cap(b)]
125
-		n, err := m.MarshalTo(b)
126
+		n, err := m.MarshalToSizedBuffer(b)
126 127
 		if err != nil {
127 128
 			return nil, err
128 129
 		}
@@ -191,7 +192,7 @@ func (x Params_MetricInfo_Type) String() string {
191 192
 func (m *Params) Marshal() (dAtA []byte, err error) {
192 193
 	size := m.Size()
193 194
 	dAtA = make([]byte, size)
194
-	n, err := m.MarshalTo(dAtA)
195
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
195 196
 	if err != nil {
196 197
 		return nil, err
197 198
 	}
@@ -199,43 +200,51 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
199 200
 }
200 201
 
201 202
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
202
-	var i int
203
+	size := m.Size()
204
+	return m.MarshalToSizedBuffer(dAtA[:size])
205
+}
206
+
207
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
208
+	i := len(dAtA)
203 209
 	_ = i
204 210
 	var l int
205 211
 	_ = l
206
-	if len(m.SubmissionUrl) > 0 {
207
-		dAtA[i] = 0xa
208
-		i++
209
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.SubmissionUrl)))
210
-		i += copy(dAtA[i:], m.SubmissionUrl)
211
-	}
212
-	dAtA[i] = 0x12
213
-	i++
214
-	i = encodeVarintConfig(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.SubmissionInterval)))
215
-	n1, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.SubmissionInterval, dAtA[i:])
216
-	if err != nil {
217
-		return 0, err
218
-	}
219
-	i += n1
220 212
 	if len(m.Metrics) > 0 {
221
-		for _, msg := range m.Metrics {
222
-			dAtA[i] = 0x1a
223
-			i++
224
-			i = encodeVarintConfig(dAtA, i, uint64(msg.Size()))
225
-			n, err := msg.MarshalTo(dAtA[i:])
226
-			if err != nil {
227
-				return 0, err
213
+		for iNdEx := len(m.Metrics) - 1; iNdEx >= 0; iNdEx-- {
214
+			{
215
+				size, err := m.Metrics[iNdEx].MarshalToSizedBuffer(dAtA[:i])
216
+				if err != nil {
217
+					return 0, err
218
+				}
219
+				i -= size
220
+				i = encodeVarintConfig(dAtA, i, uint64(size))
228 221
 			}
229
-			i += n
222
+			i--
223
+			dAtA[i] = 0x1a
230 224
 		}
231 225
 	}
232
-	return i, nil
226
+	n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.SubmissionInterval, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.SubmissionInterval):])
227
+	if err1 != nil {
228
+		return 0, err1
229
+	}
230
+	i -= n1
231
+	i = encodeVarintConfig(dAtA, i, uint64(n1))
232
+	i--
233
+	dAtA[i] = 0x12
234
+	if len(m.SubmissionUrl) > 0 {
235
+		i -= len(m.SubmissionUrl)
236
+		copy(dAtA[i:], m.SubmissionUrl)
237
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.SubmissionUrl)))
238
+		i--
239
+		dAtA[i] = 0xa
240
+	}
241
+	return len(dAtA) - i, nil
233 242
 }
234 243
 
235 244
 func (m *Params_MetricInfo) Marshal() (dAtA []byte, err error) {
236 245
 	size := m.Size()
237 246
 	dAtA = make([]byte, size)
238
-	n, err := m.MarshalTo(dAtA)
247
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
239 248
 	if err != nil {
240 249
 		return nil, err
241 250
 	}
@@ -243,32 +252,40 @@ func (m *Params_MetricInfo) Marshal() (dAtA []byte, err error) {
243 252
 }
244 253
 
245 254
 func (m *Params_MetricInfo) MarshalTo(dAtA []byte) (int, error) {
246
-	var i int
255
+	size := m.Size()
256
+	return m.MarshalToSizedBuffer(dAtA[:size])
257
+}
258
+
259
+func (m *Params_MetricInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
260
+	i := len(dAtA)
247 261
 	_ = i
248 262
 	var l int
249 263
 	_ = l
250
-	if len(m.Name) > 0 {
251
-		dAtA[i] = 0xa
252
-		i++
253
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Name)))
254
-		i += copy(dAtA[i:], m.Name)
255
-	}
256 264
 	if m.Type != 0 {
257
-		dAtA[i] = 0x10
258
-		i++
259 265
 		i = encodeVarintConfig(dAtA, i, uint64(m.Type))
266
+		i--
267
+		dAtA[i] = 0x10
268
+	}
269
+	if len(m.Name) > 0 {
270
+		i -= len(m.Name)
271
+		copy(dAtA[i:], m.Name)
272
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Name)))
273
+		i--
274
+		dAtA[i] = 0xa
260 275
 	}
261
-	return i, nil
276
+	return len(dAtA) - i, nil
262 277
 }
263 278
 
264 279
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
280
+	offset -= sovConfig(v)
281
+	base := offset
265 282
 	for v >= 1<<7 {
266 283
 		dAtA[offset] = uint8(v&0x7f | 0x80)
267 284
 		v >>= 7
268 285
 		offset++
269 286
 	}
270 287
 	dAtA[offset] = uint8(v)
271
-	return offset + 1
288
+	return base
272 289
 }
273 290
 func (m *Params) Size() (n int) {
274 291
 	if m == nil {
@@ -308,14 +325,7 @@ func (m *Params_MetricInfo) Size() (n int) {
308 325
 }
309 326
 
310 327
 func sovConfig(x uint64) (n int) {
311
-	for {
312
-		n++
313
-		x >>= 7
314
-		if x == 0 {
315
-			break
316
-		}
317
-	}
318
-	return n
328
+	return (math_bits.Len64(x|1) + 6) / 7
319 329
 }
320 330
 func sozConfig(x uint64) (n int) {
321 331
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -324,10 +334,15 @@ func (this *Params) String() string {
324 334
 	if this == nil {
325 335
 		return "nil"
326 336
 	}
337
+	repeatedStringForMetrics := "[]*Params_MetricInfo{"
338
+	for _, f := range this.Metrics {
339
+		repeatedStringForMetrics += strings.Replace(fmt.Sprintf("%v", f), "Params_MetricInfo", "Params_MetricInfo", 1) + ","
340
+	}
341
+	repeatedStringForMetrics += "}"
327 342
 	s := strings.Join([]string{`&Params{`,
328 343
 		`SubmissionUrl:` + fmt.Sprintf("%v", this.SubmissionUrl) + `,`,
329
-		`SubmissionInterval:` + strings.Replace(strings.Replace(this.SubmissionInterval.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
330
-		`Metrics:` + strings.Replace(fmt.Sprintf("%v", this.Metrics), "Params_MetricInfo", "Params_MetricInfo", 1) + `,`,
344
+		`SubmissionInterval:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.SubmissionInterval), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
345
+		`Metrics:` + repeatedStringForMetrics + `,`,
331 346
 		`}`,
332 347
 	}, "")
333 348
 	return s

+ 98
- 87
mixer/adapter/cloudwatch/config/config.pb.go View File

@@ -22,6 +22,7 @@ import (
22 22
 	github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
23 23
 	io "io"
24 24
 	math "math"
25
+	math_bits "math/bits"
25 26
 	reflect "reflect"
26 27
 	strconv "strconv"
27 28
 	strings "strings"
@@ -161,7 +162,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
161 162
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
162 163
 	} else {
163 164
 		b = b[:cap(b)]
164
-		n, err := m.MarshalTo(b)
165
+		n, err := m.MarshalToSizedBuffer(b)
165 166
 		if err != nil {
166 167
 			return nil, err
167 168
 		}
@@ -235,7 +236,7 @@ func (m *Params_MetricDatum) XXX_Marshal(b []byte, deterministic bool) ([]byte,
235 236
 		return xxx_messageInfo_Params_MetricDatum.Marshal(b, m, deterministic)
236 237
 	} else {
237 238
 		b = b[:cap(b)]
238
-		n, err := m.MarshalTo(b)
239
+		n, err := m.MarshalToSizedBuffer(b)
239 240
 		if err != nil {
240 241
 			return nil, err
241 242
 		}
@@ -280,7 +281,7 @@ func (m *Params_LogInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
280 281
 		return xxx_messageInfo_Params_LogInfo.Marshal(b, m, deterministic)
281 282
 	} else {
282 283
 		b = b[:cap(b)]
283
-		n, err := m.MarshalTo(b)
284
+		n, err := m.MarshalToSizedBuffer(b)
284 285
 		if err != nil {
285 286
 			return nil, err
286 287
 		}
@@ -533,7 +534,7 @@ func valueToGoStringConfig(v interface{}, typ string) string {
533 534
 func (m *Params) Marshal() (dAtA []byte, err error) {
534 535
 	size := m.Size()
535 536
 	dAtA = make([]byte, size)
536
-	n, err := m.MarshalTo(dAtA)
537
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
537 538
 	if err != nil {
538 539
 		return nil, err
539 540
 	}
@@ -541,91 +542,95 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
541 542
 }
542 543
 
543 544
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
544
-	var i int
545
+	size := m.Size()
546
+	return m.MarshalToSizedBuffer(dAtA[:size])
547
+}
548
+
549
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
550
+	i := len(dAtA)
545 551
 	_ = i
546 552
 	var l int
547 553
 	_ = l
548
-	if len(m.Namespace) > 0 {
549
-		dAtA[i] = 0xa
550
-		i++
551
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Namespace)))
552
-		i += copy(dAtA[i:], m.Namespace)
553
-	}
554
-	if len(m.MetricInfo) > 0 {
555
-		for k, _ := range m.MetricInfo {
556
-			dAtA[i] = 0x12
557
-			i++
558
-			v := m.MetricInfo[k]
559
-			msgSize := 0
560
-			if v != nil {
561
-				msgSize = v.Size()
562
-				msgSize += 1 + sovConfig(uint64(msgSize))
563
-			}
564
-			mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + msgSize
565
-			i = encodeVarintConfig(dAtA, i, uint64(mapSize))
566
-			dAtA[i] = 0xa
567
-			i++
568
-			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
569
-			i += copy(dAtA[i:], k)
554
+	if len(m.Logs) > 0 {
555
+		for k := range m.Logs {
556
+			v := m.Logs[k]
557
+			baseI := i
570 558
 			if v != nil {
571
-				dAtA[i] = 0x12
572
-				i++
573
-				i = encodeVarintConfig(dAtA, i, uint64(v.Size()))
574
-				n1, err := v.MarshalTo(dAtA[i:])
575
-				if err != nil {
576
-					return 0, err
559
+				{
560
+					size, err := v.MarshalToSizedBuffer(dAtA[:i])
561
+					if err != nil {
562
+						return 0, err
563
+					}
564
+					i -= size
565
+					i = encodeVarintConfig(dAtA, i, uint64(size))
577 566
 				}
578
-				i += n1
567
+				i--
568
+				dAtA[i] = 0x12
579 569
 			}
570
+			i -= len(k)
571
+			copy(dAtA[i:], k)
572
+			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
573
+			i--
574
+			dAtA[i] = 0xa
575
+			i = encodeVarintConfig(dAtA, i, uint64(baseI-i))
576
+			i--
577
+			dAtA[i] = 0x32
580 578
 		}
581 579
 	}
582
-	if len(m.LogGroupName) > 0 {
583
-		dAtA[i] = 0x22
584
-		i++
585
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.LogGroupName)))
586
-		i += copy(dAtA[i:], m.LogGroupName)
587
-	}
588 580
 	if len(m.LogStreamName) > 0 {
589
-		dAtA[i] = 0x2a
590
-		i++
581
+		i -= len(m.LogStreamName)
582
+		copy(dAtA[i:], m.LogStreamName)
591 583
 		i = encodeVarintConfig(dAtA, i, uint64(len(m.LogStreamName)))
592
-		i += copy(dAtA[i:], m.LogStreamName)
584
+		i--
585
+		dAtA[i] = 0x2a
593 586
 	}
594
-	if len(m.Logs) > 0 {
595
-		for k, _ := range m.Logs {
596
-			dAtA[i] = 0x32
597
-			i++
598
-			v := m.Logs[k]
599
-			msgSize := 0
600
-			if v != nil {
601
-				msgSize = v.Size()
602
-				msgSize += 1 + sovConfig(uint64(msgSize))
603
-			}
604
-			mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + msgSize
605
-			i = encodeVarintConfig(dAtA, i, uint64(mapSize))
606
-			dAtA[i] = 0xa
607
-			i++
608
-			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
609
-			i += copy(dAtA[i:], k)
587
+	if len(m.LogGroupName) > 0 {
588
+		i -= len(m.LogGroupName)
589
+		copy(dAtA[i:], m.LogGroupName)
590
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.LogGroupName)))
591
+		i--
592
+		dAtA[i] = 0x22
593
+	}
594
+	if len(m.MetricInfo) > 0 {
595
+		for k := range m.MetricInfo {
596
+			v := m.MetricInfo[k]
597
+			baseI := i
610 598
 			if v != nil {
611
-				dAtA[i] = 0x12
612
-				i++
613
-				i = encodeVarintConfig(dAtA, i, uint64(v.Size()))
614
-				n2, err := v.MarshalTo(dAtA[i:])
615
-				if err != nil {
616
-					return 0, err
599
+				{
600
+					size, err := v.MarshalToSizedBuffer(dAtA[:i])
601
+					if err != nil {
602
+						return 0, err
603
+					}
604
+					i -= size
605
+					i = encodeVarintConfig(dAtA, i, uint64(size))
617 606
 				}
618
-				i += n2
607
+				i--
608
+				dAtA[i] = 0x12
619 609
 			}
610
+			i -= len(k)
611
+			copy(dAtA[i:], k)
612
+			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
613
+			i--
614
+			dAtA[i] = 0xa
615
+			i = encodeVarintConfig(dAtA, i, uint64(baseI-i))
616
+			i--
617
+			dAtA[i] = 0x12
620 618
 		}
621 619
 	}
622
-	return i, nil
620
+	if len(m.Namespace) > 0 {
621
+		i -= len(m.Namespace)
622
+		copy(dAtA[i:], m.Namespace)
623
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Namespace)))
624
+		i--
625
+		dAtA[i] = 0xa
626
+	}
627
+	return len(dAtA) - i, nil
623 628
 }
624 629
 
625 630
 func (m *Params_MetricDatum) Marshal() (dAtA []byte, err error) {
626 631
 	size := m.Size()
627 632
 	dAtA = make([]byte, size)
628
-	n, err := m.MarshalTo(dAtA)
633
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
629 634
 	if err != nil {
630 635
 		return nil, err
631 636
 	}
@@ -633,22 +638,27 @@ func (m *Params_MetricDatum) Marshal() (dAtA []byte, err error) {
633 638
 }
634 639
 
635 640
 func (m *Params_MetricDatum) MarshalTo(dAtA []byte) (int, error) {
636
-	var i int
641
+	size := m.Size()
642
+	return m.MarshalToSizedBuffer(dAtA[:size])
643
+}
644
+
645
+func (m *Params_MetricDatum) MarshalToSizedBuffer(dAtA []byte) (int, error) {
646
+	i := len(dAtA)
637 647
 	_ = i
638 648
 	var l int
639 649
 	_ = l
640 650
 	if m.Unit != 0 {
641
-		dAtA[i] = 0x18
642
-		i++
643 651
 		i = encodeVarintConfig(dAtA, i, uint64(m.Unit))
652
+		i--
653
+		dAtA[i] = 0x18
644 654
 	}
645
-	return i, nil
655
+	return len(dAtA) - i, nil
646 656
 }
647 657
 
648 658
 func (m *Params_LogInfo) Marshal() (dAtA []byte, err error) {
649 659
 	size := m.Size()
650 660
 	dAtA = make([]byte, size)
651
-	n, err := m.MarshalTo(dAtA)
661
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
652 662
 	if err != nil {
653 663
 		return nil, err
654 664
 	}
@@ -656,27 +666,35 @@ func (m *Params_LogInfo) Marshal() (dAtA []byte, err error) {
656 666
 }
657 667
 
658 668
 func (m *Params_LogInfo) MarshalTo(dAtA []byte) (int, error) {
659
-	var i int
669
+	size := m.Size()
670
+	return m.MarshalToSizedBuffer(dAtA[:size])
671
+}
672
+
673
+func (m *Params_LogInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
674
+	i := len(dAtA)
660 675
 	_ = i
661 676
 	var l int
662 677
 	_ = l
663 678
 	if len(m.PayloadTemplate) > 0 {
664
-		dAtA[i] = 0xa
665
-		i++
679
+		i -= len(m.PayloadTemplate)
680
+		copy(dAtA[i:], m.PayloadTemplate)
666 681
 		i = encodeVarintConfig(dAtA, i, uint64(len(m.PayloadTemplate)))
667
-		i += copy(dAtA[i:], m.PayloadTemplate)
682
+		i--
683
+		dAtA[i] = 0xa
668 684
 	}
669
-	return i, nil
685
+	return len(dAtA) - i, nil
670 686
 }
671 687
 
672 688
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
689
+	offset -= sovConfig(v)
690
+	base := offset
673 691
 	for v >= 1<<7 {
674 692
 		dAtA[offset] = uint8(v&0x7f | 0x80)
675 693
 		v >>= 7
676 694
 		offset++
677 695
 	}
678 696
 	dAtA[offset] = uint8(v)
679
-	return offset + 1
697
+	return base
680 698
 }
681 699
 func (m *Params) Size() (n int) {
682 700
 	if m == nil {
@@ -751,14 +769,7 @@ func (m *Params_LogInfo) Size() (n int) {
751 769
 }
752 770
 
753 771
 func sovConfig(x uint64) (n int) {
754
-	for {
755
-		n++
756
-		x >>= 7
757
-		if x == 0 {
758
-			break
759
-		}
760
-	}
761
-	return n
772
+	return (math_bits.Len64(x|1) + 6) / 7
762 773
 }
763 774
 func sozConfig(x uint64) (n int) {
764 775
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))

+ 37
- 34
mixer/adapter/denier/config/config.pb.go View File

@@ -12,13 +12,14 @@ package config
12 12
 
13 13
 import (
14 14
 	fmt "fmt"
15
-	rpc "github.com/gogo/googleapis/google/rpc"
16 15
 	_ "github.com/gogo/protobuf/gogoproto"
17 16
 	proto "github.com/gogo/protobuf/proto"
18 17
 	_ "github.com/gogo/protobuf/types"
19 18
 	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
20 19
 	io "io"
20
+	rpc "istio.io/gogo-genproto/googleapis/google/rpc"
21 21
 	math "math"
22
+	math_bits "math/bits"
22 23
 	reflect "reflect"
23 24
 	strings "strings"
24 25
 	time "time"
@@ -59,7 +60,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
59 60
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
60 61
 	} else {
61 62
 		b = b[:cap(b)]
62
-		n, err := m.MarshalTo(b)
63
+		n, err := m.MarshalToSizedBuffer(b)
63 64
 		if err != nil {
64 65
 			return nil, err
65 66
 		}
@@ -112,7 +113,7 @@ var fileDescriptor_c08be602ddb157bc = []byte{
112 113
 func (m *Params) Marshal() (dAtA []byte, err error) {
113 114
 	size := m.Size()
114 115
 	dAtA = make([]byte, size)
115
-	n, err := m.MarshalTo(dAtA)
116
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
116 117
 	if err != nil {
117 118
 		return nil, err
118 119
 	}
@@ -120,42 +121,51 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
120 121
 }
121 122
 
122 123
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
123
-	var i int
124
+	size := m.Size()
125
+	return m.MarshalToSizedBuffer(dAtA[:size])
126
+}
127
+
128
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
129
+	i := len(dAtA)
124 130
 	_ = i
125 131
 	var l int
126 132
 	_ = l
127
-	dAtA[i] = 0xa
128
-	i++
129
-	i = encodeVarintConfig(dAtA, i, uint64(m.Status.Size()))
130
-	n1, err := m.Status.MarshalTo(dAtA[i:])
131
-	if err != nil {
132
-		return 0, err
133
-	}
134
-	i += n1
135
-	dAtA[i] = 0x12
136
-	i++
137
-	i = encodeVarintConfig(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration)))
138
-	n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i:])
139
-	if err != nil {
140
-		return 0, err
141
-	}
142
-	i += n2
143 133
 	if m.ValidUseCount != 0 {
144
-		dAtA[i] = 0x18
145
-		i++
146 134
 		i = encodeVarintConfig(dAtA, i, uint64(m.ValidUseCount))
135
+		i--
136
+		dAtA[i] = 0x18
137
+	}
138
+	n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.ValidDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.ValidDuration):])
139
+	if err1 != nil {
140
+		return 0, err1
141
+	}
142
+	i -= n1
143
+	i = encodeVarintConfig(dAtA, i, uint64(n1))
144
+	i--
145
+	dAtA[i] = 0x12
146
+	{
147
+		size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
148
+		if err != nil {
149
+			return 0, err
150
+		}
151
+		i -= size
152
+		i = encodeVarintConfig(dAtA, i, uint64(size))
147 153
 	}
148
-	return i, nil
154
+	i--
155
+	dAtA[i] = 0xa
156
+	return len(dAtA) - i, nil
149 157
 }
150 158
 
151 159
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
160
+	offset -= sovConfig(v)
161
+	base := offset
152 162
 	for v >= 1<<7 {
153 163
 		dAtA[offset] = uint8(v&0x7f | 0x80)
154 164
 		v >>= 7
155 165
 		offset++
156 166
 	}
157 167
 	dAtA[offset] = uint8(v)
158
-	return offset + 1
168
+	return base
159 169
 }
160 170
 func (m *Params) Size() (n int) {
161 171
 	if m == nil {
@@ -174,14 +184,7 @@ func (m *Params) Size() (n int) {
174 184
 }
175 185
 
176 186
 func sovConfig(x uint64) (n int) {
177
-	for {
178
-		n++
179
-		x >>= 7
180
-		if x == 0 {
181
-			break
182
-		}
183
-	}
184
-	return n
187
+	return (math_bits.Len64(x|1) + 6) / 7
185 188
 }
186 189
 func sozConfig(x uint64) (n int) {
187 190
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -191,8 +194,8 @@ func (this *Params) String() string {
191 194
 		return "nil"
192 195
 	}
193 196
 	s := strings.Join([]string{`&Params{`,
194
-		`Status:` + strings.Replace(strings.Replace(this.Status.String(), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`,
195
-		`ValidDuration:` + strings.Replace(strings.Replace(this.ValidDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
197
+		`Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "Status", "rpc.Status", 1), `&`, ``, 1) + `,`,
198
+		`ValidDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ValidDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
196 199
 		`ValidUseCount:` + fmt.Sprintf("%v", this.ValidUseCount) + `,`,
197 200
 		`}`,
198 201
 	}, "")

+ 1
- 1
mixer/adapter/denier/denier.go View File

@@ -27,7 +27,7 @@ import (
27 27
 	"context"
28 28
 	"time"
29 29
 
30
-	"github.com/gogo/googleapis/google/rpc"
30
+	rpc "istio.io/gogo-genproto/googleapis/google/rpc"
31 31
 
32 32
 	"istio.io/istio/mixer/adapter/denier/config"
33 33
 	"istio.io/istio/mixer/adapter/metadata"

+ 110
- 99
mixer/adapter/dogstatsd/config/config.pb.go View File

@@ -16,6 +16,7 @@ import (
16 16
 	github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
17 17
 	io "io"
18 18
 	math "math"
19
+	math_bits "math/bits"
19 20
 	reflect "reflect"
20 21
 	strconv "strconv"
21 22
 	strings "strings"
@@ -102,7 +103,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
102 103
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
103 104
 	} else {
104 105
 		b = b[:cap(b)]
105
-		n, err := m.MarshalTo(b)
106
+		n, err := m.MarshalToSizedBuffer(b)
106 107
 		if err != nil {
107 108
 			return nil, err
108 109
 		}
@@ -187,7 +188,7 @@ func (m *Params_MetricInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
187 188
 		return xxx_messageInfo_Params_MetricInfo.Marshal(b, m, deterministic)
188 189
 	} else {
189 190
 		b = b[:cap(b)]
190
-		n, err := m.MarshalTo(b)
191
+		n, err := m.MarshalToSizedBuffer(b)
191 192
 		if err != nil {
192 193
 			return nil, err
193 194
 		}
@@ -441,7 +442,7 @@ func valueToGoStringConfig(v interface{}, typ string) string {
441 442
 func (m *Params) Marshal() (dAtA []byte, err error) {
442 443
 	size := m.Size()
443 444
 	dAtA = make([]byte, size)
444
-	n, err := m.MarshalTo(dAtA)
445
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
445 446
 	if err != nil {
446 447
 		return nil, err
447 448
 	}
@@ -449,85 +450,92 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
449 450
 }
450 451
 
451 452
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
452
-	var i int
453
+	size := m.Size()
454
+	return m.MarshalToSizedBuffer(dAtA[:size])
455
+}
456
+
457
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
458
+	i := len(dAtA)
453 459
 	_ = i
454 460
 	var l int
455 461
 	_ = l
456
-	if len(m.Address) > 0 {
457
-		dAtA[i] = 0xa
458
-		i++
459
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Address)))
460
-		i += copy(dAtA[i:], m.Address)
461
-	}
462
-	if len(m.Prefix) > 0 {
463
-		dAtA[i] = 0x12
464
-		i++
465
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Prefix)))
466
-		i += copy(dAtA[i:], m.Prefix)
467
-	}
468
-	if m.BufferLength != 0 {
469
-		dAtA[i] = 0x18
470
-		i++
471
-		i = encodeVarintConfig(dAtA, i, uint64(m.BufferLength))
472
-	}
473
-	if len(m.GlobalTags) > 0 {
474
-		for k, _ := range m.GlobalTags {
475
-			dAtA[i] = 0x22
476
-			i++
477
-			v := m.GlobalTags[k]
478
-			mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + len(v) + sovConfig(uint64(len(v)))
479
-			i = encodeVarintConfig(dAtA, i, uint64(mapSize))
480
-			dAtA[i] = 0xa
481
-			i++
462
+	if len(m.Metrics) > 0 {
463
+		for k := range m.Metrics {
464
+			v := m.Metrics[k]
465
+			baseI := i
466
+			if v != nil {
467
+				{
468
+					size, err := v.MarshalToSizedBuffer(dAtA[:i])
469
+					if err != nil {
470
+						return 0, err
471
+					}
472
+					i -= size
473
+					i = encodeVarintConfig(dAtA, i, uint64(size))
474
+				}
475
+				i--
476
+				dAtA[i] = 0x12
477
+			}
478
+			i -= len(k)
479
+			copy(dAtA[i:], k)
482 480
 			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
483
-			i += copy(dAtA[i:], k)
484
-			dAtA[i] = 0x12
485
-			i++
486
-			i = encodeVarintConfig(dAtA, i, uint64(len(v)))
487
-			i += copy(dAtA[i:], v)
481
+			i--
482
+			dAtA[i] = 0xa
483
+			i = encodeVarintConfig(dAtA, i, uint64(baseI-i))
484
+			i--
485
+			dAtA[i] = 0x32
488 486
 		}
489 487
 	}
490 488
 	if m.SampleRate != 0 {
491
-		dAtA[i] = 0x29
492
-		i++
489
+		i -= 8
493 490
 		encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SampleRate))))
494
-		i += 8
491
+		i--
492
+		dAtA[i] = 0x29
495 493
 	}
496
-	if len(m.Metrics) > 0 {
497
-		for k, _ := range m.Metrics {
498
-			dAtA[i] = 0x32
499
-			i++
500
-			v := m.Metrics[k]
501
-			msgSize := 0
502
-			if v != nil {
503
-				msgSize = v.Size()
504
-				msgSize += 1 + sovConfig(uint64(msgSize))
505
-			}
506
-			mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + msgSize
507
-			i = encodeVarintConfig(dAtA, i, uint64(mapSize))
508
-			dAtA[i] = 0xa
509
-			i++
494
+	if len(m.GlobalTags) > 0 {
495
+		for k := range m.GlobalTags {
496
+			v := m.GlobalTags[k]
497
+			baseI := i
498
+			i -= len(v)
499
+			copy(dAtA[i:], v)
500
+			i = encodeVarintConfig(dAtA, i, uint64(len(v)))
501
+			i--
502
+			dAtA[i] = 0x12
503
+			i -= len(k)
504
+			copy(dAtA[i:], k)
510 505
 			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
511
-			i += copy(dAtA[i:], k)
512
-			if v != nil {
513
-				dAtA[i] = 0x12
514
-				i++
515
-				i = encodeVarintConfig(dAtA, i, uint64(v.Size()))
516
-				n1, err := v.MarshalTo(dAtA[i:])
517
-				if err != nil {
518
-					return 0, err
519
-				}
520
-				i += n1
521
-			}
506
+			i--
507
+			dAtA[i] = 0xa
508
+			i = encodeVarintConfig(dAtA, i, uint64(baseI-i))
509
+			i--
510
+			dAtA[i] = 0x22
522 511
 		}
523 512
 	}
524
-	return i, nil
513
+	if m.BufferLength != 0 {
514
+		i = encodeVarintConfig(dAtA, i, uint64(m.BufferLength))
515
+		i--
516
+		dAtA[i] = 0x18
517
+	}
518
+	if len(m.Prefix) > 0 {
519
+		i -= len(m.Prefix)
520
+		copy(dAtA[i:], m.Prefix)
521
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Prefix)))
522
+		i--
523
+		dAtA[i] = 0x12
524
+	}
525
+	if len(m.Address) > 0 {
526
+		i -= len(m.Address)
527
+		copy(dAtA[i:], m.Address)
528
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Address)))
529
+		i--
530
+		dAtA[i] = 0xa
531
+	}
532
+	return len(dAtA) - i, nil
525 533
 }
526 534
 
527 535
 func (m *Params_MetricInfo) Marshal() (dAtA []byte, err error) {
528 536
 	size := m.Size()
529 537
 	dAtA = make([]byte, size)
530
-	n, err := m.MarshalTo(dAtA)
538
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
531 539
 	if err != nil {
532 540
 		return nil, err
533 541
 	}
@@ -535,49 +543,59 @@ func (m *Params_MetricInfo) Marshal() (dAtA []byte, err error) {
535 543
 }
536 544
 
537 545
 func (m *Params_MetricInfo) MarshalTo(dAtA []byte) (int, error) {
538
-	var i int
546
+	size := m.Size()
547
+	return m.MarshalToSizedBuffer(dAtA[:size])
548
+}
549
+
550
+func (m *Params_MetricInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
551
+	i := len(dAtA)
539 552
 	_ = i
540 553
 	var l int
541 554
 	_ = l
542
-	if len(m.Name) > 0 {
543
-		dAtA[i] = 0xa
544
-		i++
545
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Name)))
546
-		i += copy(dAtA[i:], m.Name)
547
-	}
548
-	if m.Type != 0 {
549
-		dAtA[i] = 0x10
550
-		i++
551
-		i = encodeVarintConfig(dAtA, i, uint64(m.Type))
552
-	}
553 555
 	if len(m.Tags) > 0 {
554
-		for k, _ := range m.Tags {
555
-			dAtA[i] = 0x1a
556
-			i++
556
+		for k := range m.Tags {
557 557
 			v := m.Tags[k]
558
-			mapSize := 1 + len(k) + sovConfig(uint64(len(k))) + 1 + len(v) + sovConfig(uint64(len(v)))
559
-			i = encodeVarintConfig(dAtA, i, uint64(mapSize))
560
-			dAtA[i] = 0xa
561
-			i++
562
-			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
563
-			i += copy(dAtA[i:], k)
564
-			dAtA[i] = 0x12
565
-			i++
558
+			baseI := i
559
+			i -= len(v)
560
+			copy(dAtA[i:], v)
566 561
 			i = encodeVarintConfig(dAtA, i, uint64(len(v)))
567
-			i += copy(dAtA[i:], v)
562
+			i--
563
+			dAtA[i] = 0x12
564
+			i -= len(k)
565
+			copy(dAtA[i:], k)
566
+			i = encodeVarintConfig(dAtA, i, uint64(len(k)))
567
+			i--
568
+			dAtA[i] = 0xa
569
+			i = encodeVarintConfig(dAtA, i, uint64(baseI-i))
570
+			i--
571
+			dAtA[i] = 0x1a
568 572
 		}
569 573
 	}
570
-	return i, nil
574
+	if m.Type != 0 {
575
+		i = encodeVarintConfig(dAtA, i, uint64(m.Type))
576
+		i--
577
+		dAtA[i] = 0x10
578
+	}
579
+	if len(m.Name) > 0 {
580
+		i -= len(m.Name)
581
+		copy(dAtA[i:], m.Name)
582
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Name)))
583
+		i--
584
+		dAtA[i] = 0xa
585
+	}
586
+	return len(dAtA) - i, nil
571 587
 }
572 588
 
573 589
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
590
+	offset -= sovConfig(v)
591
+	base := offset
574 592
 	for v >= 1<<7 {
575 593
 		dAtA[offset] = uint8(v&0x7f | 0x80)
576 594
 		v >>= 7
577 595
 		offset++
578 596
 	}
579 597
 	dAtA[offset] = uint8(v)
580
-	return offset + 1
598
+	return base
581 599
 }
582 600
 func (m *Params) Size() (n int) {
583 601
 	if m == nil {
@@ -648,14 +666,7 @@ func (m *Params_MetricInfo) Size() (n int) {
648 666
 }
649 667
 
650 668
 func sovConfig(x uint64) (n int) {
651
-	for {
652
-		n++
653
-		x >>= 7
654
-		if x == 0 {
655
-			break
656
-		}
657
-	}
658
-	return n
669
+	return (math_bits.Len64(x|1) + 6) / 7
659 670
 }
660 671
 func sozConfig(x uint64) (n int) {
661 672
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))

+ 50
- 48
mixer/adapter/fluentd/config/config.pb.go View File

@@ -16,6 +16,7 @@ import (
16 16
 	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
17 17
 	io "io"
18 18
 	math "math"
19
+	math_bits "math/bits"
19 20
 	reflect "reflect"
20 21
 	strings "strings"
21 22
 	time "time"
@@ -84,7 +85,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
84 85
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
85 86
 	} else {
86 87
 		b = b[:cap(b)]
87
-		n, err := m.MarshalTo(b)
88
+		n, err := m.MarshalToSizedBuffer(b)
88 89
 		if err != nil {
89 90
 			return nil, err
90 91
 		}
@@ -142,7 +143,7 @@ var fileDescriptor_b8ce6b52845040ff = []byte{
142 143
 func (m *Params) Marshal() (dAtA []byte, err error) {
143 144
 	size := m.Size()
144 145
 	dAtA = make([]byte, size)
145
-	n, err := m.MarshalTo(dAtA)
146
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
146 147
 	if err != nil {
147 148
 		return nil, err
148 149
 	}
@@ -150,63 +151,71 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
150 151
 }
151 152
 
152 153
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
153
-	var i int
154
+	size := m.Size()
155
+	return m.MarshalToSizedBuffer(dAtA[:size])
156
+}
157
+
158
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
159
+	i := len(dAtA)
154 160
 	_ = i
155 161
 	var l int
156 162
 	_ = l
157
-	if len(m.Address) > 0 {
158
-		dAtA[i] = 0xa
159
-		i++
160
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.Address)))
161
-		i += copy(dAtA[i:], m.Address)
163
+	n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.PushTimeoutDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.PushTimeoutDuration):])
164
+	if err1 != nil {
165
+		return 0, err1
166
+	}
167
+	i -= n1
168
+	i = encodeVarintConfig(dAtA, i, uint64(n1))
169
+	i--
170
+	dAtA[i] = 0x32
171
+	n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.PushIntervalDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.PushIntervalDuration):])
172
+	if err2 != nil {
173
+		return 0, err2
174
+	}
175
+	i -= n2
176
+	i = encodeVarintConfig(dAtA, i, uint64(n2))
177
+	i--
178
+	dAtA[i] = 0x2a
179
+	if m.MaxBatchSizeBytes != 0 {
180
+		i = encodeVarintConfig(dAtA, i, uint64(m.MaxBatchSizeBytes))
181
+		i--
182
+		dAtA[i] = 0x20
183
+	}
184
+	if m.InstanceBufferSize != 0 {
185
+		i = encodeVarintConfig(dAtA, i, uint64(m.InstanceBufferSize))
186
+		i--
187
+		dAtA[i] = 0x18
162 188
 	}
163 189
 	if m.IntegerDuration {
164
-		dAtA[i] = 0x10
165
-		i++
190
+		i--
166 191
 		if m.IntegerDuration {
167 192
 			dAtA[i] = 1
168 193
 		} else {
169 194
 			dAtA[i] = 0
170 195
 		}
171
-		i++
172
-	}
173
-	if m.InstanceBufferSize != 0 {
174
-		dAtA[i] = 0x18
175
-		i++
176
-		i = encodeVarintConfig(dAtA, i, uint64(m.InstanceBufferSize))
177
-	}
178
-	if m.MaxBatchSizeBytes != 0 {
179
-		dAtA[i] = 0x20
180
-		i++
181
-		i = encodeVarintConfig(dAtA, i, uint64(m.MaxBatchSizeBytes))
182
-	}
183
-	dAtA[i] = 0x2a
184
-	i++
185
-	i = encodeVarintConfig(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.PushIntervalDuration)))
186
-	n1, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.PushIntervalDuration, dAtA[i:])
187
-	if err != nil {
188
-		return 0, err
196
+		i--
197
+		dAtA[i] = 0x10
189 198
 	}
190
-	i += n1
191
-	dAtA[i] = 0x32
192
-	i++
193
-	i = encodeVarintConfig(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.PushTimeoutDuration)))
194
-	n2, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.PushTimeoutDuration, dAtA[i:])
195
-	if err != nil {
196
-		return 0, err
199
+	if len(m.Address) > 0 {
200
+		i -= len(m.Address)
201
+		copy(dAtA[i:], m.Address)
202
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.Address)))
203
+		i--
204
+		dAtA[i] = 0xa
197 205
 	}
198
-	i += n2
199
-	return i, nil
206
+	return len(dAtA) - i, nil
200 207
 }
201 208
 
202 209
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
210
+	offset -= sovConfig(v)
211
+	base := offset
203 212
 	for v >= 1<<7 {
204 213
 		dAtA[offset] = uint8(v&0x7f | 0x80)
205 214
 		v >>= 7
206 215
 		offset++
207 216
 	}
208 217
 	dAtA[offset] = uint8(v)
209
-	return offset + 1
218
+	return base
210 219
 }
211 220
 func (m *Params) Size() (n int) {
212 221
 	if m == nil {
@@ -235,14 +244,7 @@ func (m *Params) Size() (n int) {
235 244
 }
236 245
 
237 246
 func sovConfig(x uint64) (n int) {
238
-	for {
239
-		n++
240
-		x >>= 7
241
-		if x == 0 {
242
-			break
243
-		}
244
-	}
245
-	return n
247
+	return (math_bits.Len64(x|1) + 6) / 7
246 248
 }
247 249
 func sozConfig(x uint64) (n int) {
248 250
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -256,8 +258,8 @@ func (this *Params) String() string {
256 258
 		`IntegerDuration:` + fmt.Sprintf("%v", this.IntegerDuration) + `,`,
257 259
 		`InstanceBufferSize:` + fmt.Sprintf("%v", this.InstanceBufferSize) + `,`,
258 260
 		`MaxBatchSizeBytes:` + fmt.Sprintf("%v", this.MaxBatchSizeBytes) + `,`,
259
-		`PushIntervalDuration:` + strings.Replace(strings.Replace(this.PushIntervalDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
260
-		`PushTimeoutDuration:` + strings.Replace(strings.Replace(this.PushTimeoutDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
261
+		`PushIntervalDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.PushIntervalDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
262
+		`PushTimeoutDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.PushTimeoutDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
261 263
 		`}`,
262 264
 	}, "")
263 265
 	return s

+ 34
- 31
mixer/adapter/kubernetesenv/config/config.pb.go View File

@@ -16,6 +16,7 @@ import (
16 16
 	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
17 17
 	io "io"
18 18
 	math "math"
19
+	math_bits "math/bits"
19 20
 	reflect "reflect"
20 21
 	strings "strings"
21 22
 	time "time"
@@ -89,7 +90,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
89 90
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
90 91
 	} else {
91 92
 		b = b[:cap(b)]
92
-		n, err := m.MarshalTo(b)
93
+		n, err := m.MarshalToSizedBuffer(b)
93 94
 		if err != nil {
94 95
 			return nil, err
95 96
 		}
@@ -145,7 +146,7 @@ var fileDescriptor_b321b360e762a48d = []byte{
145 146
 func (m *Params) Marshal() (dAtA []byte, err error) {
146 147
 	size := m.Size()
147 148
 	dAtA = make([]byte, size)
148
-	n, err := m.MarshalTo(dAtA)
149
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
149 150
 	if err != nil {
150 151
 		return nil, err
151 152
 	}
@@ -153,41 +154,50 @@ func (m *Params) Marshal() (dAtA []byte, err error) {
153 154
 }
154 155
 
155 156
 func (m *Params) MarshalTo(dAtA []byte) (int, error) {
156
-	var i int
157
+	size := m.Size()
158
+	return m.MarshalToSizedBuffer(dAtA[:size])
159
+}
160
+
161
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
162
+	i := len(dAtA)
157 163
 	_ = i
158 164
 	var l int
159 165
 	_ = l
160
-	if len(m.KubeconfigPath) > 0 {
161
-		dAtA[i] = 0xa
162
-		i++
163
-		i = encodeVarintConfig(dAtA, i, uint64(len(m.KubeconfigPath)))
164
-		i += copy(dAtA[i:], m.KubeconfigPath)
165
-	}
166
-	dAtA[i] = 0x12
167
-	i++
168
-	i = encodeVarintConfig(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.CacheRefreshDuration)))
169
-	n1, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.CacheRefreshDuration, dAtA[i:])
170
-	if err != nil {
171
-		return 0, err
172
-	}
173
-	i += n1
174 166
 	if len(m.ClusterRegistriesNamespace) > 0 {
175
-		dAtA[i] = 0x3a
176
-		i++
167
+		i -= len(m.ClusterRegistriesNamespace)
168
+		copy(dAtA[i:], m.ClusterRegistriesNamespace)
177 169
 		i = encodeVarintConfig(dAtA, i, uint64(len(m.ClusterRegistriesNamespace)))
178
-		i += copy(dAtA[i:], m.ClusterRegistriesNamespace)
170
+		i--
171
+		dAtA[i] = 0x3a
172
+	}
173
+	n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.CacheRefreshDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.CacheRefreshDuration):])
174
+	if err1 != nil {
175
+		return 0, err1
176
+	}
177
+	i -= n1
178
+	i = encodeVarintConfig(dAtA, i, uint64(n1))
179
+	i--
180
+	dAtA[i] = 0x12
181
+	if len(m.KubeconfigPath) > 0 {
182
+		i -= len(m.KubeconfigPath)
183
+		copy(dAtA[i:], m.KubeconfigPath)
184
+		i = encodeVarintConfig(dAtA, i, uint64(len(m.KubeconfigPath)))
185
+		i--
186
+		dAtA[i] = 0xa
179 187
 	}
180
-	return i, nil
188
+	return len(dAtA) - i, nil
181 189
 }
182 190
 
183 191
 func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
192
+	offset -= sovConfig(v)
193
+	base := offset
184 194
 	for v >= 1<<7 {
185 195
 		dAtA[offset] = uint8(v&0x7f | 0x80)
186 196
 		v >>= 7
187 197
 		offset++
188 198
 	}
189 199
 	dAtA[offset] = uint8(v)
190
-	return offset + 1
200
+	return base
191 201
 }
192 202
 func (m *Params) Size() (n int) {
193 203
 	if m == nil {
@@ -209,14 +219,7 @@ func (m *Params) Size() (n int) {
209 219
 }
210 220
 
211 221
 func sovConfig(x uint64) (n int) {
212
-	for {
213
-		n++
214
-		x >>= 7
215
-		if x == 0 {
216
-			break
217
-		}
218
-	}
219
-	return n
222
+	return (math_bits.Len64(x|1) + 6) / 7
220 223
 }
221 224
 func sozConfig(x uint64) (n int) {
222 225
 	return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -227,7 +230,7 @@ func (this *Params) String() string {
227 230
 	}
228 231
 	s := strings.Join([]string{`&Params{`,
229 232
 		`KubeconfigPath:` + fmt.Sprintf("%v", this.KubeconfigPath) + `,`,
230
-		`CacheRefreshDuration:` + strings.Replace(strings.Replace(this.CacheRefreshDuration.String(), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
233
+		`CacheRefreshDuration:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CacheRefreshDuration), "Duration", "types.Duration", 1), `&`, ``, 1) + `,`,
231 234
 		`ClusterRegistriesNamespace:` + fmt.Sprintf("%v", this.ClusterRegistriesNamespace) + `,`,
232 235
 		`}`,
233 236
 	}, "")

+ 393
- 314
mixer/adapter/kubernetesenv/template/template_handler_service.pb.go View File

@@ -49,10 +49,13 @@ import (
49 49
 	github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
50 50
 	types "github.com/gogo/protobuf/types"
51 51
 	grpc "google.golang.org/grpc"
52
+	codes "google.golang.org/grpc/codes"
53
+	status "google.golang.org/grpc/status"
52 54
 	io "io"
53 55
 	_ "istio.io/api/mixer/adapter/model/v1beta1"
54 56
 	v1beta1 "istio.io/api/policy/v1beta1"
55 57
 	math "math"
58
+	math_bits "math/bits"
56 59
 	reflect "reflect"
57 60
 	strings "strings"
58 61
 )
@@ -96,7 +99,7 @@ func (m *HandleKubernetesRequest) XXX_Marshal(b []byte, deterministic bool) ([]b
96 99
 		return xxx_messageInfo_HandleKubernetesRequest.Marshal(b, m, deterministic)
97 100
 	} else {
98 101
 		b = b[:cap(b)]
99
-		n, err := m.MarshalTo(b)
102
+		n, err := m.MarshalToSizedBuffer(b)
100 103
 		if err != nil {
101 104
 			return nil, err
102 105
 		}
@@ -180,7 +183,7 @@ func (m *OutputMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
180 183
 		return xxx_messageInfo_OutputMsg.Marshal(b, m, deterministic)
181 184
 	} else {
182 185
 		b = b[:cap(b)]
183
-		n, err := m.MarshalTo(b)
186
+		n, err := m.MarshalToSizedBuffer(b)
184 187
 		if err != nil {
185 188
 			return nil, err
186 189
 		}
@@ -229,7 +232,7 @@ func (m *InstanceMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
229 232
 		return xxx_messageInfo_InstanceMsg.Marshal(b, m, deterministic)
230 233
 	} else {
231 234
 		b = b[:cap(b)]
232
-		n, err := m.MarshalTo(b)
235
+		n, err := m.MarshalToSizedBuffer(b)
233 236
 		if err != nil {
234 237
 			return nil, err
235 238
 		}
@@ -266,7 +269,7 @@ func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
266 269
 		return xxx_messageInfo_Type.Marshal(b, m, deterministic)
267 270
 	} else {
268 271
 		b = b[:cap(b)]
269
-		n, err := m.MarshalTo(b)
272
+		n, err := m.MarshalToSizedBuffer(b)
270 273
 		if err != nil {
271 274
 			return nil, err
272 275
 		}
@@ -318,7 +321,7 @@ func (m *InstanceParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
318 321
 		return xxx_messageInfo_InstanceParam.Marshal(b, m, deterministic)
319 322
 	} else {
320 323
 		b = b[:cap(b)]
321
-		n, err := m.MarshalTo(b)
324
+		n, err := m.MarshalToSizedBuffer(b)
322 325
 		if err != nil {
323 326
 			return nil, err
324 327
 		}
@@ -462,6 +465,14 @@ type HandleKubernetesServiceServer interface {
462 465
 	HandleKubernetes(context.Context, *HandleKubernetesRequest) (*OutputMsg, error)
463 466
 }
464 467
 
468
+// UnimplementedHandleKubernetesServiceServer can be embedded to have forward compatible implementations.
469
+type UnimplementedHandleKubernetesServiceServer struct {
470
+}
471
+
472
+func (*UnimplementedHandleKubernetesServiceServer) HandleKubernetes(ctx context.Context, req *HandleKubernetesRequest) (*OutputMsg, error) {
473
+	return nil, status.Errorf(codes.Unimplemented, "method HandleKubernetes not implemented")
474
+}
475
+
465 476
 func RegisterHandleKubernetesServiceServer(s *grpc.Server, srv HandleKubernetesServiceServer) {
466 477
 	s.RegisterService(&_HandleKubernetesService_serviceDesc, srv)
467 478
 }
@@ -500,7 +511,7 @@ var _HandleKubernetesService_serviceDesc = grpc.ServiceDesc{
500 511
 func (m *HandleKubernetesRequest) Marshal() (dAtA []byte, err error) {
501 512
 	size := m.Size()
502 513
 	dAtA = make([]byte, size)
503
-	n, err := m.MarshalTo(dAtA)
514
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
504 515
 	if err != nil {
505 516
 		return nil, err
506 517
 	}
@@ -508,43 +519,53 @@ func (m *HandleKubernetesRequest) Marshal() (dAtA []byte, err error) {
508 519
 }
509 520
 
510 521
 func (m *HandleKubernetesRequest) MarshalTo(dAtA []byte) (int, error) {
511
-	var i int
522
+	size := m.Size()
523
+	return m.MarshalToSizedBuffer(dAtA[:size])
524
+}
525
+
526
+func (m *HandleKubernetesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
527
+	i := len(dAtA)
512 528
 	_ = i
513 529
 	var l int
514 530
 	_ = l
515
-	if m.Instance != nil {
516
-		dAtA[i] = 0xa
517
-		i++
518
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.Instance.Size()))
519
-		n1, err := m.Instance.MarshalTo(dAtA[i:])
520
-		if err != nil {
521
-			return 0, err
522
-		}
523
-		i += n1
531
+	if len(m.DedupId) > 0 {
532
+		i -= len(m.DedupId)
533
+		copy(dAtA[i:], m.DedupId)
534
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DedupId)))
535
+		i--
536
+		dAtA[i] = 0x1a
524 537
 	}
525 538
 	if m.AdapterConfig != nil {
526
-		dAtA[i] = 0x12
527
-		i++
528
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.AdapterConfig.Size()))
529
-		n2, err := m.AdapterConfig.MarshalTo(dAtA[i:])
530
-		if err != nil {
531
-			return 0, err
539
+		{
540
+			size, err := m.AdapterConfig.MarshalToSizedBuffer(dAtA[:i])
541
+			if err != nil {
542
+				return 0, err
543
+			}
544
+			i -= size
545
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
532 546
 		}
533
-		i += n2
547
+		i--
548
+		dAtA[i] = 0x12
534 549
 	}
535
-	if len(m.DedupId) > 0 {
536
-		dAtA[i] = 0x1a
537
-		i++
538
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DedupId)))
539
-		i += copy(dAtA[i:], m.DedupId)
550
+	if m.Instance != nil {
551
+		{
552
+			size, err := m.Instance.MarshalToSizedBuffer(dAtA[:i])
553
+			if err != nil {
554
+				return 0, err
555
+			}
556
+			i -= size
557
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
558
+		}
559
+		i--
560
+		dAtA[i] = 0xa
540 561
 	}
541
-	return i, nil
562
+	return len(dAtA) - i, nil
542 563
 }
543 564
 
544 565
 func (m *OutputMsg) Marshal() (dAtA []byte, err error) {
545 566
 	size := m.Size()
546 567
 	dAtA = make([]byte, size)
547
-	n, err := m.MarshalTo(dAtA)
568
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
548 569
 	if err != nil {
549 570
 		return nil, err
550 571
 	}
@@ -552,215 +573,249 @@ func (m *OutputMsg) Marshal() (dAtA []byte, err error) {
552 573
 }
553 574
 
554 575
 func (m *OutputMsg) MarshalTo(dAtA []byte) (int, error) {
555
-	var i int
576
+	size := m.Size()
577
+	return m.MarshalToSizedBuffer(dAtA[:size])
578
+}
579
+
580
+func (m *OutputMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) {
581
+	i := len(dAtA)
556 582
 	_ = i
557 583
 	var l int
558 584
 	_ = l
559
-	if m.SourcePodIp != nil {
560
-		dAtA[i] = 0xa
561
-		i++
562
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.SourcePodIp.Size()))
563
-		n3, err := m.SourcePodIp.MarshalTo(dAtA[i:])
564
-		if err != nil {
565
-			return 0, err
566
-		}
567
-		i += n3
585
+	if len(m.DestinationPodUid) > 0 {
586
+		i -= len(m.DestinationPodUid)
587
+		copy(dAtA[i:], m.DestinationPodUid)
588
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPodUid)))
589
+		i--
590
+		dAtA[i] = 0x2
591
+		i--
592
+		dAtA[i] = 0x82
568 593
 	}
569
-	if len(m.SourcePodName) > 0 {
570
-		dAtA[i] = 0x12
571
-		i++
572
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourcePodName)))
573
-		i += copy(dAtA[i:], m.SourcePodName)
594
+	if len(m.SourcePodUid) > 0 {
595
+		i -= len(m.SourcePodUid)
596
+		copy(dAtA[i:], m.SourcePodUid)
597
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourcePodUid)))
598
+		i--
599
+		dAtA[i] = 0x1
600
+		i--
601
+		dAtA[i] = 0xfa
574 602
 	}
575
-	if len(m.SourceLabels) > 0 {
576
-		for k, _ := range m.SourceLabels {
577
-			dAtA[i] = 0x1a
578
-			i++
579
-			v := m.SourceLabels[k]
580
-			mapSize := 1 + len(k) + sovTemplateHandlerService(uint64(len(k))) + 1 + len(v) + sovTemplateHandlerService(uint64(len(v)))
581
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(mapSize))
582
-			dAtA[i] = 0xa
583
-			i++
584
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
585
-			i += copy(dAtA[i:], k)
586
-			dAtA[i] = 0x12
587
-			i++
588
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
589
-			i += copy(dAtA[i:], v)
590
-		}
603
+	if len(m.DestinationContainerName) > 0 {
604
+		i -= len(m.DestinationContainerName)
605
+		copy(dAtA[i:], m.DestinationContainerName)
606
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationContainerName)))
607
+		i--
608
+		dAtA[i] = 0x1
609
+		i--
610
+		dAtA[i] = 0xf2
591 611
 	}
592
-	if len(m.SourceNamespace) > 0 {
593
-		dAtA[i] = 0x22
594
-		i++
595
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceNamespace)))
596
-		i += copy(dAtA[i:], m.SourceNamespace)
612
+	if len(m.DestinationWorkloadNamespace) > 0 {
613
+		i -= len(m.DestinationWorkloadNamespace)
614
+		copy(dAtA[i:], m.DestinationWorkloadNamespace)
615
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadNamespace)))
616
+		i--
617
+		dAtA[i] = 0x1
618
+		i--
619
+		dAtA[i] = 0xea
597 620
 	}
598
-	if len(m.SourceServiceAccountName) > 0 {
599
-		dAtA[i] = 0x32
600
-		i++
601
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceServiceAccountName)))
602
-		i += copy(dAtA[i:], m.SourceServiceAccountName)
621
+	if len(m.DestinationWorkloadName) > 0 {
622
+		i -= len(m.DestinationWorkloadName)
623
+		copy(dAtA[i:], m.DestinationWorkloadName)
624
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadName)))
625
+		i--
626
+		dAtA[i] = 0x1
627
+		i--
628
+		dAtA[i] = 0xe2
603 629
 	}
604
-	if m.SourceHostIp != nil {
605
-		dAtA[i] = 0x3a
606
-		i++
607
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.SourceHostIp.Size()))
608
-		n4, err := m.SourceHostIp.MarshalTo(dAtA[i:])
609
-		if err != nil {
610
-			return 0, err
611
-		}
612
-		i += n4
630
+	if len(m.DestinationWorkloadUid) > 0 {
631
+		i -= len(m.DestinationWorkloadUid)
632
+		copy(dAtA[i:], m.DestinationWorkloadUid)
633
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadUid)))
634
+		i--
635
+		dAtA[i] = 0x1
636
+		i--
637
+		dAtA[i] = 0xda
613 638
 	}
614
-	if m.DestinationPodIp != nil {
615
-		dAtA[i] = 0x42
616
-		i++
617
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.DestinationPodIp.Size()))
618
-		n5, err := m.DestinationPodIp.MarshalTo(dAtA[i:])
619
-		if err != nil {
620
-			return 0, err
621
-		}
622
-		i += n5
639
+	if len(m.DestinationOwner) > 0 {
640
+		i -= len(m.DestinationOwner)
641
+		copy(dAtA[i:], m.DestinationOwner)
642
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationOwner)))
643
+		i--
644
+		dAtA[i] = 0x1
645
+		i--
646
+		dAtA[i] = 0xd2
623 647
 	}
624
-	if len(m.DestinationPodName) > 0 {
625
-		dAtA[i] = 0x4a
626
-		i++
627
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPodName)))
628
-		i += copy(dAtA[i:], m.DestinationPodName)
648
+	if len(m.SourceOwner) > 0 {
649
+		i -= len(m.SourceOwner)
650
+		copy(dAtA[i:], m.SourceOwner)
651
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceOwner)))
652
+		i--
653
+		dAtA[i] = 0x1
654
+		i--
655
+		dAtA[i] = 0xca
629 656
 	}
630
-	if len(m.DestinationLabels) > 0 {
631
-		for k, _ := range m.DestinationLabels {
632
-			dAtA[i] = 0x52
633
-			i++
634
-			v := m.DestinationLabels[k]
635
-			mapSize := 1 + len(k) + sovTemplateHandlerService(uint64(len(k))) + 1 + len(v) + sovTemplateHandlerService(uint64(len(v)))
636
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(mapSize))
637
-			dAtA[i] = 0xa
638
-			i++
639
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
640
-			i += copy(dAtA[i:], k)
641
-			dAtA[i] = 0x12
642
-			i++
643
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
644
-			i += copy(dAtA[i:], v)
645
-		}
657
+	if len(m.SourceWorkloadNamespace) > 0 {
658
+		i -= len(m.SourceWorkloadNamespace)
659
+		copy(dAtA[i:], m.SourceWorkloadNamespace)
660
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadNamespace)))
661
+		i--
662
+		dAtA[i] = 0x1
663
+		i--
664
+		dAtA[i] = 0xc2
646 665
 	}
647
-	if len(m.DestinationNamespace) > 0 {
648
-		dAtA[i] = 0x5a
649
-		i++
650
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationNamespace)))
651
-		i += copy(dAtA[i:], m.DestinationNamespace)
666
+	if len(m.SourceWorkloadName) > 0 {
667
+		i -= len(m.SourceWorkloadName)
668
+		copy(dAtA[i:], m.SourceWorkloadName)
669
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadName)))
670
+		i--
671
+		dAtA[i] = 0x1
672
+		i--
673
+		dAtA[i] = 0xba
652 674
 	}
653
-	if len(m.DestinationServiceAccountName) > 0 {
654
-		dAtA[i] = 0x6a
655
-		i++
656
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationServiceAccountName)))
657
-		i += copy(dAtA[i:], m.DestinationServiceAccountName)
675
+	if len(m.SourceWorkloadUid) > 0 {
676
+		i -= len(m.SourceWorkloadUid)
677
+		copy(dAtA[i:], m.SourceWorkloadUid)
678
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadUid)))
679
+		i--
680
+		dAtA[i] = 0x1
681
+		i--
682
+		dAtA[i] = 0xb2
658 683
 	}
659 684
 	if m.DestinationHostIp != nil {
660
-		dAtA[i] = 0x72
661
-		i++
662
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.DestinationHostIp.Size()))
663
-		n6, err := m.DestinationHostIp.MarshalTo(dAtA[i:])
664
-		if err != nil {
665
-			return 0, err
685
+		{
686
+			size, err := m.DestinationHostIp.MarshalToSizedBuffer(dAtA[:i])
687
+			if err != nil {
688
+				return 0, err
689
+			}
690
+			i -= size
691
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
666 692
 		}
667
-		i += n6
693
+		i--
694
+		dAtA[i] = 0x72
668 695
 	}
669
-	if len(m.SourceWorkloadUid) > 0 {
670
-		dAtA[i] = 0xb2
671
-		i++
672
-		dAtA[i] = 0x1
673
-		i++
674
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadUid)))
675
-		i += copy(dAtA[i:], m.SourceWorkloadUid)
696
+	if len(m.DestinationServiceAccountName) > 0 {
697
+		i -= len(m.DestinationServiceAccountName)
698
+		copy(dAtA[i:], m.DestinationServiceAccountName)
699
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationServiceAccountName)))
700
+		i--
701
+		dAtA[i] = 0x6a
676 702
 	}
677
-	if len(m.SourceWorkloadName) > 0 {
678
-		dAtA[i] = 0xba
679
-		i++
680
-		dAtA[i] = 0x1
681
-		i++
682
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadName)))
683
-		i += copy(dAtA[i:], m.SourceWorkloadName)
703
+	if len(m.DestinationNamespace) > 0 {
704
+		i -= len(m.DestinationNamespace)
705
+		copy(dAtA[i:], m.DestinationNamespace)
706
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationNamespace)))
707
+		i--
708
+		dAtA[i] = 0x5a
684 709
 	}
685
-	if len(m.SourceWorkloadNamespace) > 0 {
686
-		dAtA[i] = 0xc2
687
-		i++
688
-		dAtA[i] = 0x1
689
-		i++
690
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceWorkloadNamespace)))
691
-		i += copy(dAtA[i:], m.SourceWorkloadNamespace)
710
+	if len(m.DestinationLabels) > 0 {
711
+		for k := range m.DestinationLabels {
712
+			v := m.DestinationLabels[k]
713
+			baseI := i
714
+			i -= len(v)
715
+			copy(dAtA[i:], v)
716
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
717
+			i--
718
+			dAtA[i] = 0x12
719
+			i -= len(k)
720
+			copy(dAtA[i:], k)
721
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
722
+			i--
723
+			dAtA[i] = 0xa
724
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(baseI-i))
725
+			i--
726
+			dAtA[i] = 0x52
727
+		}
692 728
 	}
693
-	if len(m.SourceOwner) > 0 {
694
-		dAtA[i] = 0xca
695
-		i++
696
-		dAtA[i] = 0x1
697
-		i++
698
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceOwner)))
699
-		i += copy(dAtA[i:], m.SourceOwner)
729
+	if len(m.DestinationPodName) > 0 {
730
+		i -= len(m.DestinationPodName)
731
+		copy(dAtA[i:], m.DestinationPodName)
732
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPodName)))
733
+		i--
734
+		dAtA[i] = 0x4a
700 735
 	}
701
-	if len(m.DestinationOwner) > 0 {
702
-		dAtA[i] = 0xd2
703
-		i++
704
-		dAtA[i] = 0x1
705
-		i++
706
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationOwner)))
707
-		i += copy(dAtA[i:], m.DestinationOwner)
736
+	if m.DestinationPodIp != nil {
737
+		{
738
+			size, err := m.DestinationPodIp.MarshalToSizedBuffer(dAtA[:i])
739
+			if err != nil {
740
+				return 0, err
741
+			}
742
+			i -= size
743
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
744
+		}
745
+		i--
746
+		dAtA[i] = 0x42
708 747
 	}
709
-	if len(m.DestinationWorkloadUid) > 0 {
710
-		dAtA[i] = 0xda
711
-		i++
712
-		dAtA[i] = 0x1
713
-		i++
714
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadUid)))
715
-		i += copy(dAtA[i:], m.DestinationWorkloadUid)
748
+	if m.SourceHostIp != nil {
749
+		{
750
+			size, err := m.SourceHostIp.MarshalToSizedBuffer(dAtA[:i])
751
+			if err != nil {
752
+				return 0, err
753
+			}
754
+			i -= size
755
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
756
+		}
757
+		i--
758
+		dAtA[i] = 0x3a
716 759
 	}
717
-	if len(m.DestinationWorkloadName) > 0 {
718
-		dAtA[i] = 0xe2
719
-		i++
720
-		dAtA[i] = 0x1
721
-		i++
722
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadName)))
723
-		i += copy(dAtA[i:], m.DestinationWorkloadName)
760
+	if len(m.SourceServiceAccountName) > 0 {
761
+		i -= len(m.SourceServiceAccountName)
762
+		copy(dAtA[i:], m.SourceServiceAccountName)
763
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceServiceAccountName)))
764
+		i--
765
+		dAtA[i] = 0x32
724 766
 	}
725
-	if len(m.DestinationWorkloadNamespace) > 0 {
726
-		dAtA[i] = 0xea
727
-		i++
728
-		dAtA[i] = 0x1
729
-		i++
730
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationWorkloadNamespace)))
731
-		i += copy(dAtA[i:], m.DestinationWorkloadNamespace)
767
+	if len(m.SourceNamespace) > 0 {
768
+		i -= len(m.SourceNamespace)
769
+		copy(dAtA[i:], m.SourceNamespace)
770
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceNamespace)))
771
+		i--
772
+		dAtA[i] = 0x22
732 773
 	}
733
-	if len(m.DestinationContainerName) > 0 {
734
-		dAtA[i] = 0xf2
735
-		i++
736
-		dAtA[i] = 0x1
737
-		i++
738
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationContainerName)))
739
-		i += copy(dAtA[i:], m.DestinationContainerName)
774
+	if len(m.SourceLabels) > 0 {
775
+		for k := range m.SourceLabels {
776
+			v := m.SourceLabels[k]
777
+			baseI := i
778
+			i -= len(v)
779
+			copy(dAtA[i:], v)
780
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
781
+			i--
782
+			dAtA[i] = 0x12
783
+			i -= len(k)
784
+			copy(dAtA[i:], k)
785
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
786
+			i--
787
+			dAtA[i] = 0xa
788
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(baseI-i))
789
+			i--
790
+			dAtA[i] = 0x1a
791
+		}
740 792
 	}
741
-	if len(m.SourcePodUid) > 0 {
742
-		dAtA[i] = 0xfa
743
-		i++
744
-		dAtA[i] = 0x1
745
-		i++
746
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourcePodUid)))
747
-		i += copy(dAtA[i:], m.SourcePodUid)
793
+	if len(m.SourcePodName) > 0 {
794
+		i -= len(m.SourcePodName)
795
+		copy(dAtA[i:], m.SourcePodName)
796
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourcePodName)))
797
+		i--
798
+		dAtA[i] = 0x12
748 799
 	}
749
-	if len(m.DestinationPodUid) > 0 {
750
-		dAtA[i] = 0x82
751
-		i++
752
-		dAtA[i] = 0x2
753
-		i++
754
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPodUid)))
755
-		i += copy(dAtA[i:], m.DestinationPodUid)
800
+	if m.SourcePodIp != nil {
801
+		{
802
+			size, err := m.SourcePodIp.MarshalToSizedBuffer(dAtA[:i])
803
+			if err != nil {
804
+				return 0, err
805
+			}
806
+			i -= size
807
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
808
+		}
809
+		i--
810
+		dAtA[i] = 0xa
756 811
 	}
757
-	return i, nil
812
+	return len(dAtA) - i, nil
758 813
 }
759 814
 
760 815
 func (m *InstanceMsg) Marshal() (dAtA []byte, err error) {
761 816
 	size := m.Size()
762 817
 	dAtA = make([]byte, size)
763
-	n, err := m.MarshalTo(dAtA)
818
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
764 819
 	if err != nil {
765 820
 		return nil, err
766 821
 	}
@@ -768,68 +823,80 @@ func (m *InstanceMsg) Marshal() (dAtA []byte, err error) {
768 823
 }
769 824
 
770 825
 func (m *InstanceMsg) MarshalTo(dAtA []byte) (int, error) {
771
-	var i int
826
+	size := m.Size()
827
+	return m.MarshalToSizedBuffer(dAtA[:size])
828
+}
829
+
830
+func (m *InstanceMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) {
831
+	i := len(dAtA)
772 832
 	_ = i
773 833
 	var l int
774 834
 	_ = l
775
-	if len(m.SourceUid) > 0 {
776
-		dAtA[i] = 0xa
777
-		i++
778
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceUid)))
779
-		i += copy(dAtA[i:], m.SourceUid)
835
+	if len(m.Name) > 0 {
836
+		i -= len(m.Name)
837
+		copy(dAtA[i:], m.Name)
838
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.Name)))
839
+		i--
840
+		dAtA[i] = 0x2
841
+		i--
842
+		dAtA[i] = 0x93
843
+		i--
844
+		dAtA[i] = 0xe4
845
+		i--
846
+		dAtA[i] = 0xd2
847
+		i--
848
+		dAtA[i] = 0xfa
780 849
 	}
781
-	if m.SourceIp != nil {
782
-		dAtA[i] = 0x12
783
-		i++
784
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.SourceIp.Size()))
785
-		n7, err := m.SourceIp.MarshalTo(dAtA[i:])
786
-		if err != nil {
787
-			return 0, err
850
+	if m.DestinationPort != 0 {
851
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.DestinationPort))
852
+		i--
853
+		dAtA[i] = 0x38
854
+	}
855
+	if m.DestinationIp != nil {
856
+		{
857
+			size, err := m.DestinationIp.MarshalToSizedBuffer(dAtA[:i])
858
+			if err != nil {
859
+				return 0, err
860
+			}
861
+			i -= size
862
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
788 863
 		}
789
-		i += n7
864
+		i--
865
+		dAtA[i] = 0x22
790 866
 	}
791 867
 	if len(m.DestinationUid) > 0 {
792
-		dAtA[i] = 0x1a
793
-		i++
868
+		i -= len(m.DestinationUid)
869
+		copy(dAtA[i:], m.DestinationUid)
794 870
 		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationUid)))
795
-		i += copy(dAtA[i:], m.DestinationUid)
871
+		i--
872
+		dAtA[i] = 0x1a
796 873
 	}
797
-	if m.DestinationIp != nil {
798
-		dAtA[i] = 0x22
799
-		i++
800
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.DestinationIp.Size()))
801
-		n8, err := m.DestinationIp.MarshalTo(dAtA[i:])
802
-		if err != nil {
803
-			return 0, err
874
+	if m.SourceIp != nil {
875
+		{
876
+			size, err := m.SourceIp.MarshalToSizedBuffer(dAtA[:i])
877
+			if err != nil {
878
+				return 0, err
879
+			}
880
+			i -= size
881
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(size))
804 882
 		}
805
-		i += n8
806
-	}
807
-	if m.DestinationPort != 0 {
808
-		dAtA[i] = 0x38
809
-		i++
810
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(m.DestinationPort))
883
+		i--
884
+		dAtA[i] = 0x12
811 885
 	}
812
-	if len(m.Name) > 0 {
813
-		dAtA[i] = 0xfa
814
-		i++
815
-		dAtA[i] = 0xd2
816
-		i++
817
-		dAtA[i] = 0xe4
818
-		i++
819
-		dAtA[i] = 0x93
820
-		i++
821
-		dAtA[i] = 0x2
822
-		i++
823
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.Name)))
824
-		i += copy(dAtA[i:], m.Name)
886
+	if len(m.SourceUid) > 0 {
887
+		i -= len(m.SourceUid)
888
+		copy(dAtA[i:], m.SourceUid)
889
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceUid)))
890
+		i--
891
+		dAtA[i] = 0xa
825 892
 	}
826
-	return i, nil
893
+	return len(dAtA) - i, nil
827 894
 }
828 895
 
829 896
 func (m *Type) Marshal() (dAtA []byte, err error) {
830 897
 	size := m.Size()
831 898
 	dAtA = make([]byte, size)
832
-	n, err := m.MarshalTo(dAtA)
899
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
833 900
 	if err != nil {
834 901
 		return nil, err
835 902
 	}
@@ -837,17 +904,22 @@ func (m *Type) Marshal() (dAtA []byte, err error) {
837 904
 }
838 905
 
839 906
 func (m *Type) MarshalTo(dAtA []byte) (int, error) {
840
-	var i int
907
+	size := m.Size()
908
+	return m.MarshalToSizedBuffer(dAtA[:size])
909
+}
910
+
911
+func (m *Type) MarshalToSizedBuffer(dAtA []byte) (int, error) {
912
+	i := len(dAtA)
841 913
 	_ = i
842 914
 	var l int
843 915
 	_ = l
844
-	return i, nil
916
+	return len(dAtA) - i, nil
845 917
 }
846 918
 
847 919
 func (m *InstanceParam) Marshal() (dAtA []byte, err error) {
848 920
 	size := m.Size()
849 921
 	dAtA = make([]byte, size)
850
-	n, err := m.MarshalTo(dAtA)
922
+	n, err := m.MarshalToSizedBuffer(dAtA[:size])
851 923
 	if err != nil {
852 924
 		return nil, err
853 925
 	}
@@ -855,76 +927,90 @@ func (m *InstanceParam) Marshal() (dAtA []byte, err error) {
855 927
 }
856 928
 
857 929
 func (m *InstanceParam) MarshalTo(dAtA []byte) (int, error) {
858
-	var i int
930
+	size := m.Size()
931
+	return m.MarshalToSizedBuffer(dAtA[:size])
932
+}
933
+
934
+func (m *InstanceParam) MarshalToSizedBuffer(dAtA []byte) (int, error) {
935
+	i := len(dAtA)
859 936
 	_ = i
860 937
 	var l int
861 938
 	_ = l
862
-	if len(m.SourceUid) > 0 {
863
-		dAtA[i] = 0xa
864
-		i++
865
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceUid)))
866
-		i += copy(dAtA[i:], m.SourceUid)
867
-	}
868
-	if len(m.SourceIp) > 0 {
869
-		dAtA[i] = 0x12
870
-		i++
871
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceIp)))
872
-		i += copy(dAtA[i:], m.SourceIp)
939
+	if len(m.AttributeBindings) > 0 {
940
+		for k := range m.AttributeBindings {
941
+			v := m.AttributeBindings[k]
942
+			baseI := i
943
+			i -= len(v)
944
+			copy(dAtA[i:], v)
945
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
946
+			i--
947
+			dAtA[i] = 0x12
948
+			i -= len(k)
949
+			copy(dAtA[i:], k)
950
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
951
+			i--
952
+			dAtA[i] = 0xa
953
+			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(baseI-i))
954
+			i--
955
+			dAtA[i] = 0x2
956
+			i--
957
+			dAtA[i] = 0x93
958
+			i--
959
+			dAtA[i] = 0xe4
960
+			i--
961
+			dAtA[i] = 0xd3
962
+			i--
963
+			dAtA[i] = 0x82
964
+		}
873 965
 	}
874
-	if len(m.DestinationUid) > 0 {
875
-		dAtA[i] = 0x1a
876
-		i++
877
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationUid)))
878
-		i += copy(dAtA[i:], m.DestinationUid)
966
+	if len(m.DestinationPort) > 0 {
967
+		i -= len(m.DestinationPort)
968
+		copy(dAtA[i:], m.DestinationPort)
969
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPort)))
970
+		i--
971
+		dAtA[i] = 0x3a
879 972
 	}
880 973
 	if len(m.DestinationIp) > 0 {
881
-		dAtA[i] = 0x22
882
-		i++
974
+		i -= len(m.DestinationIp)
975
+		copy(dAtA[i:], m.DestinationIp)
883 976
 		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationIp)))
884
-		i += copy(dAtA[i:], m.DestinationIp)
977
+		i--
978
+		dAtA[i] = 0x22
885 979
 	}
886
-	if len(m.DestinationPort) > 0 {
887
-		dAtA[i] = 0x3a
888
-		i++
889
-		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationPort)))
890
-		i += copy(dAtA[i:], m.DestinationPort)
980
+	if len(m.DestinationUid) > 0 {
981
+		i -= len(m.DestinationUid)
982
+		copy(dAtA[i:], m.DestinationUid)
983
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.DestinationUid)))
984
+		i--
985
+		dAtA[i] = 0x1a
891 986
 	}
892
-	if len(m.AttributeBindings) > 0 {
893
-		for k, _ := range m.AttributeBindings {
894
-			dAtA[i] = 0x82
895
-			i++
896
-			dAtA[i] = 0xd3
897
-			i++
898
-			dAtA[i] = 0xe4
899
-			i++
900
-			dAtA[i] = 0x93
901
-			i++
902
-			dAtA[i] = 0x2
903
-			i++
904
-			v := m.AttributeBindings[k]
905
-			mapSize := 1 + len(k) + sovTemplateHandlerService(uint64(len(k))) + 1 + len(v) + sovTemplateHandlerService(uint64(len(v)))
906
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(mapSize))
907
-			dAtA[i] = 0xa
908
-			i++
909
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(k)))
910
-			i += copy(dAtA[i:], k)
911
-			dAtA[i] = 0x12
912
-			i++
913
-			i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(v)))
914
-			i += copy(dAtA[i:], v)
915
-		}
987
+	if len(m.SourceIp) > 0 {
988
+		i -= len(m.SourceIp)
989
+		copy(dAtA[i:], m.SourceIp)
990
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceIp)))
991
+		i--
992
+		dAtA[i] = 0x12
993
+	}
994
+	if len(m.SourceUid) > 0 {
995
+		i -= len(m.SourceUid)
996
+		copy(dAtA[i:], m.SourceUid)
997
+		i = encodeVarintTemplateHandlerService(dAtA, i, uint64(len(m.SourceUid)))
998
+		i--
999
+		dAtA[i] = 0xa
916 1000
 	}
917
-	return i, nil
1001
+	return len(dAtA) - i, nil
918 1002
 }
919 1003
 
920 1004
 func encodeVarintTemplateHandlerService(dAtA []byte, offset int, v uint64) int {
1005
+	offset -= sovTemplateHandlerService(v)
1006
+	base := offset
921 1007
 	for v >= 1<<7 {
922 1008
 		dAtA[offset] = uint8(v&0x7f | 0x80)
923 1009
 		v >>= 7
924 1010
 		offset++
925 1011
 	}
926 1012
 	dAtA[offset] = uint8(v)
927
-	return offset + 1
1013
+	return base
928 1014
 }
929 1015
 func (m *HandleKubernetesRequest) Size() (n int) {
930 1016
 	if m == nil {
@@ -1135,14 +1221,7 @@ func (m *InstanceParam) Size() (n int) {
1135 1221
 }
1136 1222
 
1137 1223
 func sovTemplateHandlerService(x uint64) (n int) {
1138
-	for {
1139
-		n++
1140
-		x >>= 7
1141
-		if x == 0 {
1142
-			break
1143
-		}
1144
-	}
1145
-	return n
1224
+	return (math_bits.Len64(x|1) + 6) / 7
1146 1225
 }
1147 1226
 func sozTemplateHandlerService(x uint64) (n int) {
1148 1227
 	return sovTemplateHandlerService(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -1152,7 +1231,7 @@ func (this *HandleKubernetesRequest) String() string {
1152 1231
 		return "nil"
1153 1232
 	}
1154 1233
 	s := strings.Join([]string{`&HandleKubernetesRequest{`,
1155
-		`Instance:` + strings.Replace(fmt.Sprintf("%v", this.Instance), "InstanceMsg", "InstanceMsg", 1) + `,`,
1234
+		`Instance:` + strings.Replace(this.Instance.String(), "InstanceMsg", "InstanceMsg", 1) + `,`,
1156 1235
 		`AdapterConfig:` + strings.Replace(fmt.Sprintf("%v", this.AdapterConfig), "Any", "types.Any", 1) + `,`,
1157 1236
 		`DedupId:` + fmt.Sprintf("%v", this.DedupId) + `,`,
1158 1237
 		`}`,

+ 68
- 72
mixer/adapter/list/config/config.pb.go View File

@@ -18,6 +18,7 @@ import (
18 18
 	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
19 19
 	io "io"
20 20
 	math "math"
21
+	math_bits "math/bits"
21 22
 	reflect "reflect"
22 23
 	strconv "strconv"
23 24
 	strings "strings"
@@ -107,7 +108,7 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
107 108
 		return xxx_messageInfo_Params.Marshal(b, m, deterministic)
108 109
 	} else {
109 110
 		b = b[:cap(b)]
110
-		n, err := m.MarshalTo(b)
111