Build against google-grpc 1.11, where md.Get() does not exist.
authorArnaud Rebillout <arnaud.rebillout@collabora.com>
Tue, 22 Jan 2019 05:22:52 +0000 (12:22 +0700)
committerFelix Geyer <fgeyer@debian.org>
Sun, 14 Jun 2020 20:12:29 +0000 (21:12 +0100)
This patch is based on the commit that introduced md.Get() in google-grpc:
<https://github.com/grpc/grpc-go/commit/291de7f0>.

Please drop this patch as soon as we build docker against google-grpc >= 1.12.

Origin: vendor, Debian
Forwarded: not-needed, Debian-specific
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
Gbp-Pq: Name buildkit-build-against-google-grpc-1.11.patch

cli/vendor/github.com/moby/buildkit/client/buildid/metadata.go
engine/vendor/github.com/moby/buildkit/client/buildid/metadata.go

index bb169b8fe4ecd63c8c49da930f9b8e906dd09b23..c0df9891b71b40e2dc283c67a78ffb1a66467597 100644 (file)
@@ -2,6 +2,7 @@ package buildid
 
 import (
        "context"
+       "strings"
 
        "google.golang.org/grpc/metadata"
 )
@@ -21,7 +22,8 @@ func FromIncomingContext(ctx context.Context) string {
                return ""
        }
 
-       if ids := md.Get(metadataKey); len(ids) == 1 {
+       k := strings.ToLower(metadataKey)
+       if ids := md[k]; len(ids) == 1 {
                return ids[0]
        }
 
index bb169b8fe4ecd63c8c49da930f9b8e906dd09b23..c0df9891b71b40e2dc283c67a78ffb1a66467597 100644 (file)
@@ -2,6 +2,7 @@ package buildid
 
 import (
        "context"
+       "strings"
 
        "google.golang.org/grpc/metadata"
 )
@@ -21,7 +22,8 @@ func FromIncomingContext(ctx context.Context) string {
                return ""
        }
 
-       if ids := md.Get(metadataKey); len(ids) == 1 {
+       k := strings.ToLower(metadataKey)
+       if ids := md[k]; len(ids) == 1 {
                return ids[0]
        }