diff --git a/Gopkg.lock b/Gopkg.lock index 355ede73e5d..5677e8cc498 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,6 +2,7 @@ [[projects]] + digest = "1:97bdeb31587a8bee3e13eb4519db4cc592bff017632bb07cbcd7c02925d8d621" name = "cloud.google.com/go" packages = [ "compute/metadata", @@ -10,94 +11,122 @@ "internal/version", "pubsub", "pubsub/apiv1", - "pubsub/internal/distribution" + "pubsub/internal/distribution", ] + pruneopts = "NUT" revision = "90f2606161ee6a14efe2ca79fc05ac2b8efe250b" [[projects]] + digest = "1:f2bb07cb70ceaecfffa034919e418793eef0960480474c276173b725449fdb1f" name = "github.com/Shopify/sarama" packages = ["."] + pruneopts = "NUT" revision = "46cf3e2cf1acef7876068f66cf69ec31aad2d0b2" [[projects]] branch = "master" + digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "NUT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] + digest = "1:4fb088ed7f384178cfc4552661e280a12ccc93be7f30a1ca994958a61a8e1d13" name = "github.com/bsm/sarama-cluster" packages = ["."] + pruneopts = "NUT" revision = "cf455bc755fe41ac9bb2861e7a961833d9c2ecc3" version = "v2.1.13" [[projects]] + digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "NUT" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] + digest = "1:08143362be979b087c2c1bae5dde986e988d3d5d4dc661727cbe436411b3f33a" name = "github.com/eapache/go-resiliency" packages = ["breaker"] + pruneopts = "NUT" revision = "ea41b0fad31007accc7f806884dcdf3da98b79ce" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:0b70d299db64766a4ee7128f0f94944f2356ca9d3499c79123dbc3a1d2ba803e" name = "github.com/eapache/go-xerial-snappy" packages = ["."] + pruneopts = "NUT" revision = "bb955e01b9346ac19dc29eb16586c90ded99a98c" [[projects]] + digest = "1:0d36a2b325b9e75f8057f7f9fbe778d348d70ba652cb9335485b69d1a5c4e038" name = "github.com/eapache/queue" packages = ["."] + pruneopts = "NUT" revision = "44cc805cf13205b55f69e14bcb69867d1ae92f98" version = "v1.1.0" [[projects]] + digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756" name = "github.com/ghodss/yaml" packages = ["."] + pruneopts = "NUT" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:b49dd34bdf52d28b69e41181bed939bdf48e1152ef54d21db643e3c50b3b33c0" name = "github.com/go-logr/logr" packages = [ ".", - "testing" + "testing", ] + pruneopts = "NUT" revision = "9fb12b3b21c5415d16ac18dc5cd42c1cfdd40c4e" [[projects]] branch = "master" + digest = "1:340497a512995aa69c0add901d79a2096b3449d35a44a6f1f1115091a9f8c687" name = "github.com/go-logr/zapr" packages = ["."] + pruneopts = "NUT" revision = "7536572e8d55209135cd5e7ccf7fce43dca217ab" [[projects]] + digest = "1:1b3dd24f14a5280710fc7a3aa2480b6e4d20fdfc905841de9a3aa2aa2f1d4ee9" name = "github.com/gogo/protobuf" packages = [ "proto", - "sortkeys" + "sortkeys", ] + pruneopts = "NUT" revision = "1adfc126b41513cc696b209667c8656ea7aac67c" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:e2b86e41f3d669fc36b50d31d32d22c8ac656c75aa5ea89717ce7177e134ff2a" name = "github.com/golang/glog" packages = ["."] + pruneopts = "NUT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] branch = "master" + digest = "1:3fb07f8e222402962fa190eb060608b34eddfb64562a18e2167df2de0ece85d8" name = "github.com/golang/groupcache" packages = ["lru"] + pruneopts = "NUT" revision = "24b0969c4cb722950103eed87108c8d291a8df00" [[projects]] + digest = "1:0f7f0d9512487860d967bd31b4a9668316e53630fd71cb57a84ccf97c852df84" name = "github.com/golang/protobuf" packages = [ "proto", @@ -106,97 +135,123 @@ "ptypes/any", "ptypes/duration", "ptypes/empty", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "NUT" revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:7f114b78210bf5b75f307fc97cff293633c835bab1e0ea8a744a44b39c042dfe" name = "github.com/golang/snappy" packages = ["."] + pruneopts = "NUT" revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a" [[projects]] + digest = "1:d2754cafcab0d22c13541618a8029a70a8959eb3525ff201fe971637e2274cd0" name = "github.com/google/go-cmp" packages = [ "cmp", "cmp/cmpopts", "cmp/internal/diff", "cmp/internal/function", - "cmp/internal/value" + "cmp/internal/value", ] + pruneopts = "NUT" revision = "3af367b6b30c263d47e8895973edcca9a49cf029" version = "v0.2.0" [[projects]] + digest = "1:51bee9f1987dcdb9f9a1b4c20745d78f6bf6f5f14ad4e64ca883eb64df4c0045" name = "github.com/google/go-github" packages = ["github"] + pruneopts = "NUT" revision = "e48060a28fac52d0f1cb758bc8b87c07bac4a87d" version = "v15.0.0" [[projects]] branch = "master" + digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690" name = "github.com/google/go-querystring" packages = ["query"] + pruneopts = "NUT" revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a" [[projects]] branch = "master" + digest = "1:52c5834e2bebac9030c97cc0798ac11c3aa8a39f098aeb419f142533da6cd3cc" name = "github.com/google/gofuzz" packages = ["."] + pruneopts = "NUT" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] + digest = "1:1bb197a3b5db4e06e00b7560f8e89836c486627f2a0338332ed37daa003d259e" name = "github.com/google/uuid" packages = ["."] + pruneopts = "NUT" revision = "064e2069ce9c359c118179501254f67d7d37ba24" version = "0.2" [[projects]] + digest = "1:fe852c57b4fc4d11e6ef79bce1e930ee2f2f7d148b370afef8f8d012a80960ea" name = "github.com/googleapis/gax-go" packages = ["."] + pruneopts = "NUT" revision = "317e0006254c44a0ac427cc52a0e083ff0b9622f" version = "v2.0.0" [[projects]] + digest = "1:06a7dadb7b760767341ffb6c8d377238d68a1226f2b21b5d497d2e3f6ecf6b4e" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions" + "extensions", ] + pruneopts = "NUT" revision = "7c663266750e7d82587642f65e60bc4083f1f84e" version = "v0.2.0" [[projects]] branch = "master" + digest = "1:13e2fa5735a82a5fb044f290cfd0dba633d1c5e516b27da0509e0dbb3515a18e" name = "github.com/hashicorp/golang-lru" packages = [ ".", - "simplelru" + "simplelru", ] + pruneopts = "NUT" revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" [[projects]] branch = "master" + digest = "1:b7f860847a1d71f925ba9385ed95f1ebc0abfeb418a78e219ab61f48fdfeffad" name = "github.com/howeyc/gopass" packages = ["."] + pruneopts = "NUT" revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8" [[projects]] + digest = "1:f0818bc212054788d1086e015b5ba32d01ef8e12c615bbb625570eefbe684a1e" name = "github.com/imdario/mergo" packages = ["."] + pruneopts = "NUT" revision = "9d5f1277e9a8ed20c3684bda8fde67c05628518c" version = "v0.3.4" [[projects]] + digest = "1:42c47ace7ccb114261ef7e0d418d274921514ab50a3bf6bdb9e51c3dde8ce13d" name = "github.com/json-iterator/go" packages = ["."] + pruneopts = "NUT" revision = "ca39e5af3ece67bbcda3d0f4f56a8e24d9f2dad4" version = "1.1.3" [[projects]] + digest = "1:c19f87a341b72c2121456397006116f9496006d62722315e43940e7d42744672" name = "github.com/knative/pkg" packages = [ "apis", @@ -212,91 +267,115 @@ "client/listers/istio/v1alpha3", "configmap", "logging", - "logging/logkey" + "logging/logkey", ] + pruneopts = "NUT" revision = "a088fee6227f7c6842ce7f7406cb75af8a6e0643" [[projects]] branch = "master" + digest = "1:0e9bfc47ab9941ecc3344e580baca5deb4091177e84dd9773b48b38ec26b93d5" name = "github.com/mattbaird/jsonpatch" packages = ["."] + pruneopts = "NUT" revision = "81af80346b1a01caae0cbc27fd3c1ba5b11e189f" [[projects]] + digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "NUT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] + digest = "1:2f42fa12d6911c7b7659738758631bec870b7e9b4c6be5444f963cdcfccc191f" name = "github.com/modern-go/concurrent" packages = ["."] + pruneopts = "NUT" revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" version = "1.0.3" [[projects]] + digest = "1:314a5881fab303a80d6d2e35a77000f2224bb50f09ef63a9aa4c1f9eaef985d8" name = "github.com/modern-go/reflect2" packages = ["."] + pruneopts = "NUT" revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f" version = "1.0.0" [[projects]] + digest = "1:43830c167ef48755903a1bb81e37f73b8f522c5fbecc80f269e2e25d741aa8ee" name = "github.com/pierrec/lz4" packages = [ ".", - "internal/xxh32" + "internal/xxh32", ] + pruneopts = "NUT" revision = "6b9367c9ff401dbc54fabce3fb8d972e799b702d" version = "v2.0.2" [[projects]] + digest = "1:03bca087b180bf24c4f9060775f137775550a0834e18f0bca0520a868679dbd7" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "NUT" revision = "c5b7fccd204277076155f10851dad72b76a49317" version = "v0.8.0" [[projects]] branch = "master" + digest = "1:32d10bdfa8f09ecf13598324dba86ab891f11db3c538b6a34d1c3b5b99d7c36b" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "NUT" revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" [[projects]] branch = "master" + digest = "1:768b555b86742de2f28beb37f1dedce9a75f91f871d75b5717c96399c1a78c08" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "NUT" revision = "7600349dcfe1abd18d72d3a1770870d9800a7801" [[projects]] branch = "master" + digest = "1:c4a213a8d73fbb0b13f717ba7996116602ef18ecb42b91d77405877914cb0349" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs" + "xfs", ] + pruneopts = "NUT" revision = "94663424ae5ae9856b40a9f170762b4197024661" [[projects]] branch = "master" + digest = "1:7c522337040d4ec9a136cd9d64fe4677ee1d3eae4a7f8831c2108f9bec43fa48" name = "github.com/rcrowley/go-metrics" packages = ["."] + pruneopts = "NUT" revision = "e2704e165165ec55d062f5919b4b29494e9fa790" [[projects]] + digest = "1:15e5c398fbd9d2c439b635a08ac161b13d04f0c2aa587fe256b65dc0c3efe8b7" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "NUT" revision = "583c0c0531f06d5278b7d917446061adc344b5cd" [[projects]] + digest = "1:773b6907f497ea5abddc9ee90cdde179b119c0c8a04b0f02cb2fff955ed8cab4" name = "go.opencensus.io" packages = [ "exporter/stackdriver/propagation", @@ -311,24 +390,30 @@ "tag", "trace", "trace/internal", - "trace/propagation" + "trace/propagation", ] + pruneopts = "NUT" revision = "c3ed530f775d85e577ca652cb052a52c078aad26" version = "v0.11.0" [[projects]] + digest = "1:22f696cee54865fb8e9ff91df7b633f6b8f22037a8015253c6b6a71ca82219c7" name = "go.uber.org/atomic" packages = ["."] + pruneopts = "NUT" revision = "1ea20fb1cbb1cc08cbd0d913a96dead89aa18289" version = "v1.3.2" [[projects]] + digest = "1:58ca93bdf81bac106ded02226b5395a0595d5346cdc4caa8d9c1f3a5f8f9976e" name = "go.uber.org/multierr" packages = ["."] + pruneopts = "NUT" revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a" version = "v1.1.0" [[projects]] + digest = "1:25531f2a1f9e75b832a945c670bf84f8caf5bd0fe8d8ad5bab5f13e162680922" name = "go.uber.org/zap" packages = [ ".", @@ -336,19 +421,23 @@ "internal/bufferpool", "internal/color", "internal/exit", - "zapcore" + "zapcore", ] + pruneopts = "NUT" revision = "eeedf312bc6c57391d84767a4cd413f02a917974" version = "v1.8.0" [[projects]] branch = "master" + digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8" name = "golang.org/x/crypto" packages = ["ssh/terminal"] + pruneopts = "NUT" revision = "5ba7f63082460102a45837dbd1827e10f9479ac0" [[projects]] branch = "master" + digest = "1:7e7c436f75db05dc112521a34811f383e5656abd083f678c5a6df2bf42ea6b2c" name = "golang.org/x/net" packages = [ "context", @@ -358,40 +447,48 @@ "http2/hpack", "idna", "internal/timeseries", - "trace" + "trace", ] + pruneopts = "NUT" revision = "1e491301e022f8f977054da4c2d852decd59571f" [[projects]] + digest = "1:46bd4e66bfce5e77f08fc2e8dcacc3676e679241ce83d9c150ff0397d686dd44" name = "golang.org/x/oauth2" packages = [ ".", "google", "internal", "jws", - "jwt" + "jwt", ] + pruneopts = "NUT" revision = "cdc340f7c179dbbfa4afd43b7614e8fcadde4269" [[projects]] branch = "master" + digest = "1:c313aef534e493304f3666fbd24dca5932ebf776a82b7a40f961c9355794a1b1" name = "golang.org/x/sync" packages = [ "errgroup", - "semaphore" + "semaphore", ] + pruneopts = "NUT" revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca" [[projects]] branch = "master" + digest = "1:0dbe2a3199cde81dd841ea2de1386165f953d227ddb2b5c2c4b591209bf37746" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "NUT" revision = "c11f84a56e43e20a78cee75a7c034031ecf57d1f" [[projects]] + digest = "1:e7071ed636b5422cc51c0e3a6cebc229d6c9fffc528814b519a980641422d619" name = "golang.org/x/text" packages = [ "collate", @@ -407,29 +504,35 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable" + "unicode/rangetable", ] + pruneopts = "NUT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" + digest = "1:c9e7a4b4d47c0ed205d257648b0e5b0440880cb728506e318f8ac7cd36270bc4" name = "golang.org/x/time" packages = ["rate"] + pruneopts = "NUT" revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" [[projects]] branch = "master" + digest = "1:4d63ca26a477869856c95a8a9760a8405686065538bd375d1f1481a8f5528094" name = "golang.org/x/tools" packages = [ "go/ast/astutil", "imports", - "internal/fastwalk" + "internal/fastwalk", ] + pruneopts = "NUT" revision = "a5b4c53f6e8bdcafa95a94671bf2d1203365858b" [[projects]] branch = "master" + digest = "1:cbb9ee36efb225152642c14192700636ae231d632315179129d79d2b6391acf9" name = "google.golang.org/api" packages = [ "googleapi/transport", @@ -439,11 +542,13 @@ "support/bundler", "transport", "transport/grpc", - "transport/http" + "transport/http", ] + pruneopts = "NUT" revision = "f71c6d4abd9757df4168c39856698c341d07251f" [[projects]] + digest = "1:626ac4e70ef18262989f8c52503259109e1a2e5580d23aeae0f0e0349819dade" name = "google.golang.org/appengine" packages = [ ".", @@ -457,24 +562,28 @@ "internal/socket", "internal/urlfetch", "socket", - "urlfetch" + "urlfetch", ] + pruneopts = "NUT" revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:94bda8ad0190a989ad7768ce0df06e4c384a8fa7bca1cf0ce63501a4b26fe51e" name = "google.golang.org/genproto" packages = [ "googleapis/api/annotations", "googleapis/iam/v1", "googleapis/pubsub/v1", "googleapis/rpc/status", - "protobuf/field_mask" + "protobuf/field_mask", ] + pruneopts = "NUT" revision = "4065a77fc542a455295382a23a996a08ed18813a" [[projects]] + digest = "1:60d6a8209da1f48bd268d21ea37ddf8936913ee0b35a6eacf741e1bb8791ae5d" name = "google.golang.org/grpc" packages = [ ".", @@ -501,33 +610,41 @@ "stats", "status", "tap", - "transport" + "transport", ] + pruneopts = "NUT" revision = "41344da2231b913fa3d983840a57a6b1b7b631a1" version = "v1.12.0" [[projects]] + digest = "1:c776b8566e3415e9a434756ea1d3b96a3059be221555ff177666ba9edb2a38b5" name = "gopkg.in/go-playground/webhooks.v3" packages = [ ".", - "github" + "github", ] + pruneopts = "NUT" revision = "be944ed461fc75c52f0f149acfa011f8da721f6c" version = "v3.12.0" [[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] + pruneopts = "NUT" revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" [[projects]] + digest = "1:7c95b35057a0ff2e19f707173cc1a947fa43a6eb5c4d300d196ece0334046082" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "NUT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [[projects]] + digest = "1:0659b0574935676d47594a451ac1c472ad592296a92202019c0f016d53f89bf5" name = "k8s.io/api" packages = [ "admission/v1beta1", @@ -558,12 +675,14 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1" + "storage/v1beta1", ] + pruneopts = "NUT" revision = "73d903622b7391f3312dcbac6483fed484e185f8" version = "kubernetes-1.10.1" [[projects]] + digest = "1:38b6fedbef5c591d5941e366f7c6abc954fdd6cb0b96e12c58996f54fb0f92c1" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", @@ -610,12 +729,14 @@ "pkg/version", "pkg/watch", "third_party/forked/golang/json", - "third_party/forked/golang/reflect" + "third_party/forked/golang/reflect", ] + pruneopts = "NUT" revision = "302974c03f7e50f16561ba237db776ab93594ef6" version = "kubernetes-1.10.1" [[projects]] + digest = "1:494ed2ae65a396fc7989a7179e98a64779b87433d3f1503f59083b6268331882" name = "k8s.io/client-go" packages = [ "discovery", @@ -771,12 +892,14 @@ "util/integer", "util/jsonpath", "util/retry", - "util/workqueue" + "util/workqueue", ] + pruneopts = "NUT" revision = "989be4278f353e42f26c416c53757d16fcff77db" version = "kubernetes-1.10.1" [[projects]] + digest = "1:b6d40560bfc8ef1300dbec6fae898810b59f26b1fd62d16692ab9befe8694dfc" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -797,13 +920,15 @@ "cmd/lister-gen", "cmd/lister-gen/args", "cmd/lister-gen/generators", - "pkg/util" + "pkg/util", ] + pruneopts = "T" revision = "7ead8f38b01cf8653249f5af80ce7b2c8aba12e2" version = "kubernetes-1.10.1" [[projects]] branch = "master" + digest = "1:75bc1fa71433a3ccb40c20f960ee2dbea05f9f10dbb0d91d3cb53a4ec6a709b7" name = "k8s.io/gengo" packages = [ "args", @@ -813,18 +938,22 @@ "generator", "namer", "parser", - "types" + "types", ] + pruneopts = "NUT" revision = "2e1a79edcaecf0bfbde129a1fd55624b66adb699" [[projects]] branch = "master" + digest = "1:a2c842a1e0aed96fd732b535514556323a6f5edfded3b63e5e0ab1bce188aa54" name = "k8s.io/kube-openapi" packages = ["pkg/util/proto"] + pruneopts = "NUT" revision = "8a9b82f00b3a86eac24681da3f9fe6c34c01cea2" [[projects]] branch = "master" + digest = "1:0636bd706086f089dffeb6ea9a6e6a5079da1820943367949e4e477b7f94355c" name = "sigs.k8s.io/controller-runtime" packages = [ "pkg/cache", @@ -846,13 +975,102 @@ "pkg/runtime/log", "pkg/runtime/signals", "pkg/source", - "pkg/source/internal" + "pkg/source/internal", ] + pruneopts = "NUT" revision = "f5b79b93f3aa7b978117f942f3cd67a91db12207" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "56aa94746c11a53bad64aefaa06bb0223f08f111bb8030ebc1a9ae4f1b3d7141" + input-imports = [ + "cloud.google.com/go/pubsub", + "github.com/Shopify/sarama", + "github.com/bsm/sarama-cluster", + "github.com/davecgh/go-spew/spew", + "github.com/golang/glog", + "github.com/google/go-cmp/cmp", + "github.com/google/go-cmp/cmp/cmpopts", + "github.com/google/go-github/github", + "github.com/google/uuid", + "github.com/knative/pkg/apis", + "github.com/knative/pkg/apis/istio/v1alpha3", + "github.com/knative/pkg/client/clientset/versioned", + "github.com/knative/pkg/client/informers/externalversions", + "github.com/knative/pkg/client/listers/istio/v1alpha3", + "github.com/knative/pkg/configmap", + "github.com/knative/pkg/logging", + "github.com/knative/pkg/logging/logkey", + "github.com/mattbaird/jsonpatch", + "github.com/prometheus/client_golang/prometheus/promhttp", + "go.uber.org/zap", + "golang.org/x/net/context", + "golang.org/x/oauth2", + "google.golang.org/grpc/codes", + "google.golang.org/grpc/status", + "gopkg.in/go-playground/webhooks.v3", + "gopkg.in/go-playground/webhooks.v3/github", + "gopkg.in/yaml.v2", + "k8s.io/api/admission/v1beta1", + "k8s.io/api/admissionregistration/v1beta1", + "k8s.io/api/apps/v1", + "k8s.io/api/batch/v1", + "k8s.io/api/core/v1", + "k8s.io/api/extensions/v1beta1", + "k8s.io/api/rbac/v1beta1", + "k8s.io/apimachinery/pkg/api/equality", + "k8s.io/apimachinery/pkg/api/errors", + "k8s.io/apimachinery/pkg/api/meta", + "k8s.io/apimachinery/pkg/apimachinery/registered", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/labels", + "k8s.io/apimachinery/pkg/runtime", + "k8s.io/apimachinery/pkg/runtime/schema", + "k8s.io/apimachinery/pkg/runtime/serializer", + "k8s.io/apimachinery/pkg/types", + "k8s.io/apimachinery/pkg/util/intstr", + "k8s.io/apimachinery/pkg/util/runtime", + "k8s.io/apimachinery/pkg/util/sets", + "k8s.io/apimachinery/pkg/util/sets/types", + "k8s.io/apimachinery/pkg/util/validation", + "k8s.io/apimachinery/pkg/util/wait", + "k8s.io/apimachinery/pkg/watch", + "k8s.io/client-go/discovery", + "k8s.io/client-go/discovery/fake", + "k8s.io/client-go/dynamic", + "k8s.io/client-go/informers", + "k8s.io/client-go/informers/core/v1", + "k8s.io/client-go/kubernetes", + "k8s.io/client-go/kubernetes/fake", + "k8s.io/client-go/kubernetes/scheme", + "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", + "k8s.io/client-go/kubernetes/typed/core/v1", + "k8s.io/client-go/listers/apps/v1", + "k8s.io/client-go/listers/core/v1", + "k8s.io/client-go/listers/rbac/v1beta1", + "k8s.io/client-go/plugin/pkg/client/auth/gcp", + "k8s.io/client-go/rest", + "k8s.io/client-go/testing", + "k8s.io/client-go/tools/cache", + "k8s.io/client-go/tools/clientcmd", + "k8s.io/client-go/tools/record", + "k8s.io/client-go/util/flowcontrol", + "k8s.io/client-go/util/workqueue", + "k8s.io/code-generator/cmd/client-gen", + "k8s.io/code-generator/cmd/deepcopy-gen", + "k8s.io/code-generator/cmd/defaulter-gen", + "k8s.io/code-generator/cmd/informer-gen", + "k8s.io/code-generator/cmd/lister-gen", + "sigs.k8s.io/controller-runtime/pkg/client", + "sigs.k8s.io/controller-runtime/pkg/client/config", + "sigs.k8s.io/controller-runtime/pkg/client/fake", + "sigs.k8s.io/controller-runtime/pkg/controller", + "sigs.k8s.io/controller-runtime/pkg/handler", + "sigs.k8s.io/controller-runtime/pkg/manager", + "sigs.k8s.io/controller-runtime/pkg/reconcile", + "sigs.k8s.io/controller-runtime/pkg/runtime/log", + "sigs.k8s.io/controller-runtime/pkg/runtime/signals", + "sigs.k8s.io/controller-runtime/pkg/source", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/pkg/apis/channels/v1alpha1/bus_defaults.go b/pkg/apis/channels/v1alpha1/bus_defaults.go new file mode 100644 index 00000000000..d28033a3cc8 --- /dev/null +++ b/pkg/apis/channels/v1alpha1/bus_defaults.go @@ -0,0 +1,33 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +// TODO(n3wscott): This is staging work, the plan is another pass to bring up +// the test coverage, then remove unused after each type is stubbed. +// This is all prep for new serving style webhook integration. + +func (b *Bus) SetDefaults() { + b.Spec.SetDefaults() +} + +func (bs *BusSpec) SetDefaults() { + bs.Parameters.SetDefaults() +} + +func (bp *BusParameters) SetDefaults() { + // TODO anything? +} diff --git a/pkg/apis/channels/v1alpha1/bus_types.go b/pkg/apis/channels/v1alpha1/bus_types.go index e743b1de4f3..bd4f142ab66 100644 --- a/pkg/apis/channels/v1alpha1/bus_types.go +++ b/pkg/apis/channels/v1alpha1/bus_types.go @@ -19,6 +19,7 @@ package v1alpha1 import ( "encoding/json" + "github.com/knative/pkg/apis" kapi "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -145,4 +146,9 @@ type GenericBus interface { meta_v1.ObjectMetaAccessor BacksChannel(channel *Channel) bool GetSpec() *BusSpec + + // Needed for generic webhook support + apis.Defaultable + apis.Immutable + apis.Validatable } diff --git a/pkg/apis/channels/v1alpha1/bus_validation.go b/pkg/apis/channels/v1alpha1/bus_validation.go new file mode 100644 index 00000000000..66fd785f9d0 --- /dev/null +++ b/pkg/apis/channels/v1alpha1/bus_validation.go @@ -0,0 +1,63 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "fmt" + "github.com/knative/pkg/apis" + "k8s.io/apimachinery/pkg/util/validation" +) + +// TODO(n3wscott): This is staging work, the plan is another pass to bring up +// the test coverage, then remove unused after each type is stubbed. +// This is all prep for new serving style webhook integration. + +func (b *Bus) Validate() *apis.FieldError { + return b.Spec.Validate().ViaField("spec") +} + +func (bs *BusSpec) Validate() *apis.FieldError { + if bs.Parameters != nil { + return bs.Parameters.Validate().ViaField("parameters") + } + return nil +} + +func (bp *BusParameters) Validate() *apis.FieldError { + if bp.Channel != nil { + for i, p := range *bp.Channel { + errs := validation.IsConfigMapKey(p.Name) + if len(errs) > 0 { + return apis.ErrInvalidKeyName(p.Name, "name", errs...).ViaField(fmt.Sprintf("channel[%d]", i)) + } + } + } + if bp.Subscription != nil { + for i, p := range *bp.Subscription { + errs := validation.IsConfigMapKey(p.Name) + if len(errs) > 0 { + return apis.ErrInvalidKeyName(p.Name, "name", errs...).ViaField(fmt.Sprintf("subscription[%d]", i)) + } + } + } + return nil +} + +func (current *Bus) CheckImmutableFields(og apis.Immutable) *apis.FieldError { + // TODO(n3wscott): Anything to check? + return nil +} diff --git a/pkg/apis/channels/v1alpha1/bus_validation_test.go b/pkg/apis/channels/v1alpha1/bus_validation_test.go new file mode 100644 index 00000000000..fc0bc02ef74 --- /dev/null +++ b/pkg/apis/channels/v1alpha1/bus_validation_test.go @@ -0,0 +1,140 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "fmt" + "github.com/google/go-cmp/cmp" + "github.com/knative/pkg/apis" + "strings" + "testing" +) + +var longName = strings.Repeat("A", 255) + +// TODO: add the following tests: +// 1. Multiple parameters to the same Bus. +// 2. Two parameters with the same Name in the same list. +// 3. Multiple errors in the same object. + +func TestBusSpecValidation(t *testing.T) { + tests := []struct { + name string + bs *BusSpec + want *apis.FieldError + }{{ + name: "valid", + bs: &BusSpec{ + Parameters: &BusParameters{ + Channel: &[]Parameter{ + { + Name: "foo", + Description: "bar", + }, + }, + Subscription: &[]Parameter{ + { + Name: "foo", + Description: "bar", + }, + }, + }, + }, + }, { + name: "valid no description", + bs: &BusSpec{ + Parameters: &BusParameters{ + Channel: &[]Parameter{ + { + Name: "foo", + }, + }, + Subscription: &[]Parameter{ + { + Name: "foo", + }, + }, + }, + }, + }, { + name: "invalid channel parameter", + bs: &BusSpec{ + Parameters: &BusParameters{ + Channel: &[]Parameter{ + { + Name: "foo@bar", + }, + }, + }, + }, + want: &apis.FieldError{ + Message: `invalid key name "foo@bar"`, + Paths: []string{ + "parameters.channel[0].name", + }, + Details: "a valid config key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name', or 'KEY_NAME', or 'key-name', regex used for validation is '[-._a-zA-Z0-9]+')", + }, + }, { + name: "invalid subscription parameter", + bs: &BusSpec{ + Parameters: &BusParameters{ + Subscription: &[]Parameter{ + { + Name: "foo@bar", + }, + }, + }, + }, + want: &apis.FieldError{ + Message: `invalid key name "foo@bar"`, + Paths: []string{ + "parameters.subscription[0].name", + }, + Details: "a valid config key must consist of alphanumeric characters, '-', '_' or '.' (e.g. 'key.name', or 'KEY_NAME', or 'key-name', regex used for validation is '[-._a-zA-Z0-9]+')", + }, + }, { + name: "invalid channel too long", + bs: &BusSpec{ + Parameters: &BusParameters{ + Channel: &[]Parameter{ + { + Name: longName, + }, + }, + }, + }, + want: &apis.FieldError{ + Message: fmt.Sprintf("invalid key name %q", longName), + Paths: []string{ + "parameters.channel[0].name", + }, + Details: "must be no more than 253 characters", + }, + }, { + name: "empty bus", + bs: &BusSpec{}, + }} + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + got := test.bs.Validate() + if diff := cmp.Diff(test.want, got); diff != "" { + t.Errorf("validateBus (-want, +got) = %v", diff) + } + }) + } +} diff --git a/pkg/apis/channels/v1alpha1/clusterbus_defaults.go b/pkg/apis/channels/v1alpha1/clusterbus_defaults.go new file mode 100644 index 00000000000..2dad3ce2327 --- /dev/null +++ b/pkg/apis/channels/v1alpha1/clusterbus_defaults.go @@ -0,0 +1,21 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +func (b *ClusterBus) SetDefaults() { + b.Spec.SetDefaults() +} diff --git a/pkg/apis/channels/v1alpha1/clusterbus_validation.go b/pkg/apis/channels/v1alpha1/clusterbus_validation.go new file mode 100644 index 00000000000..2d95941948b --- /dev/null +++ b/pkg/apis/channels/v1alpha1/clusterbus_validation.go @@ -0,0 +1,30 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "github.com/knative/pkg/apis" +) + +func (b *ClusterBus) Validate() *apis.FieldError { + return b.Spec.Validate().ViaField("spec") +} + +func (current *ClusterBus) CheckImmutableFields(og apis.Immutable) *apis.FieldError { + // TODO(n3wscott): Anything to check? + return nil +} diff --git a/pkg/webhook/bus.go b/pkg/webhook/bus.go index 525b7660b82..cb0d0ca9adf 100644 --- a/pkg/webhook/bus.go +++ b/pkg/webhook/bus.go @@ -19,13 +19,10 @@ package webhook import ( "context" "errors" - "fmt" - "strings" "github.com/golang/glog" "github.com/knative/eventing/pkg/apis/channels/v1alpha1" "github.com/mattbaird/jsonpatch" - "k8s.io/apimachinery/pkg/util/validation" ) var ( @@ -46,25 +43,11 @@ func ValidateBus(ctx context.Context) ResourceCallback { } func validateBus(old, new v1alpha1.GenericBus) error { - if new.GetSpec().Parameters != nil { - if new.GetSpec().Parameters.Channel != nil { - for _, p := range *new.GetSpec().Parameters.Channel { - errs := validation.IsConfigMapKey(p.Name) - if len(errs) > 0 { - return fmt.Errorf("invalid parameter name Spec.Parameters.Channel.%s: %s", p.Name, - strings.Join(errs, ", ")) - } - } - } - if new.GetSpec().Parameters.Subscription != nil { - for _, p := range *new.GetSpec().Parameters.Subscription { - errs := validation.IsConfigMapKey(p.Name) - if len(errs) > 0 { - return fmt.Errorf("invalid parameter name Spec.Parameters.Subscription.%s: %s", p.Name, - strings.Join(errs, ", ")) - } - } - } + if err := new.Validate(); err != nil { + return err + } + if err := new.CheckImmutableFields(old); err != nil { + return err } return nil } diff --git a/pkg/webhook/webhook_channels_test.go b/pkg/webhook/webhook_channels_test.go index 9f8bf6967c2..5b93d9da7ef 100644 --- a/pkg/webhook/webhook_channels_test.go +++ b/pkg/webhook/webhook_channels_test.go @@ -75,7 +75,7 @@ func TestInvalidBusParameterNameFails(t *testing.T) { t.Fatalf("Failed to marshal bus: %s", err) } req.Object.Raw = marshaled - expectFailsWith(t, ac.admit(testCtx, req), "invalid parameter name Spec.Parameters.Subscription.paramètre") + expectFailsWith(t, ac.admit(testCtx, req), `invalid key name "paramètre": spec.parameters.subscription[0].name`) invalidName = "param/name" bus = createBus(testBusName, "foobar/dispatcher") @@ -85,7 +85,7 @@ func TestInvalidBusParameterNameFails(t *testing.T) { t.Fatalf("Failed to marshal bus: %s", err) } req.Object.Raw = marshaled - expectFailsWith(t, ac.admit(testCtx, req), "invalid parameter name Spec.Parameters.Channel.param/name") + expectFailsWith(t, ac.admit(testCtx, req), `invalid key name "param/name": spec.parameters.channel[0].name`) } func TestInvalidClusterBusParameterNameFails(t *testing.T) { @@ -102,7 +102,7 @@ func TestInvalidClusterBusParameterNameFails(t *testing.T) { t.Fatalf("Failed to marshal bus: %s", err) } req.Object.Raw = marshaled - expectFailsWith(t, ac.admit(testCtx, req), "invalid parameter name Spec.Parameters.Subscription.paramètre") + expectFailsWith(t, ac.admit(testCtx, req), `invalid key name "paramètre": spec.parameters.subscription[0].name`) invalidName = "param/name" bus = createClusterBus(testBusName, "foobar/dispatcher") @@ -112,7 +112,7 @@ func TestInvalidClusterBusParameterNameFails(t *testing.T) { t.Fatalf("Failed to marshal bus: %s", err) } req.Object.Raw = marshaled - expectFailsWith(t, ac.admit(testCtx, req), "invalid parameter name Spec.Parameters.Channel.param/name") + expectFailsWith(t, ac.admit(testCtx, req), `invalid key name "param/name": spec.parameters.channel[0].name`) } func TestInvalidNewChannelNameFails(t *testing.T) {