From 3bde5accf23c3f58251c0e75b8c9c70023e184da Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 28 Feb 2020 08:22:25 -0500 Subject: [PATCH] bump(operator-framework/operator-registry) --- go.mod | 6 +- go.sum | 14 +- vendor/github.com/blang/semver/.travis.yml | 21 +++ vendor/github.com/blang/semver/README.md | 5 +- vendor/github.com/blang/semver/package.json | 2 +- .../pkg/apprclient/client.go | 3 +- .../pkg/apprclient/metadata.go | 17 ++- .../pkg/appregistry/appregistry.go | 5 +- .../pkg/appregistry/builder.go | 14 ++ .../pkg/appregistry/downloader.go | 112 +++++++++++---- .../pkg/appregistry/input.go | 72 ++++++++-- .../pkg/containertools/command.go | 33 ++--- .../pkg/containertools/dockerfilegenerator.go | 16 +-- .../pkg/containertools/imagereader.go | 9 +- .../operator-registry/pkg/registry/empty.go | 21 ++- .../pkg/registry/interface.go | 12 +- .../operator-registry/pkg/sqlite/image.go | 12 +- .../operator-registry/pkg/sqlite/load.go | 14 +- .../operator-registry/pkg/sqlite/query.go | 132 ++++++++++++++++-- vendor/google.golang.org/grpc/.travis.yml | 2 +- .../google.golang.org/grpc/CODE-OF-CONDUCT.md | 3 + vendor/google.golang.org/grpc/CONTRIBUTING.md | 4 +- vendor/google.golang.org/grpc/GOVERNANCE.md | 1 + vendor/google.golang.org/grpc/MAINTAINERS.md | 27 ++++ vendor/google.golang.org/grpc/go.mod | 4 +- vendor/google.golang.org/grpc/go.sum | 4 +- .../grpc/internal/transport/controlbuf.go | 12 +- .../grpc/internal/transport/http2_client.go | 105 +++++++------- .../grpc/internal/transport/http2_server.go | 30 ++-- .../google.golang.org/grpc/service_config.go | 8 ++ vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 9 +- vendor/modules.txt | 8 +- 33 files changed, 542 insertions(+), 197 deletions(-) create mode 100644 vendor/github.com/blang/semver/.travis.yml create mode 100644 vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md create mode 100644 vendor/google.golang.org/grpc/GOVERNANCE.md create mode 100644 vendor/google.golang.org/grpc/MAINTAINERS.md diff --git a/go.mod b/go.mod index 6a2eef496f..2b01f7b3f8 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 github.com/apcera/gssapi v0.0.0-00010101000000-000000000000 github.com/aws/aws-sdk-go v1.17.7 - github.com/blang/semver v3.5.0+incompatible + github.com/blang/semver v3.5.1+incompatible github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb // indirect github.com/containers/image v0.0.0-00010101000000-000000000000 github.com/containers/storage v0.0.0-20190726081758-912de200380a // indirect @@ -37,7 +37,7 @@ require ( github.com/openshift/build-machinery-go v0.0.0-20200211121458-5e3d6e570160 github.com/openshift/client-go v0.0.0-20200116152001-92a2713fa240 github.com/openshift/library-go v0.0.0-20200206134157-b4c763d94dcf - github.com/operator-framework/operator-registry v1.5.4 + github.com/operator-framework/operator-registry v1.5.11 github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 github.com/russross/blackfriday v1.5.2 @@ -55,7 +55,7 @@ require ( k8s.io/apimachinery v0.17.1 k8s.io/apiserver v0.17.1 k8s.io/cli-runtime v0.17.0 - k8s.io/client-go v0.17.1 + k8s.io/client-go v8.0.0+incompatible k8s.io/component-base v0.17.1 k8s.io/klog v1.0.0 k8s.io/kubectl v0.0.0 diff --git a/go.sum b/go.sum index d66b987470..d7453158be 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,8 @@ github.com/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3 github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -331,6 +333,8 @@ github.com/golang/mock v1.0.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -629,8 +633,10 @@ github.com/openshift/kubernetes-kubectl v0.0.0-20200211153013-50adac736181/go.mo github.com/openshift/library-go v0.0.0-20200206134157-b4c763d94dcf h1:KXxMZGtbwefe89jh+XdZRcj2UMO71jdIZhKM3CQefMQ= github.com/openshift/library-go v0.0.0-20200206134157-b4c763d94dcf/go.mod h1:mLRZGYfPe9Kaum4pyhn6hTO3FTPjOZKFB0RxQSIxiuQ= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/operator-framework/operator-registry v1.5.4 h1:ssUAU7CaacYCB6p+CJj9nxXowpD89VLOAY+Aw1w2o8Q= -github.com/operator-framework/operator-registry v1.5.4/go.mod h1:6T3+8vu3N5fpQikSA1Tp91sLxRordtmmvF6ynvBg06g= +github.com/operator-framework/api v0.1.0/go.mod h1:/Jcpy9Ls8W1LK1hhEw30nCRBSBzbT8e/fE09TfRG0To= +github.com/operator-framework/operator-registry v1.5.3/go.mod h1:agrQlkWOo1q8U1SAaLSS2WQ+Z9vswNT2M2HFib9iuLY= +github.com/operator-framework/operator-registry v1.5.11 h1:nv6+uQ6JTAlhC/aAaAXKU51/Wszru02JC8NHDr8ZtkY= +github.com/operator-framework/operator-registry v1.5.11/go.mod h1:sglIIFkt5w2Vm+c+ZyOU6Nn7+K/MtpLucaQCHBVCDtA= github.com/ostreedev/ostree-go v0.0.0-20190702140239-759a8c1ac913/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc= github.com/otiai10/copy v1.0.1 h1:gtBjD8aq4nychvRZ2CyJvFWAw0aja+VHazDdruZKGZA= github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc= @@ -868,6 +874,7 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= @@ -949,6 +956,7 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -994,6 +1002,8 @@ google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= diff --git a/vendor/github.com/blang/semver/.travis.yml b/vendor/github.com/blang/semver/.travis.yml new file mode 100644 index 0000000000..102fb9a691 --- /dev/null +++ b/vendor/github.com/blang/semver/.travis.yml @@ -0,0 +1,21 @@ +language: go +matrix: + include: + - go: 1.4.3 + - go: 1.5.4 + - go: 1.6.3 + - go: 1.7 + - go: tip + allow_failures: + - go: tip +install: +- go get golang.org/x/tools/cmd/cover +- go get github.com/mattn/goveralls +script: +- echo "Test and track coverage" ; $HOME/gopath/bin/goveralls -package "." -service=travis-ci + -repotoken $COVERALLS_TOKEN +- echo "Build examples" ; cd examples && go build +- echo "Check if gofmt'd" ; diff -u <(echo -n) <(gofmt -d -s .) +env: + global: + secure: HroGEAUQpVq9zX1b1VIkraLiywhGbzvNnTZq2TMxgK7JHP8xqNplAeF1izrR2i4QLL9nsY+9WtYss4QuPvEtZcVHUobw6XnL6radF7jS1LgfYZ9Y7oF+zogZ2I5QUMRLGA7rcxQ05s7mKq3XZQfeqaNts4bms/eZRefWuaFZbkw= diff --git a/vendor/github.com/blang/semver/README.md b/vendor/github.com/blang/semver/README.md index 4399639e23..08b2e4a3d7 100644 --- a/vendor/github.com/blang/semver/README.md +++ b/vendor/github.com/blang/semver/README.md @@ -1,4 +1,4 @@ -semver for golang [![Build Status](https://drone.io/github.com/blang/semver/status.png)](https://drone.io/github.com/blang/semver/latest) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master) +semver for golang [![Build Status](https://travis-ci.org/blang/semver.svg?branch=master)](https://travis-ci.org/blang/semver) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master) ====== semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`. @@ -41,6 +41,7 @@ Features - Compare Helper Methods - InPlace manipulation - Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1` +- Wildcards `>=1.x`, `<=2.5.x` - Sortable (implements sort.Interface) - database/sql compatible (sql.Scanner/Valuer) - encoding/json compatible (json.Marshaler/Unmarshaler) @@ -59,6 +60,8 @@ A condition is composed of an operator and a version. The supported operators ar - `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0` - `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`. +Note that spaces between the operator and the version will be gracefully tolerated. + A `Range` can link multiple `Ranges` separated by space: Ranges can be linked by logical AND: diff --git a/vendor/github.com/blang/semver/package.json b/vendor/github.com/blang/semver/package.json index 568be8d943..1cf8ebdd9c 100644 --- a/vendor/github.com/blang/semver/package.json +++ b/vendor/github.com/blang/semver/package.json @@ -12,6 +12,6 @@ "license": "MIT", "name": "semver", "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", - "version": "3.4.0" + "version": "3.5.1" } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/client.go b/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/client.go index 5f8dfd422e..5f3d37ca13 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/client.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/client.go @@ -64,7 +64,8 @@ func (c *client) ListPackages(namespace string) ([]*RegistryMetadata, error) { Name: repository, // 'Default' points to the latest release pushed. - Release: pkg.Default, + Release: pkg.Default, + Releases: pkg.Releases, // Getting 'Digest' would require an additional call to the app // registry, so it is being defaulted. diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/metadata.go b/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/metadata.go index 9a3bf66071..bb391345bd 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/metadata.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/apprclient/metadata.go @@ -31,9 +31,12 @@ type RegistryMetadata struct { // registry. Name string - // Release represents the version number of the given operator manifest. + // Release represents the latest version number of the given operator manifest. Release string + // Releases represents all the available releases of the given operator manifest + Releases []string + // Digest is the sha256 hash value that uniquely corresponds to the blob // associated with this particular release of the operator manifest. Digest string @@ -47,3 +50,15 @@ func (rm *RegistryMetadata) ID() string { func (rm *RegistryMetadata) String() string { return fmt.Sprintf("%s/%s:%s", rm.Namespace, rm.Name, rm.Release) } + +// ReleaseMap returns a map between all the available releases of a package to +// a bool, usefull for checking is some release is available for a package. +func (rm *RegistryMetadata) ReleaseMap() map[string]bool { + releases := map[string]bool{} + + for _, release := range rm.Releases { + releases[release] = false + } + + return releases +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/appregistry.go b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/appregistry.go index a19a282964..eacbc9a7ce 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/appregistry.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/appregistry.go @@ -38,10 +38,7 @@ func NewLoader(kubeconfig string, dbName string, downloadPath string, logger *lo input: &inputParser{ sourceSpecifier: specifier, }, - downloader: &downloader{ - logger: logger, - kubeClient: *kubeClient, - }, + downloader: newDownloader(logger, kubeClient), downloadPath: downloadPath, decoder: decoder, loader: loader, diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/builder.go b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/builder.go index 3bd5575e21..a5b9a667c2 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/builder.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/builder.go @@ -6,6 +6,7 @@ import ( "compress/gzip" "context" "database/sql" + "fmt" "io" "io/ioutil" "os" @@ -90,6 +91,11 @@ func (b *AppregistryImageBuilder) Build() error { if err := downloader.DownloadManifests(b.ManifestDir, b.AppRegistryOrg); err != nil { return err } + + if !hasManifests(b.ManifestDir) { + return fmt.Errorf("no manifests downloaded from appregistry %s/%s", b.AppRegistryEndpoint, b.AppRegistryOrg) + } + klog.V(4).Infof("downloaded manifests to %s\n", b.ManifestDir) if err := BuildDatabase(b.ManifestDir, b.DatabasePath); err != nil { @@ -212,3 +218,11 @@ func BuildLayer(directory string) (string, error) { return archive.Name(), nil } + +func hasManifests(path string) bool { + files, err := ioutil.ReadDir(path) + if err != nil { + return false + } + return len(files) > 0 +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/downloader.go b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/downloader.go index 32c1d50cbe..18142d2990 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/downloader.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/downloader.go @@ -20,15 +20,48 @@ type downloadItem struct { // Source refers to the remote appregistry URL and remote registry namespace. Source *Source + + // Release refers to the release number the user requested + Release string } func (d *downloadItem) String() string { - return fmt.Sprintf("%s", d.RepositoryMetadata) + return fmt.Sprintf("%s:%s", d.RepositoryMetadata.Name, d.Release) +} + +type registryOptionsGetter interface { + GetRegistryOptions(source *Source) (*apprclient.Options, error) +} + +type secretRegistryOptionsGetter struct { + kubeClient kubernetes.Interface +} + +type sourceQuerier interface { + QuerySource(source *Source) ([]*apprclient.RegistryMetadata, error) +} + +type appRegistrySourceQuerier struct { + kubeClient kubernetes.Interface + regOptionGetter registryOptionsGetter } type downloader struct { - logger *logrus.Entry - kubeClient kubernetes.Clientset + logger *logrus.Entry + kubeClient kubernetes.Interface + querier sourceQuerier + regOptionGetter registryOptionsGetter +} + +// NewDownloader returns a new instance of downloader +func newDownloader(logger *logrus.Entry, kubeClient kubernetes.Interface) *downloader { + regOptionGetter := &secretRegistryOptionsGetter{kubeClient} + return &downloader{ + logger, + kubeClient, + &appRegistrySourceQuerier{kubeClient, regOptionGetter}, + regOptionGetter, + } } // Download downloads manifest(s) associated with the specified package(s) from @@ -43,11 +76,18 @@ func (d *downloader) Download(input *Input) (manifests []*apprclient.OperatorMet d.logger.Errorf("the following error(s) occurred while preparing the download list: %v", err) if len(items) == 0 { - d.logger.Infof("download list is empty, bailing out: %s", input.Packages) + d.logger.Infof("download list is empty, bailing out: %v", input.Packages) return } } + for _, item := range items { + d.logger.Infof( + "the following releases are available for package %s -> %s", + item.RepositoryMetadata.Name, + item.RepositoryMetadata.Releases, + ) + } d.logger.Infof("resolved the following packages: %s", items) manifests, err = d.DownloadRepositories(items) @@ -65,7 +105,7 @@ func (d *downloader) Download(input *Input) (manifests []*apprclient.OperatorMet // log it and move on. func (d *downloader) Prepare(input *Input) (items []*downloadItem, err error) { packageMap := input.PackagesToMap() - itemMap := map[string]*downloadItem{} + itemMap := map[Package]*downloadItem{} allErrors := []error{} for _, source := range input.Sources { @@ -74,7 +114,7 @@ func (d *downloader) Prepare(input *Input) (items []*downloadItem, err error) { break } - repositoryList, err := d.QuerySource(source) + repositoryList, err := d.querier.QuerySource(source) if err != nil { allErrors = append(allErrors, err) d.logger.Infof("skipping operator source due to error: %s", source) @@ -82,22 +122,36 @@ func (d *downloader) Prepare(input *Input) (items []*downloadItem, err error) { continue } + repositoryMap := map[string]*apprclient.RegistryMetadata{} for _, metadata := range repositoryList { - // Repository name has a one to one mapping to operator/package name. - // We use this as the key. - key := metadata.Name - - if _, ok := packageMap[key]; ok { - // The package specified has been resolved to this repository - // name in remote registry. - itemMap[key] = &downloadItem{ - RepositoryMetadata: metadata, - Source: source, + repositoryMap[metadata.Name] = metadata + } + + for _, pkg := range input.Packages { + metadata, ok := repositoryMap[pkg.Name] + if !ok { + // The package is not in the current source + continue + } + // If a specific release was requrested, download it + release := pkg.Release + if release != "" { + releaseMap := metadata.ReleaseMap() + if _, ok := releaseMap[pkg.Release]; !ok { + // We have the package, but not the requested release + continue } + } else { + // default to the latest + release = metadata.Release + } - // Remove the package specified since it has been resolved. - delete(packageMap, key) + itemMap[*pkg] = &downloadItem{ + RepositoryMetadata: metadata, + Release: release, + Source: source, } + delete(packageMap, *pkg) } } @@ -124,12 +178,12 @@ func (d *downloader) DownloadRepositories(items []*downloadItem) (manifests []*a for _, item := range items { endpoint := item.Source.Endpoint - d.logger.Infof("downloading repository: %s from %s", item.RepositoryMetadata, endpoint) + d.logger.Infof("downloading repository: %s from %s", item, endpoint) - options, err := d.SetupRegistryOptions(item.Source) + options, err := d.regOptionGetter.GetRegistryOptions(item.Source) if err != nil { allErrors = append(allErrors, err) - d.logger.Infof("skipping repository: %s", item.RepositoryMetadata) + d.logger.Infof("skipping repository: %s", item) continue } @@ -137,15 +191,15 @@ func (d *downloader) DownloadRepositories(items []*downloadItem) (manifests []*a client, err := apprclient.New(*options) if err != nil { allErrors = append(allErrors, err) - d.logger.Infof("skipping repository: %s", item.RepositoryMetadata) + d.logger.Infof("skipping repository: %s", item) continue } - manifest, err := client.RetrieveOne(item.RepositoryMetadata.ID(), item.RepositoryMetadata.Release) + manifest, err := client.RetrieveOne(item.RepositoryMetadata.ID(), item.Release) if err != nil { allErrors = append(allErrors, err) - d.logger.Infof("skipping repository: %s", item.RepositoryMetadata) + d.logger.Infof("skipping repository: %s", item) continue } @@ -164,12 +218,12 @@ func (d *downloader) DownloadRepositories(items []*downloadItem) (manifests []*a // The function returns the spec ( associated with the OperatorSource object ) // in the cluster and the list of repositories in remote registry associated // with it. -func (d *downloader) QuerySource(source *Source) (repositories []*apprclient.RegistryMetadata, err error) { +func (a *appRegistrySourceQuerier) QuerySource(source *Source) (repositories []*apprclient.RegistryMetadata, err error) { if source == nil { return nil, errors.New("specified source is ") } - options, err := d.SetupRegistryOptions(source) + options, err := a.regOptionGetter.GetRegistryOptions(source) if err != nil { return } @@ -187,17 +241,17 @@ func (d *downloader) QuerySource(source *Source) (repositories []*apprclient.Reg return } -// SetupRegistryOptions generates an Options object based on the OperatorSource spec. It passes along +// GetRegistryOptions generates an Options object based on the OperatorSource spec. It passes along // the opsrc endpoint and, if defined, retrieves the authorization token from the specified Secret // object. -func (d *downloader) SetupRegistryOptions(source *Source) (*apprclient.Options, error) { +func (s *secretRegistryOptionsGetter) GetRegistryOptions(source *Source) (*apprclient.Options, error) { if source == nil { return nil, errors.New("specified source is ") } token := "" if source.IsSecretSpecified() { - secret, err := d.kubeClient.CoreV1().Secrets(source.Secret.Namespace).Get(source.Secret.Name, metav1.GetOptions{}) + secret, err := s.kubeClient.CoreV1().Secrets(source.Secret.Namespace).Get(source.Secret.Name, metav1.GetOptions{}) if err != nil { return nil, err } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/input.go b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/input.go index 80ed615fed..9c73c93d5c 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/input.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/appregistry/input.go @@ -1,7 +1,10 @@ package appregistry import ( + "fmt" "strings" + + utilerrors "k8s.io/apimachinery/pkg/util/errors" ) // OperatorSourceSpecifier interface provides capability to have different ways @@ -17,18 +20,32 @@ type Input struct { Sources []*Source // Packages is the set of package name(s) specified. - Packages []string + Packages []*Package +} + +type Package struct { + // The name of the package + Name string + // The release number of the package + Release string +} + +func (p *Package) String() string { + if p.Release == "" { + return fmt.Sprintf("%s", p.Name) + } + return fmt.Sprintf("%s:%s", p.Name, p.Release) } func (i *Input) IsGoodToProceed() bool { return len(i.Sources) > 0 && len(i.Packages) > 0 } -func (i *Input) PackagesToMap() map[string]bool { - packages := map[string]bool{} +func (i *Input) PackagesToMap() map[Package]bool { + packages := map[Package]bool{} for _, pkg := range i.Packages { - packages[pkg] = false + packages[*pkg] = false } return packages @@ -56,7 +73,7 @@ func (p *inputParser) Parse(csvSources []string, csvPackages string) (*Input, er return nil, err } - packages := sanitizePackageList(strings.Split(csvPackages, ",")) + packages, err := sanitizePackageList(strings.Split(csvPackages, ",")) return &Input{ Sources: sources, @@ -66,18 +83,49 @@ func (p *inputParser) Parse(csvSources []string, csvPackages string) (*Input, er // sanitizePackageList sanitizes the set of package(s) specified. It removes // duplicates and ignores empty string. -func sanitizePackageList(in []string) []string { - out := make([]string, 0) - +func sanitizePackageList(in []string) ([]*Package, error) { + out := make([]*Package, 0) + allErrors := []error{} inMap := map[string]bool{} + for _, item := range in { - if _, ok := inMap[item]; ok || item == "" { + name, release, err := getNameAndRelease(item) + if err != nil { + allErrors = append(allErrors, err) + continue + } + + if _, ok := inMap[name]; ok || name == "" { continue } - inMap[item] = true - out = append(out, item) + inMap[name] = true + out = append(out, &Package{Name: name, Release: release}) } - return out + err := utilerrors.NewAggregate(allErrors) + return out, err +} + +func getNameAndRelease(in string) (string, string, error) { + inWithoutSpaces := strings.Map( + func(r rune) rune { + if r == ' ' { + return -1 + } + return r + }, + in, + ) + parts := strings.Split(inWithoutSpaces, ":") + + switch len(parts) { + case 1: + // release wasn't specified + return parts[0], "", nil + case 2: + return parts[0], parts[1], nil + default: + return "", "", fmt.Errorf("Failed to parse package %s", in) + } } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/command.go b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/command.go index 426a12bfd6..325258f46d 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/command.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/command.go @@ -2,6 +2,7 @@ package containertools import ( + "fmt" "os/exec" "github.com/sirupsen/logrus" @@ -23,15 +24,15 @@ type CommandRunner interface { Inspect(image string) ([]byte, error) } -// ContainerCommandRunner is configured to select a container cli tool and execute commands with that -// tooling. +// ContainerCommandRunner is configured to select a container cli tool and +// execute commands with that tooling. type ContainerCommandRunner struct { logger *logrus.Entry containerTool string } -// NewCommandRunner takes the containerTool as an input string and returns a CommandRunner to -// run commands with that cli tool +// NewCommandRunner takes the containerTool as an input string and returns a +// CommandRunner to run commands with that cli tool func NewCommandRunner(containerTool string, logger *logrus.Entry) CommandRunner { r := ContainerCommandRunner{ logger: logger, @@ -54,8 +55,8 @@ func (r *ContainerCommandRunner) GetToolName() string { return r.containerTool } -// Pull takes a container image path hosted on a container registry and runs the pull command to -// download it onto the local environment +// Pull takes a container image path hosted on a container registry and runs the +// pull command to download it onto the local environment func (r *ContainerCommandRunner) Pull(image string) error { args := []string{"pull", image} @@ -64,10 +65,10 @@ func (r *ContainerCommandRunner) Pull(image string) error { r.logger.Infof("running %s pull", r.containerTool) r.logger.Debugf("%s", command.Args) - out, err := command.Output() + out, err := command.CombinedOutput() if err != nil { r.logger.Errorf(string(out)) - return err + return fmt.Errorf("error pulling image: %s. %v", string(out), err) } return nil @@ -88,17 +89,17 @@ func (r *ContainerCommandRunner) Build(dockerfile, tag string) error { r.logger.Infof("running %s build", r.containerTool) r.logger.Infof("%s", command.Args) - out, err := command.Output() + out, err := command.CombinedOutput() if err != nil { r.logger.Errorf(string(out)) - return err + return fmt.Errorf("error building image: %s. %v", string(out), err) } return nil } -// Save takes a local container image and runs the save commmand to convert the image into a specified -// tarball and push it to the local directory +// Save takes a local container image and runs the save commmand to convert the +// image into a specified tarball and push it to the local directory func (r *ContainerCommandRunner) Save(image, tarFile string) error { args := []string{"save", image, "-o", tarFile} @@ -107,17 +108,17 @@ func (r *ContainerCommandRunner) Save(image, tarFile string) error { r.logger.Infof("running %s save", r.containerTool) r.logger.Debugf("%s", command.Args) - out, err := command.Output() + out, err := command.CombinedOutput() if err != nil { r.logger.Errorf(string(out)) - return err + return fmt.Errorf("error saving image: %s. %v", string(out), err) } return nil } -// Inspect runs the 'inspect' command to get image metadata of a local container image -// and returns a byte array of the command's output +// Inspect runs the 'inspect' command to get image metadata of a local container +// image and returns a byte array of the command's output func (r *ContainerCommandRunner) Inspect(image string) ([]byte, error) { args := []string{"inspect", image} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/dockerfilegenerator.go b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/dockerfilegenerator.go index 32b82ebd10..43ef0d57c5 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/dockerfilegenerator.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/dockerfilegenerator.go @@ -8,9 +8,8 @@ import ( ) const ( - baseImage = "scratch" defaultBinarySourceImage = "quay.io/operator-framework/upstream-registry-builder" - DefaultDbLocation = "./index.db" + DefaultDbLocation = "/database/index.db" DbLocationLabel = "operators.operatorframework.io.index.database.v1" ) @@ -42,22 +41,17 @@ func (g *IndexDockerfileGenerator) GenerateIndexDockerfile(binarySourceImage, da g.Logger.Info("Generating dockerfile") - // Where to collect the binary - dockerfile += fmt.Sprintf("FROM %s AS builder\n", binarySourceImage) - // From - dockerfile += fmt.Sprintf("\nFROM %s\n", baseImage) + dockerfile += fmt.Sprintf("FROM %s\n", binarySourceImage) // Labels dockerfile += fmt.Sprintf("LABEL %s=%s\n", DbLocationLabel, DefaultDbLocation) // Content - dockerfile += fmt.Sprintf("COPY %s ./\n", databaseFolder) - dockerfile += fmt.Sprintf("COPY --from=builder /build/bin/opm /opm\n") - dockerfile += fmt.Sprintf("COPY --from=builder /bin/grpc_health_probe /bin/grpc_health_probe\n") + dockerfile += fmt.Sprintf("ADD %s /database\n", databaseFolder) dockerfile += fmt.Sprintf("EXPOSE 50051\n") - dockerfile += fmt.Sprintf("ENTRYPOINT [\"/opm\"]\n") - dockerfile += fmt.Sprintf("CMD [\"registry\", \"serve\", \"--database\", \"index.db\"]\n") + dockerfile += fmt.Sprintf("ENTRYPOINT [\"/bin/opm\"]\n") + dockerfile += fmt.Sprintf("CMD [\"registry\", \"serve\", \"--database\", \"%s\"]\n", DefaultDbLocation) return dockerfile } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/imagereader.go b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/imagereader.go index dd7273d320..5859dd770a 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/containertools/imagereader.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/containertools/imagereader.go @@ -58,16 +58,17 @@ func (b ImageLayerReader) GetImageData(image, outputDir string, opts ...GetImage return err } - workingDir := options.WorkingDir - if workingDir == "" { + rootTarfile := filepath.Join(options.WorkingDir, "bundle.tar") + + if options.WorkingDir == "" { workingDir, err := ioutil.TempDir("./", "bundle_staging_") if err != nil { return err } defer os.RemoveAll(workingDir) - } - rootTarfile := filepath.Join(workingDir, "bundle.tar") + rootTarfile = filepath.Join(workingDir, "bundle.tar") + } err = b.Cmd.Save(image, rootTarfile) if err != nil { diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go index 9b33043ea9..2c6c7c2857 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go @@ -54,7 +54,6 @@ func (EmptyQuery) GetBundleThatProvides(ctx context.Context, group, version, kin func (EmptyQuery) ListImages(ctx context.Context) ([]string, error) { return nil, errors.New("empty querier: cannot get image list") - } func (EmptyQuery) GetImagesForBundle(ctx context.Context, bundleName string) ([]string, error) { @@ -65,6 +64,26 @@ func (EmptyQuery) GetApisForEntry(ctx context.Context, entryId int64) (provided return nil, nil, errors.New("empty querier: cannot apis") } +func (EmptyQuery) GetBundleVersion(ctx context.Context, image string) (string, error) { + return "", errors.New("empty querier: cannot get version") +} + +func (EmptyQuery) GetBundlePathsForPackage(ctx context.Context, pkgName string) ([]string, error) { + return nil, errors.New("empty querier: cannot get images") +} + +func (EmptyQuery) GetDefaultChannelForPackage(ctx context.Context, pkgName string) (string, error) { + return "", errors.New("empty querier: cannot get default channel") +} + +func (EmptyQuery) ListChannels(ctx context.Context, pkgName string) ([]string, error) { + return nil, errors.New("empty querier: cannot list channels") +} + +func (EmptyQuery) GetCurrentCSVNameForChannel(ctx context.Context, pkgName, channel string) (string, error) { + return "", errors.New("empty querier: cannot get csv name for package and channel") +} + var _ Query = &EmptyQuery{} func NewEmptyQuerier() *EmptyQuery { diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go index 69a0102adf..15bb7a70b5 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go @@ -35,5 +35,15 @@ type Query interface { // List all images for a particular bundle GetImagesForBundle(ctx context.Context, bundleName string) ([]string, error) // Get Provided and Required APIs for a particular bundle - GetApisForEntry(ctx context.Context, entryId int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) + GetApisForEntry(ctx context.Context, entryID int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) + // Get Version of a Bundle Image + GetBundleVersion(ctx context.Context, image string) (string, error) + // List Images for Package + GetBundlePathsForPackage(ctx context.Context, pkgName string) ([]string, error) + // Get DefaultChannel for Package + GetDefaultChannelForPackage(ctx context.Context, pkgName string) (string, error) + // List channels for package + ListChannels(ctx context.Context, pkgName string) ([]string, error) + // Get CurrentCSV name for channel and package + GetCurrentCSVNameForChannel(ctx context.Context, pkgName, channel string) (string, error) } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/image.go b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/image.go index 80afd43ac4..aeab395489 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/image.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/image.go @@ -18,17 +18,17 @@ import ( // ImageLoader loads a bundle image of resources into the database type ImageLoader struct { - store registry.Load - image string - directory string + store registry.Load + image string + directory string containerTool string } func NewSQLLoaderForImage(store registry.Load, image, containerTool string) *ImageLoader { return &ImageLoader{ - store: store, - image: image, - directory: "", + store: store, + image: image, + directory: "", containerTool: containerTool, } } diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/load.go b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/load.go index a5a880e9d0..ac6ed59996 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/load.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/load.go @@ -190,8 +190,10 @@ func (s *SQLLoader) AddPackageChannels(manifest registry.PackageManifest) error channelEntryCSVName := c.CurrentCSVName depth := 1 - for { + // Since this loop depends on following 'replaces', keep track of where it's been + replaceCycle := map[string]bool{channelEntryCSVName: true} + for { // Get CSV for current entry channelEntryCSV, err := s.getCSV(tx, channelEntryCSVName) if err != nil { @@ -265,6 +267,14 @@ func (s *SQLLoader) AddPackageChannels(manifest registry.PackageManifest) error errs = append(errs, err) break } + + // If we find 'replaces' in the circuit list then we've seen it already, break out + if _, ok := replaceCycle[replaces]; ok { + errs = append(errs, fmt.Errorf("Cycle detected, %s replaces %s", channelEntryCSVName, replaces)) + break + } + replaceCycle[replaces] = true + replacedID, err := replacedChannelEntry.LastInsertId() if err != nil { errs = append(errs, err) @@ -810,7 +820,7 @@ func (s *SQLLoader) updatePackageChannels(tx *sql.Tx, manifest registry.PackageM errs = append(errs, err) break } - + // check replaces replaces, err := channelEntryCSV.GetReplaces() if err != nil { diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/query.go b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/query.go index 0ebc4f6954..c68fd52e12 100644 --- a/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/query.go +++ b/vendor/github.com/operator-framework/operator-registry/pkg/sqlite/query.go @@ -124,7 +124,7 @@ func (s *SQLQuerier) GetBundle(ctx context.Context, pkgName, channelName, csvNam defer rows.Close() if !rows.Next() { - return nil, fmt.Errorf("no entry found for %s %s %s", pkgName, channelName, csvName) + return nil, fmt.Errorf("no entry found for %s %s %s", pkgName, channelName, csvName) } var entryId sql.NullInt64 var name sql.NullString @@ -172,7 +172,7 @@ func (s *SQLQuerier) GetBundleForChannel(ctx context.Context, pkgName string, ch defer rows.Close() if !rows.Next() { - return nil, fmt.Errorf("no entry found for %s %s", pkgName, channelName) + return nil, fmt.Errorf("no entry found for %s %s", pkgName, channelName) } var entryId sql.NullInt64 var name sql.NullString @@ -255,9 +255,8 @@ func (s *SQLQuerier) GetBundleThatReplaces(ctx context.Context, name, pkgName, c } defer rows.Close() - if !rows.Next() { - return nil, fmt.Errorf("no entry found for %s %s", pkgName, channelName) + return nil, fmt.Errorf("no entry found for %s %s", pkgName, channelName) } var entryId sql.NullInt64 var outName sql.NullString @@ -473,14 +472,14 @@ func (s *SQLQuerier) GetImagesForBundle(ctx context.Context, csvName string) ([] return images, nil } -func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryId int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) { +func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) { providedQuery := `SELECT DISTINCT api.group_name, api.version, api.kind, api.plural FROM api INNER JOIN api_provider ON (api.group_name=api_provider.group_name AND api.version=api_provider.version AND api.kind=api_provider.kind) WHERE api_provider.channel_entry_id=?` - providedRows, err := s.db.QueryContext(ctx, providedQuery, entryId) + providedRows, err := s.db.QueryContext(ctx, providedQuery, entryID) if err != nil { - return nil,nil, err + return nil, nil, err } provided = []*api.GroupVersionKind{} @@ -497,10 +496,10 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryId int64) (provid return nil, nil, err } provided = append(provided, &api.GroupVersionKind{ - Group: groupName.String, + Group: groupName.String, Version: versionName.String, - Kind: kindName.String, - Plural: pluralName.String, + Kind: kindName.String, + Plural: pluralName.String, }) } if err := providedRows.Close(); err != nil { @@ -511,9 +510,9 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryId int64) (provid INNER JOIN api_requirer ON (api.group_name=api_requirer.group_name AND api.version=api_requirer.version AND api.kind=api_requirer.kind) WHERE api_requirer.channel_entry_id=?` - requiredRows, err := s.db.QueryContext(ctx, requiredQuery, entryId) + requiredRows, err := s.db.QueryContext(ctx, requiredQuery, entryID) if err != nil { - return nil,nil, err + return nil, nil, err } required = []*api.GroupVersionKind{} for requiredRows.Next() { @@ -529,10 +528,10 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryId int64) (provid return nil, nil, err } required = append(required, &api.GroupVersionKind{ - Group: groupName.String, + Group: groupName.String, Version: versionName.String, - Kind: kindName.String, - Plural: pluralName.String, + Kind: kindName.String, + Plural: pluralName.String, }) } if err := requiredRows.Close(); err != nil { @@ -541,3 +540,106 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryId int64) (provid return } + +func (s *SQLQuerier) GetBundleVersion(ctx context.Context, image string) (string, error) { + query := `SELECT version FROM operatorbundle WHERE bundlepath=? LIMIT 1` + rows, err := s.db.QueryContext(ctx, query, image) + if err != nil { + return "", err + } + defer rows.Close() + + var version sql.NullString + if rows.Next() { + if err := rows.Scan(&version); err != nil { + return "", err + } + } + if version.Valid { + return version.String, nil + } + return "", fmt.Errorf("bundle %s not found", image) +} + +func (s *SQLQuerier) GetBundlePathsForPackage(ctx context.Context, pkgName string) ([]string, error) { + query := `SELECT DISTINCT bundlepath FROM operatorbundle + INNER JOIN channel_entry ON operatorbundle.name=channel_entry.operatorbundle_name + WHERE channel_entry.package_name=?` + rows, err := s.db.QueryContext(ctx, query, pkgName) + if err != nil { + return nil, err + } + defer rows.Close() + images := []string{} + for rows.Next() { + var imgName sql.NullString + if err := rows.Scan(&imgName); err != nil { + return nil, err + } + if imgName.Valid && imgName.String != "" { + images = append(images, imgName.String) + } else { + return nil, fmt.Errorf("Index malformed: cannot find paths to bundle images") + } + } + return images, nil +} + +func (s *SQLQuerier) GetDefaultChannelForPackage(ctx context.Context, pkgName string) (string, error) { + query := `SELECT DISTINCT default_channel FROM package WHERE name=? LIMIT 1` + rows, err := s.db.QueryContext(ctx, query, pkgName) + if err != nil { + return "", err + } + defer rows.Close() + + var defaultChannel sql.NullString + if rows.Next() { + if err := rows.Scan(&defaultChannel); err != nil { + return "", err + } + } + if defaultChannel.Valid { + return defaultChannel.String, nil + } + return "", nil +} + +func (s *SQLQuerier) ListChannels(ctx context.Context, pkgName string) ([]string, error) { + query := `SELECT DISTINCT name FROM channel WHERE channel.package_name=?` + rows, err := s.db.QueryContext(ctx, query, pkgName) + if err != nil { + return nil, err + } + defer rows.Close() + channels := []string{} + for rows.Next() { + var chName sql.NullString + if err := rows.Scan(&chName); err != nil { + return nil, err + } + if chName.Valid { + channels = append(channels, chName.String) + } + } + return channels, nil +} + +func (s *SQLQuerier) GetCurrentCSVNameForChannel(ctx context.Context, pkgName, channel string) (string, error) { + query := `SELECT DISTINCT head_operatorbundle_name FROM channel WHERE channel.package_name=? AND channel.name=?` + rows, err := s.db.QueryContext(ctx, query, pkgName, channel) + if err != nil { + return "", err + } + defer rows.Close() + var csvName sql.NullString + if rows.Next() { + if err := rows.Scan(&csvName); err != nil { + return "", err + } + } + if csvName.Valid { + return csvName.String, nil + } + return "", nil +} diff --git a/vendor/google.golang.org/grpc/.travis.yml b/vendor/google.golang.org/grpc/.travis.yml index 024408e646..f0f723f356 100644 --- a/vendor/google.golang.org/grpc/.travis.yml +++ b/vendor/google.golang.org/grpc/.travis.yml @@ -23,7 +23,7 @@ before_install: - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi - if [[ -n "${RUN386}" ]]; then export GOARCH=386; fi - if [[ "${TRAVIS_EVENT_TYPE}" = "cron" && -z "${RUN386}" ]]; then RACE=1; fi - - if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then VET_SKIP_PROTO=1; fi + - if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then export VET_SKIP_PROTO=1; fi install: - try3() { eval "$*" || eval "$*" || eval "$*"; } diff --git a/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md new file mode 100644 index 0000000000..9d4213ebca --- /dev/null +++ b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md @@ -0,0 +1,3 @@ +## Community Code of Conduct + +gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md index 6e69b28c27..4f1567e2f9 100644 --- a/vendor/google.golang.org/grpc/CONTRIBUTING.md +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -1,6 +1,8 @@ # How to contribute -We definitely welcome your patches and contributions to gRPC! +We definitely welcome your patches and contributions to gRPC! Please read the gRPC +organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) +and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding. If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) diff --git a/vendor/google.golang.org/grpc/GOVERNANCE.md b/vendor/google.golang.org/grpc/GOVERNANCE.md new file mode 100644 index 0000000000..d6ff267471 --- /dev/null +++ b/vendor/google.golang.org/grpc/GOVERNANCE.md @@ -0,0 +1 @@ +This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md). diff --git a/vendor/google.golang.org/grpc/MAINTAINERS.md b/vendor/google.golang.org/grpc/MAINTAINERS.md new file mode 100644 index 0000000000..093c82b3af --- /dev/null +++ b/vendor/google.golang.org/grpc/MAINTAINERS.md @@ -0,0 +1,27 @@ +This page lists all active maintainers of this repository. If you were a +maintainer and would like to add your name to the Emeritus list, please send us a +PR. + +See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) +for governance guidelines and how to become a maintainer. +See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) +for general contribution guidelines. + +## Maintainers (in alphabetical order) +- [canguler](https://github.com/canguler), Google LLC +- [cesarghali](https://github.com/cesarghali), Google LLC +- [dfawley](https://github.com/dfawley), Google LLC +- [easwars](https://github.com/easwars), Google LLC +- [jadekler](https://github.com/jadekler), Google LLC +- [menghanl](https://github.com/menghanl), Google LLC +- [srini100](https://github.com/srini100), Google LLC + +## Emeritus Maintainers (in alphabetical order) +- [adelez](https://github.com/adelez), Google LLC +- [iamqizhao](https://github.com/iamqizhao), Google LLC +- [jtattermusch](https://github.com/jtattermusch), Google LLC +- [lyuxuan](https://github.com/lyuxuan), Google LLC +- [makmukhi](https://github.com/makmukhi), Google LLC +- [matt-kwong](https://github.com/matt-kwong), Google LLC +- [nicolasnoble](https://github.com/nicolasnoble), Google LLC +- [yongni](https://github.com/yongni), Google LLC diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod index c1a8340c5b..c7f3fa3f36 100644 --- a/vendor/google.golang.org/grpc/go.mod +++ b/vendor/google.golang.org/grpc/go.mod @@ -1,12 +1,14 @@ module google.golang.org/grpc +go 1.11 + require ( cloud.google.com/go v0.26.0 // indirect github.com/BurntSushi/toml v0.3.1 // indirect github.com/client9/misspell v0.3.4 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/mock v1.1.1 - github.com/golang/protobuf v1.2.0 + github.com/golang/protobuf v1.3.2 github.com/google/go-cmp v0.2.0 golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 golang.org/x/net v0.0.0-20190311183353-d8887717615a diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum index 741677d2e8..7faff49e7d 100644 --- a/vendor/google.golang.org/grpc/go.sum +++ b/vendor/google.golang.org/grpc/go.sum @@ -8,8 +8,8 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekf github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index b8e0aa4db2..ddee20b6be 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -107,8 +107,8 @@ func (*registerStream) isTransportResponseFrame() bool { return false } type headerFrame struct { streamID uint32 hf []hpack.HeaderField - endStream bool // Valid on server side. - initStream func(uint32) (bool, error) // Used only on the client side. + endStream bool // Valid on server side. + initStream func(uint32) error // Used only on the client side. onWrite func() wq *writeQuota // write quota for the stream created. cleanup *cleanupStream // Valid on the server side. @@ -637,21 +637,17 @@ func (l *loopyWriter) headerHandler(h *headerFrame) error { func (l *loopyWriter) originateStream(str *outStream) error { hdr := str.itl.dequeue().(*headerFrame) - sendPing, err := hdr.initStream(str.id) - if err != nil { + if err := hdr.initStream(str.id); err != nil { if err == ErrConnClosing { return err } // Other errors(errStreamDrain) need not close transport. return nil } - if err = l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { + if err := l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { return err } l.estdStreams[str.id] = str - if sendPing { - return l.pingHandler(&ping{data: [8]byte{}}) - } return nil } diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 41a79c5670..9bd8c27b36 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -62,8 +62,6 @@ type http2Client struct { // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor) // that the server sent GoAway on this transport. goAway chan struct{} - // awakenKeepalive is used to wake up keepalive when after it has gone dormant. - awakenKeepalive chan struct{} framer *framer // controlBuf delivers all the control related tasks (e.g., window @@ -110,6 +108,16 @@ type http2Client struct { // goAwayReason records the http2.ErrCode and debug data received with the // GoAway frame. goAwayReason GoAwayReason + // A condition variable used to signal when the keepalive goroutine should + // go dormant. The condition for dormancy is based on the number of active + // streams and the `PermitWithoutStream` keepalive client parameter. And + // since the number of active streams is guarded by the above mutex, we use + // the same for this condition variable as well. + kpDormancyCond *sync.Cond + // A boolean to track whether the keepalive goroutine is dormant or not. + // This is checked before attempting to signal the above condition + // variable. + kpDormant bool // Fields below are for channelz metric collection. channelzID int64 // channelz unique identification number @@ -232,7 +240,6 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne readerDone: make(chan struct{}), writerDone: make(chan struct{}), goAway: make(chan struct{}), - awakenKeepalive: make(chan struct{}, 1), framer: newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize), fc: &trInFlow{limit: uint32(icwz)}, scheme: scheme, @@ -264,9 +271,6 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne updateFlowControl: t.updateFlowControl, } } - // Make sure awakenKeepalive can't be written upon. - // keepalive routine will make it writable, if need be. - t.awakenKeepalive <- struct{}{} if t.statsHandler != nil { t.ctx = t.statsHandler.TagConn(t.ctx, &stats.ConnTagInfo{ RemoteAddr: t.remoteAddr, @@ -281,6 +285,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr TargetInfo, opts Conne t.channelzID = channelz.RegisterNormalSocket(t, opts.ChannelzParentID, fmt.Sprintf("%s -> %s", t.localAddr, t.remoteAddr)) } if t.keepaliveEnabled { + t.kpDormancyCond = sync.NewCond(&t.mu) go t.keepalive() } // Start the reader goroutine for incoming message. Each transport has @@ -564,7 +569,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea hdr := &headerFrame{ hf: headerFields, endStream: false, - initStream: func(id uint32) (bool, error) { + initStream: func(id uint32) error { t.mu.Lock() if state := t.state; state != reachable { t.mu.Unlock() @@ -574,29 +579,19 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea err = ErrConnClosing } cleanup(err) - return false, err + return err } t.activeStreams[id] = s if channelz.IsOn() { atomic.AddInt64(&t.czData.streamsStarted, 1) atomic.StoreInt64(&t.czData.lastStreamCreatedTime, time.Now().UnixNano()) } - var sendPing bool - // If the number of active streams change from 0 to 1, then check if keepalive - // has gone dormant. If so, wake it up. - if len(t.activeStreams) == 1 && t.keepaliveEnabled { - select { - case t.awakenKeepalive <- struct{}{}: - sendPing = true - // Fill the awakenKeepalive channel again as this channel must be - // kept non-writable except at the point that the keepalive() - // goroutine is waiting either to be awaken or shutdown. - t.awakenKeepalive <- struct{}{} - default: - } + // If the keepalive goroutine has gone dormant, wake it up. + if t.kpDormant { + t.kpDormancyCond.Signal() } t.mu.Unlock() - return sendPing, nil + return nil }, onOrphaned: cleanup, wq: s.wq, @@ -778,6 +773,11 @@ func (t *http2Client) Close() error { t.state = closing streams := t.activeStreams t.activeStreams = nil + if t.kpDormant { + // If the keepalive goroutine is blocked on this condition variable, we + // should unblock it so that the goroutine eventually exits. + t.kpDormancyCond.Signal() + } t.mu.Unlock() t.controlBuf.finish() t.cancel() @@ -853,11 +853,11 @@ func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) e return t.controlBuf.put(df) } -func (t *http2Client) getStream(f http2.Frame) (*Stream, bool) { +func (t *http2Client) getStream(f http2.Frame) *Stream { t.mu.Lock() - defer t.mu.Unlock() - s, ok := t.activeStreams[f.Header().StreamID] - return s, ok + s := t.activeStreams[f.Header().StreamID] + t.mu.Unlock() + return s } // adjustWindow sends out extra window update over the initial window size @@ -937,8 +937,8 @@ func (t *http2Client) handleData(f *http2.DataFrame) { t.controlBuf.put(bdpPing) } // Select the right stream to dispatch. - s, ok := t.getStream(f) - if !ok { + s := t.getStream(f) + if s == nil { return } if size > 0 { @@ -969,8 +969,8 @@ func (t *http2Client) handleData(f *http2.DataFrame) { } func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { - s, ok := t.getStream(f) - if !ok { + s := t.getStream(f) + if s == nil { return } if f.ErrCode == http2.ErrCodeRefusedStream { @@ -1147,8 +1147,8 @@ func (t *http2Client) handleWindowUpdate(f *http2.WindowUpdateFrame) { // operateHeaders takes action on the decoded headers. func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { - s, ok := t.getStream(frame) - if !ok { + s := t.getStream(frame) + if s == nil { return } endStream := frame.StreamEnded() @@ -1303,29 +1303,32 @@ func (t *http2Client) keepalive() { timer.Reset(t.kp.Time) continue } - // Check if keepalive should go dormant. t.mu.Lock() - if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { - // Make awakenKeepalive writable. - <-t.awakenKeepalive - t.mu.Unlock() - select { - case <-t.awakenKeepalive: - // If the control gets here a ping has been sent - // need to reset the timer with keepalive.Timeout. - case <-t.ctx.Done(): - return - } - } else { + if t.state == closing { + // If the transport is closing, we should exit from the + // keepalive goroutine here. If not, we could have a race + // between the call to Signal() from Close() and the call to + // Wait() here, whereby the keepalive goroutine ends up + // blocking on the condition variable which will never be + // signalled again. t.mu.Unlock() - if channelz.IsOn() { - atomic.AddInt64(&t.czData.kpCount, 1) - } - // Send ping. - t.controlBuf.put(p) + return + } + if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { + t.kpDormant = true + t.kpDormancyCond.Wait() + } + t.kpDormant = false + t.mu.Unlock() + + if channelz.IsOn() { + atomic.AddInt64(&t.czData.kpCount, 1) } + // We get here either because we were dormant and a new stream was + // created which unblocked the Wait() call, or because the + // keepalive timer expired. In both cases, we need to send a ping. + t.controlBuf.put(p) - // By the time control gets here a ping has been sent one way or the other. timer.Reset(t.kp.Timeout) select { case <-timer.C: diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 4e26f6a1d6..33686a11ab 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -65,8 +65,7 @@ var ( // http2Server implements the ServerTransport interface with HTTP2. type http2Server struct { ctx context.Context - ctxDone <-chan struct{} // Cache the context.Done() chan - cancel context.CancelFunc + done chan struct{} conn net.Conn loopy *loopyWriter readerDone chan struct{} // sync point to enable testing. @@ -206,11 +205,10 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err if kep.MinTime == 0 { kep.MinTime = defaultKeepalivePolicyMinTime } - ctx, cancel := context.WithCancel(context.Background()) + done := make(chan struct{}) t := &http2Server{ - ctx: ctx, - cancel: cancel, - ctxDone: ctx.Done(), + ctx: context.Background(), + done: done, conn: conn, remoteAddr: conn.RemoteAddr(), localAddr: conn.LocalAddr(), @@ -231,7 +229,7 @@ func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err czData: new(channelzData), bufferPool: newBufferPool(), } - t.controlBuf = newControlBuffer(t.ctxDone) + t.controlBuf = newControlBuffer(t.done) if dynamicWindow { t.bdpEst = &bdpEstimator{ bdp: initialWindowSize, @@ -362,12 +360,14 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( rstCode: http2.ErrCodeRefusedStream, onWrite: func() {}, }) + s.cancel() return false } } t.mu.Lock() if t.state != reachable { t.mu.Unlock() + s.cancel() return false } if uint32(len(t.activeStreams)) >= t.maxStreams { @@ -378,12 +378,14 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( rstCode: http2.ErrCodeRefusedStream, onWrite: func() {}, }) + s.cancel() return false } if streamID%2 != 1 || streamID <= t.maxStreamID { t.mu.Unlock() // illegal gRPC stream id. errorf("transport: http2Server.HandleStreams received an illegal stream id: %v", streamID) + s.cancel() return true } t.maxStreamID = streamID @@ -885,7 +887,7 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e // TODO(mmukhi, dfawley): Should the server write also return io.EOF? s.cancel() select { - case <-t.ctx.Done(): + case <-t.done: return ErrConnClosing default: } @@ -907,7 +909,7 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e } if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { select { - case <-t.ctx.Done(): + case <-t.done: return ErrConnClosing default: } @@ -973,7 +975,7 @@ func (t *http2Server) keepalive() { t.Close() // Resetting the timer so that the clean-up doesn't deadlock. maxAge.Reset(infinity) - case <-t.ctx.Done(): + case <-t.done: } return case <-keepalive.C: @@ -995,7 +997,7 @@ func (t *http2Server) keepalive() { } t.controlBuf.put(p) keepalive.Reset(t.kp.Timeout) - case <-t.ctx.Done(): + case <-t.done: return } } @@ -1015,7 +1017,7 @@ func (t *http2Server) Close() error { t.activeStreams = nil t.mu.Unlock() t.controlBuf.finish() - t.cancel() + close(t.done) err := t.conn.Close() if channelz.IsOn() { channelz.RemoveEntry(t.channelzID) @@ -1155,7 +1157,7 @@ func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) { select { case <-t.drainChan: case <-timer.C: - case <-t.ctx.Done(): + case <-t.done: return } t.controlBuf.put(&goAway{code: g.code, debugData: g.debugData}) @@ -1205,7 +1207,7 @@ func (t *http2Server) getOutFlowWindow() int64 { select { case sz := <-resp: return int64(sz) - case <-t.ctxDone: + case <-t.done: return -1 case <-timer.C: return -2 diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go index d0787f1e2a..686ad7ba61 100644 --- a/vendor/google.golang.org/grpc/service_config.go +++ b/vendor/google.golang.org/grpc/service_config.go @@ -310,6 +310,14 @@ func parseServiceConfig(js string) (*ServiceConfig, error) { } break } + if sc.lbConfig == nil { + // We had a loadBalancingConfig field but did not encounter a + // supported policy. The config is considered invalid in this + // case. + err := fmt.Errorf("invalid loadBalancingConfig: no supported policies found") + grpclog.Warningf(err.Error()) + return nil, err + } } if rsc.MethodConfig == nil { diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 5888505638..483ef8968a 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.23.1" +const Version = "1.24.0" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index 661e1e1de9..2d79b1c694 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -67,7 +67,7 @@ elif [[ "$#" -ne 0 ]]; then fi # - Ensure all source files contain a copyright message. -git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" 2>&1 | fail_on_output +(! git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go') # - Make sure all tests in grpc and grpc/test use leakcheck via Teardown. (! grep 'func Test[^(]' *_test.go) @@ -75,10 +75,10 @@ git ls-files "*.go" | xargs grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO # - Do not import math/rand for real library code. Use internal/grpcrand for # thread safety. -git ls-files "*.go" | xargs grep -l '"math/rand"' 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test') +git grep -l '"math/rand"' -- "*.go" 2>&1 | (! grep -v '^examples\|^stress\|grpcrand\|wrr_test') # - Ensure all ptypes proto packages are renamed when importing. -git ls-files "*.go" | (! xargs grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/") +(! git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go") # - Check imports that are illegal in appengine (until Go 1.11). # TODO: Remove when we drop Go 1.10 support @@ -86,7 +86,7 @@ go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go # - gofmt, goimports, golint (with exceptions for generated code), go vet. gofmt -s -d -l . 2>&1 | fail_on_output -goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") | fail_on_output +goimports -l . 2>&1 | (! grep -vE "(_mock|\.pb)\.go") | fail_on_output golint ./... 2>&1 | (! grep -vE "(_mock|\.pb)\.go:") go vet -all . @@ -111,6 +111,7 @@ google.golang.org/grpc/balancer.go:SA1019 google.golang.org/grpc/balancer/grpclb/grpclb_remote_balancer.go:SA1019 google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019 google.golang.org/grpc/xds/internal/balancer/edsbalancer/balancergroup.go:SA1019 +google.golang.org/grpc/xds/internal/resolver/xds_resolver.go:SA1019 google.golang.org/grpc/xds/internal/balancer/xds.go:SA1019 google.golang.org/grpc/xds/internal/balancer/xds_client.go:SA1019 google.golang.org/grpc/balancer_conn_wrappers.go:SA1019 diff --git a/vendor/modules.txt b/vendor/modules.txt index edf412d1f5..59a35637b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -75,7 +75,7 @@ github.com/aws/aws-sdk-go/service/s3/s3manager github.com/aws/aws-sdk-go/service/sts # github.com/beorn7/perks v1.0.1 github.com/beorn7/perks/quantile -# github.com/blang/semver v3.5.0+incompatible +# github.com/blang/semver v3.5.1+incompatible github.com/blang/semver # github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2 github.com/certifi/gocertifi @@ -510,7 +510,7 @@ github.com/openshift/library-go/pkg/serviceability github.com/openshift/library-go/pkg/template/generator github.com/openshift/library-go/pkg/template/templateprocessing github.com/openshift/library-go/pkg/unidling/unidlingclient -# github.com/operator-framework/operator-registry v1.5.4 +# github.com/operator-framework/operator-registry v1.5.11 github.com/operator-framework/operator-registry/pkg/api github.com/operator-framework/operator-registry/pkg/api/grpc_health_v1 github.com/operator-framework/operator-registry/pkg/apprclient @@ -623,7 +623,7 @@ google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.23.1 +# google.golang.org/grpc v1.24.0 google.golang.org/grpc google.golang.org/grpc/balancer google.golang.org/grpc/balancer/base @@ -799,7 +799,7 @@ k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch k8s.io/cli-runtime/pkg/kustomize/k8sdeps/validator k8s.io/cli-runtime/pkg/printers k8s.io/cli-runtime/pkg/resource -# k8s.io/client-go v0.17.1 => github.com/openshift/kubernetes-client-go v0.0.0-20191211181558-5dcabadb2b45 +# k8s.io/client-go v8.0.0+incompatible => github.com/openshift/kubernetes-client-go v0.0.0-20191211181558-5dcabadb2b45 k8s.io/client-go/discovery k8s.io/client-go/discovery/cached/disk k8s.io/client-go/discovery/fake