VOL-2265 test go.mod and vendor consistency;
Update dependencies to resolve `410 Gone` errors when fetching modules
Change-Id: If0bdbc1b6d629ce819b9fa4701c016df812f92d5
diff --git a/vendor/github.com/fullstorydev/grpcurl/.gitignore b/vendor/github.com/fullstorydev/grpcurl/.gitignore
index 849ddff..53fe3b5 100644
--- a/vendor/github.com/fullstorydev/grpcurl/.gitignore
+++ b/vendor/github.com/fullstorydev/grpcurl/.gitignore
@@ -1 +1,2 @@
dist/
+VERSION
diff --git a/vendor/github.com/fullstorydev/grpcurl/Dockerfile b/vendor/github.com/fullstorydev/grpcurl/Dockerfile
new file mode 100644
index 0000000..0f71406
--- /dev/null
+++ b/vendor/github.com/fullstorydev/grpcurl/Dockerfile
@@ -0,0 +1,33 @@
+FROM golang:1.11.10-alpine as builder
+MAINTAINER FullStory Engineering
+
+# currently, a module build requires gcc (so Go tool can build
+# module-aware versions of std library; it ships only w/ the
+# non-module versions)
+RUN apk update && apk add --no-cache ca-certificates git gcc g++ libc-dev
+# create non-privileged group and user
+RUN addgroup -S grpcurl && adduser -S grpcurl -G grpcurl
+
+WORKDIR /tmp/fullstorydev/grpcurl
+# copy just the files/sources we need to build grpcurl
+COPY VERSION *.go go.* /tmp/fullstorydev/grpcurl/
+COPY cmd /tmp/fullstorydev/grpcurl/cmd
+# and build a completely static binary (so we can use
+# scratch as basis for the final image)
+ENV CGO_ENABLED=0
+ENV GOOS=linux
+ENV GOARCH=amd64
+ENV GO111MODULE=on
+RUN go build -o /grpcurl \
+ -ldflags "-w -extldflags \"-static\" -X \"main.version=$(cat VERSION)\"" \
+ ./cmd/grpcurl
+
+# New FROM so we have a nice'n'tiny image
+FROM scratch
+WORKDIR /
+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
+COPY --from=builder /etc/passwd /etc/passwd
+COPY --from=builder /grpcurl /bin/grpcurl
+USER grpcurl
+
+ENTRYPOINT ["/bin/grpcurl"]
diff --git a/vendor/github.com/fullstorydev/grpcurl/Makefile b/vendor/github.com/fullstorydev/grpcurl/Makefile
index 982d043..8c34d31 100644
--- a/vendor/github.com/fullstorydev/grpcurl/Makefile
+++ b/vendor/github.com/fullstorydev/grpcurl/Makefile
@@ -25,6 +25,12 @@
@GO111MODULE=off go get github.com/goreleaser/goreleaser
goreleaser --rm-dist
+.PHONY: docker
+docker:
+ @echo $(dev_build_version) > VERSION
+ docker build -t fullstorydev/grpcurl:$(dev_build_version) .
+ @rm VERSION
+
.PHONY: checkgofmt
checkgofmt:
gofmt -s -l .
diff --git a/vendor/github.com/fullstorydev/grpcurl/desc_source.go b/vendor/github.com/fullstorydev/grpcurl/desc_source.go
index c23ae3d..635ddef 100644
--- a/vendor/github.com/fullstorydev/grpcurl/desc_source.go
+++ b/vendor/github.com/fullstorydev/grpcurl/desc_source.go
@@ -3,6 +3,7 @@
import (
"errors"
"fmt"
+ "io"
"io/ioutil"
"sync"
@@ -251,3 +252,53 @@
}
return err
}
+
+// WriteProtoset will use the given descriptor source to resolve all of the given
+// symbols and write a proto file descriptor set with their definitions to the
+// given output. The output will include descriptors for all files in which the
+// symbols are defined as well as their transitive dependencies.
+func WriteProtoset(out io.Writer, descSource DescriptorSource, symbols ...string) error {
+ // compute set of file descriptors
+ filenames := make([]string, 0, len(symbols))
+ fds := make(map[string]*desc.FileDescriptor, len(symbols))
+ for _, sym := range symbols {
+ d, err := descSource.FindSymbol(sym)
+ if err != nil {
+ return fmt.Errorf("failed to find descriptor for %q: %v", sym, err)
+ }
+ fd := d.GetFile()
+ if _, ok := fds[fd.GetName()]; !ok {
+ fds[fd.GetName()] = fd
+ filenames = append(filenames, fd.GetName())
+ }
+ }
+ // now expand that to include transitive dependencies in topologically sorted
+ // order (such that file always appears after its dependencies)
+ expandedFiles := make(map[string]struct{}, len(fds))
+ allFilesSlice := make([]*descpb.FileDescriptorProto, 0, len(fds))
+ for _, filename := range filenames {
+ allFilesSlice = addFilesToSet(allFilesSlice, expandedFiles, fds[filename])
+ }
+ // now we can serialize to file
+ b, err := proto.Marshal(&descpb.FileDescriptorSet{File: allFilesSlice})
+ if err != nil {
+ return fmt.Errorf("failed to serialize file descriptor set: %v", err)
+ }
+ if _, err := out.Write(b); err != nil {
+ return fmt.Errorf("failed to write file descriptor set: %v", err)
+ }
+ return nil
+}
+
+func addFilesToSet(allFiles []*descpb.FileDescriptorProto, expanded map[string]struct{}, fd *desc.FileDescriptor) []*descpb.FileDescriptorProto {
+ if _, ok := expanded[fd.GetName()]; ok {
+ // already seen this one
+ return allFiles
+ }
+ expanded[fd.GetName()] = struct{}{}
+ // add all dependencies first
+ for _, dep := range fd.GetDependencies() {
+ allFiles = addFilesToSet(allFiles, expanded, dep)
+ }
+ return append(allFiles, fd.AsFileDescriptorProto())
+}
diff --git a/vendor/github.com/fullstorydev/grpcurl/go.mod b/vendor/github.com/fullstorydev/grpcurl/go.mod
index f6af37d..52a9832 100644
--- a/vendor/github.com/fullstorydev/grpcurl/go.mod
+++ b/vendor/github.com/fullstorydev/grpcurl/go.mod
@@ -2,7 +2,7 @@
require (
github.com/golang/protobuf v1.3.1
- github.com/jhump/protoreflect v1.4.1
+ github.com/jhump/protoreflect v1.5.0
golang.org/x/net v0.0.0-20190311183353-d8887717615a
google.golang.org/grpc v1.21.0
)
diff --git a/vendor/github.com/fullstorydev/grpcurl/go.sum b/vendor/github.com/fullstorydev/grpcurl/go.sum
index 466dbb1..5a79975 100644
--- a/vendor/github.com/fullstorydev/grpcurl/go.sum
+++ b/vendor/github.com/fullstorydev/grpcurl/go.sum
@@ -7,8 +7,8 @@
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/jhump/protoreflect v1.4.1 h1:tgahjuElRiJthp9JfaMUFxabBVIytT/lnMSadY5kMjM=
-github.com/jhump/protoreflect v1.4.1/go.mod h1:gZ3i/BeD62fjlaIL0VW4UDMT70CTX+3m4pOnAlJ0BX8=
+github.com/jhump/protoreflect v1.5.0 h1:NgpVT+dX71c8hZnxHof2M7QDK7QtohIJ7DYycjnkyfc=
+github.com/jhump/protoreflect v1.5.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -21,7 +21,7 @@
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/genproto v0.0.0-20170818100345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
diff --git a/vendor/github.com/fullstorydev/grpcurl/grpcurl.go b/vendor/github.com/fullstorydev/grpcurl/grpcurl.go
index 64947de..3c5c607 100644
--- a/vendor/github.com/fullstorydev/grpcurl/grpcurl.go
+++ b/vendor/github.com/fullstorydev/grpcurl/grpcurl.go
@@ -15,6 +15,8 @@
"fmt"
"io/ioutil"
"net"
+ "os"
+ "regexp"
"sort"
"strings"
@@ -161,6 +163,36 @@
return md
}
+var envVarRegex = regexp.MustCompile(`\${\w+}`)
+
+// ExpandHeaders expands environment variables contained in the header string.
+// If no corresponding environment variable is found an error is returned.
+// TODO: Add escaping for `${`
+func ExpandHeaders(headers []string) ([]string, error) {
+ expandedHeaders := make([]string, len(headers))
+ for idx, header := range headers {
+ if header == "" {
+ continue
+ }
+ results := envVarRegex.FindAllString(header, -1)
+ if len(results) == 0 {
+ expandedHeaders[idx] = headers[idx]
+ continue
+ }
+ expandedHeader := header
+ for _, result := range results {
+ envVarName := result[2 : len(result)-1] // strip leading `${` and trailing `}`
+ envVarValue, ok := os.LookupEnv(envVarName)
+ if !ok {
+ return nil, fmt.Errorf("header %q refers to missing environment variable %q", header, envVarName)
+ }
+ expandedHeader = strings.Replace(expandedHeader, result, envVarValue, -1)
+ }
+ expandedHeaders[idx] = expandedHeader
+ }
+ return expandedHeaders, nil
+}
+
var base64Codecs = []*base64.Encoding{base64.StdEncoding, base64.URLEncoding, base64.RawStdEncoding, base64.RawURLEncoding}
func decode(val string) (string, error) {