many lint fixes and optimizations (#17)

* util/kubernetes: drop stale files
* debug/log/kubernetes: drop stale files
* util/scope: remove stale files
* util/mdns: drop stale files
* lint fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-13 15:35:56 +03:00
committed by GitHub
parent abb9937787
commit 82248eb3b0
57 changed files with 246 additions and 5690 deletions

View File

@@ -60,10 +60,9 @@ func NewRoundTripper(opts ...Option) http.RoundTripper {
// RequestToContext puts the `Authorization` header bearer token into context
// so calls to services will be authorized.
func RequestToContext(r *http.Request) context.Context {
ctx := context.Background()
md := make(metadata.Metadata)
md := metadata.New(len(r.Header))
for k, v := range r.Header {
md[k] = strings.Join(v, ",")
md.Set(k, strings.Join(v, ","))
}
return metadata.NewContext(ctx, md)
return metadata.NewIncomingContext(r.Context(), md)
}