From 22e321a5846cc13c865699be9d6cd5307246e114 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Mon, 17 Jun 2019 10:48:12 +0800 Subject: [PATCH 1/3] Update vendors --- vendor.conf | 1 + vendor/github.com/knative/pkg/.gitattributes | 10 + vendor/github.com/knative/pkg/.gitignore | 11 + vendor/github.com/knative/pkg/CONTRIBUTING.md | 5 + vendor/github.com/knative/pkg/DEVELOPMENT.md | 71 + vendor/github.com/knative/pkg/Gopkg.lock | 1164 +++++++++++++++ vendor/github.com/knative/pkg/Gopkg.toml | 74 + vendor/github.com/knative/pkg/LICENSE | 201 +++ vendor/github.com/knative/pkg/OWNERS | 6 + vendor/github.com/knative/pkg/README.md | 13 + vendor/github.com/knative/pkg/apis/OWNERS | 6 + .../github.com/knative/pkg/apis/istio/OWNERS | 4 + .../pkg/apis/istio/common/v1alpha1/string.go | 35 + .../knative/pkg/apis/istio/register.go | 21 + .../knative/pkg/apis/istio/v1alpha3/README.md | 17 + .../istio/v1alpha3/destinationrule_types.go | 547 +++++++ .../knative/pkg/apis/istio/v1alpha3/doc.go | 23 + .../pkg/apis/istio/v1alpha3/gateway_types.go | 336 +++++ .../pkg/apis/istio/v1alpha3/register.go | 58 + .../pkg/apis/istio/v1alpha3/service_entry.go | 39 + .../istio/v1alpha3/virtualservice_types.go | 882 +++++++++++ .../istio/v1alpha3/zz_generated.deepcopy.go | 1287 +++++++++++++++++ .../github.com/knative/pkg/code-of-conduct.md | 75 + 23 files changed, 4886 insertions(+) create mode 100644 vendor/github.com/knative/pkg/.gitattributes create mode 100644 vendor/github.com/knative/pkg/.gitignore create mode 100644 vendor/github.com/knative/pkg/CONTRIBUTING.md create mode 100644 vendor/github.com/knative/pkg/DEVELOPMENT.md create mode 100644 vendor/github.com/knative/pkg/Gopkg.lock create mode 100644 vendor/github.com/knative/pkg/Gopkg.toml create mode 100644 vendor/github.com/knative/pkg/LICENSE create mode 100644 vendor/github.com/knative/pkg/OWNERS create mode 100644 vendor/github.com/knative/pkg/README.md create mode 100644 vendor/github.com/knative/pkg/apis/OWNERS create mode 100644 vendor/github.com/knative/pkg/apis/istio/OWNERS create mode 100644 vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/register.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/service_entry.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go create mode 100644 vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go create mode 100644 vendor/github.com/knative/pkg/code-of-conduct.md diff --git a/vendor.conf b/vendor.conf index 85785139..c9b795ba 100644 --- a/vendor.conf +++ b/vendor.conf @@ -4,3 +4,4 @@ github.com/rancher/types github.com/pkg/errors v0.8.0 github.com/rancher/norman 2da1bd2ffcacdef4bdf7e2c193d32f3b04ebd6d0 transitive=true github.com/coreos/prometheus-operator v0.25.0 +github.com/knative/pkg b30ab9de040eb4ba56fdb4108a29045ecac0c46a https://github.com/rancher/pkg.git diff --git a/vendor/github.com/knative/pkg/.gitattributes b/vendor/github.com/knative/pkg/.gitattributes new file mode 100644 index 00000000..95f18a11 --- /dev/null +++ b/vendor/github.com/knative/pkg/.gitattributes @@ -0,0 +1,10 @@ +# This file is documented at https://git-scm.com/docs/gitattributes. +# Linguist-specific attributes are documented at +# https://github.com/github/linguist. + +**/zz_generated.*.go linguist-generated=true +/client/** linguist-generated=true +/test/** coverage-excluded=true +/metrics/gcp_metadata.go coverage-excluded=true + +*.sh text eol=lf diff --git a/vendor/github.com/knative/pkg/.gitignore b/vendor/github.com/knative/pkg/.gitignore new file mode 100644 index 00000000..85baa82a --- /dev/null +++ b/vendor/github.com/knative/pkg/.gitignore @@ -0,0 +1,11 @@ +# Operating system temporary files +.DS_Store + +# Editor/IDE specific settings +.idea +.vscode/ +*.iml + +# Temporary output of build tools +bazel-* +*.out diff --git a/vendor/github.com/knative/pkg/CONTRIBUTING.md b/vendor/github.com/knative/pkg/CONTRIBUTING.md new file mode 100644 index 00000000..16eddb0a --- /dev/null +++ b/vendor/github.com/knative/pkg/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contribution guidelines + +So you want to hack on Knative `pkg`? Yay! Please refer to Knative's overall +[contribution guidelines](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md) +to find out how you can help. diff --git a/vendor/github.com/knative/pkg/DEVELOPMENT.md b/vendor/github.com/knative/pkg/DEVELOPMENT.md new file mode 100644 index 00000000..31565202 --- /dev/null +++ b/vendor/github.com/knative/pkg/DEVELOPMENT.md @@ -0,0 +1,71 @@ +# Development + +This doc explains how to setup a development environment so you can get started +[contributing](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md) +to Knative `pkg`. Also take a look at: + +- [The pull request workflow](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md#pull-requests) + +## Getting started + +1. Create [a GitHub account](https://github.com/join) +1. Setup + [GitHub access via SSH](https://help.github.com/articles/connecting-to-github-with-ssh/) +1. Install [requirements](#requirements) +1. Set up your [shell environment](#environment-setup) +1. [Create and checkout a repo fork](#checkout-your-fork) + +Before submitting a PR, see also [CONTRIBUTING.md](./CONTRIBUTING.md). + +### Requirements + +You must install these tools: + +1. [`go`](https://golang.org/doc/install): The language Knative `pkg` is built + in +1. [`git`](https://help.github.com/articles/set-up-git/): For source control +1. [`dep`](https://github.com/golang/dep): For managing external dependencies. + +### Environment setup + +To get started you'll need to set these environment variables (we recommend +adding them to your `.bashrc`): + +1. `GOPATH`: If you don't have one, simply pick a directory and add + `export GOPATH=...` +1. `$GOPATH/bin` on `PATH`: This is so that tooling installed via `go get` will + work properly. + +`.bashrc` example: + +```shell +export GOPATH="$HOME/go" +export PATH="${PATH}:${GOPATH}/bin" +``` + +### Checkout your fork + +The Go tools require that you clone the repository to the +`src/github.com/knative/pkg` directory in your +[`GOPATH`](https://github.com/golang/go/wiki/SettingGOPATH). + +To check out this repository: + +1. Create your own + [fork of this repo](https://help.github.com/articles/fork-a-repo/) +1. Clone it to your machine: + +```shell +mkdir -p ${GOPATH}/src/github.com/knative +cd ${GOPATH}/src/github.com/knative +git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git +cd pkg +git remote add upstream git@github.com:knative/pkg.git +git remote set-url --push upstream no_push +``` + +_Adding the `upstream` remote sets you up nicely for regularly +[syncing your fork](https://help.github.com/articles/syncing-a-fork/)._ + +Once you reach this point you are ready to do a full build and deploy as +described below. diff --git a/vendor/github.com/knative/pkg/Gopkg.lock b/vendor/github.com/knative/pkg/Gopkg.lock new file mode 100644 index 00000000..f07829a5 --- /dev/null +++ b/vendor/github.com/knative/pkg/Gopkg.lock @@ -0,0 +1,1164 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:ef8da480a66d7e8e9819261c3526685601b573e0005e84b75e47548d82021a7d" + name = "cloud.google.com/go" + packages = [ + "compute/metadata", + "container/apiv1", + "internal/version", + "monitoring/apiv3", + "trace/apiv2", + ] + pruneopts = "NUT" + revision = "0ebda48a7f143b1cce9eb37a8c1106ac762a3430" + version = "v0.34.0" + +[[projects]] + digest = "1:43fbf05ea84c860a4e86b557d156b1e72511cd29375d3f71adb522362710aea7" + name = "contrib.go.opencensus.io/exporter/stackdriver" + packages = [ + ".", + "monitoredresource", + ] + pruneopts = "NUT" + revision = "ab5a58af316a529613aadf9f50eeed1b6f044b2f" + version = "v0.9.2" + +[[projects]] + branch = "master" + digest = "1:cef70b547ce62d12ea8e5dcb9905bccb57ea1bb253ee6809fd79a17c29ca3cd5" + name = "contrib.go.opencensus.io/resource" + packages = ["resourcekeys"] + pruneopts = "NUT" + revision = "21591786a5e0c21806209b266cc6dfdfa85b3cdb" + +[[projects]] + digest = "1:4a31397b1b81c6856aab6d2d963a727b4235af18adaaedc2cc51646ae812f683" + name = "github.com/aws/aws-sdk-go" + packages = [ + "aws", + "aws/awserr", + "aws/awsutil", + "aws/client", + "aws/client/metadata", + "aws/corehandlers", + "aws/credentials", + "aws/credentials/ec2rolecreds", + "aws/credentials/endpointcreds", + "aws/credentials/processcreds", + "aws/credentials/stscreds", + "aws/csm", + "aws/defaults", + "aws/ec2metadata", + "aws/endpoints", + "aws/request", + "aws/session", + "aws/signer/v4", + "internal/ini", + "internal/sdkio", + "internal/sdkrand", + "internal/sdkuri", + "internal/shareddefaults", + "private/protocol", + "private/protocol/query", + "private/protocol/query/queryutil", + "private/protocol/rest", + "private/protocol/xml/xmlutil", + "service/sts", + ] + pruneopts = "NUT" + revision = "3991042237b45cf58c9d5f34295942d5533c28c6" + version = "v1.16.11" + +[[projects]] + branch = "master" + digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd" + name = "github.com/beorn7/perks" + packages = ["quantile"] + pruneopts = "NUT" + revision = "3a771d992973f24aa725d07868b467d1ddfceafb" + +[[projects]] + digest = "1:fa965c1fd0f17153f608037e109e62104058bc1d08d44849867795fd306fa8b8" + name = "github.com/census-instrumentation/opencensus-proto" + packages = [ + "gen-go/agent/common/v1", + "gen-go/metrics/v1", + "gen-go/resource/v1", + ] + pruneopts = "NUT" + revision = "7f2434bc10da710debe5c4315ed6d4df454b4024" + version = "v0.1.0" + +[[projects]] + digest = "1:6b21090f60571b20b3ddc2c8e48547dffcf409498ed6002c2cada023725ed377" + name = "github.com/davecgh/go-spew" + packages = ["spew"] + pruneopts = "NUT" + revision = "782f4967f2dc4564575ca782fe2d04090b5faca8" + +[[projects]] + digest = "1:32598368f409bbee79deb9d43569fcd92b9fb27f39155f5e166b3371217f051f" + name = "github.com/evanphx/json-patch" + packages = ["."] + pruneopts = "NUT" + revision = "72bf35d0ff611848c1dc9df0f976c81192392fa5" + version = "v4.1.0" + +[[projects]] + digest = "1:abfe129dc92b16fbf0cc9d6336096a2823151756f62072a700eb10754141b38e" + name = "github.com/ghodss/yaml" + packages = ["."] + pruneopts = "NUT" + revision = "73d445a93680fa1a78ae23a5839bad48f32ba1ee" + +[[projects]] + digest = "1:373397317168dd5ac00efda13940668f1947fd641f572b9cf386a86a99c63ca9" + name = "github.com/gobuffalo/envy" + packages = ["."] + pruneopts = "NUT" + revision = "801d7253ade1f895f74596b9a96147ed2d3b087e" + version = "v1.6.11" + +[[projects]] + digest = "1:a6afc27b2a73a5506832f3c5a1c19a30772cb69e7bd1ced4639eb36a55db224f" + name = "github.com/gogo/protobuf" + packages = [ + "proto", + "sortkeys", + ] + pruneopts = "NUT" + revision = "c0656edd0d9eab7c66d1eb0c568f9039345796f7" + +[[projects]] + digest = "1:78b8040ece2ff622580def2708b9eb0b2857711b6744c475439bf337e9c677ea" + name = "github.com/golang/glog" + packages = ["."] + pruneopts = "NUT" + revision = "44145f04b68cf362d9c4df2182967c2275eaefed" + +[[projects]] + branch = "master" + digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8" + name = "github.com/golang/groupcache" + packages = ["lru"] + pruneopts = "NUT" + revision = "5b532d6fd5efaf7fa130d4e859a2fde0fc3a9e1b" + +[[projects]] + digest = "1:4dacf728c83400b3e9d1d3025dd3c1e93e9a1b033726d1b193dc209f3fa9cb7a" + name = "github.com/golang/protobuf" + packages = [ + "proto", + "protoc-gen-go/descriptor", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/empty", + "ptypes/struct", + "ptypes/timestamp", + "ptypes/wrappers", + ] + pruneopts = "NUT" + revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" + version = "v1.2.0" + +[[projects]] + branch = "master" + digest = "1:245bd4eb633039cd66106a5d340ae826d87f4e36a8602fcc940e14176fd26ea7" + name = "github.com/google/btree" + packages = ["."] + pruneopts = "NUT" + revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" + +[[projects]] + digest = "1:010d46ea3c1e730897e53058d1013a963f3f987675dda87df64f891b945281db" + name = "github.com/google/go-cmp" + packages = [ + "cmp", + "cmp/cmpopts", + "cmp/internal/diff", + "cmp/internal/flags", + "cmp/internal/function", + "cmp/internal/value", + ] + pruneopts = "NUT" + revision = "6f77996f0c42f7b84e5a2b252227263f93432e9b" + +[[projects]] + digest = "1:f9425215dccf1c63f659ec781ca46bc81804341821d0cd8d2459c5b58f8bd067" + name = "github.com/google/gofuzz" + packages = ["."] + pruneopts = "NUT" + revision = "44d81051d367757e1c7c6a5a86423ece9afcf63c" + +[[projects]] + branch = "master" + digest = "1:0d5e3798bfa2642ac268341c96710b8def1f3cbc3bc803c421d90704d72107d8" + name = "github.com/google/licenseclassifier" + packages = [ + ".", + "internal/sets", + "stringclassifier", + "stringclassifier/internal/pq", + "stringclassifier/searchset", + "stringclassifier/searchset/tokenizer", + ] + pruneopts = "NUT" + revision = "e979a0b10eebe748549c702a25e997c556349da6" + +[[projects]] + digest = "1:ab3ec1fe3e39bac4b3ab63390767766622be35b7cab03f47f787f9ec60522a53" + name = "github.com/google/uuid" + packages = ["."] + pruneopts = "NUT" + revision = "0cd6bf5da1e1c83f8b45653022c74f71af0538a4" + version = "v1.1.1" + +[[projects]] + digest = "1:fd4d1f4c2d75aee3833ee7d8ef11fcf42ddec3c63d1819548288c3d868d6eb14" + name = "github.com/googleapis/gax-go" + packages = [ + ".", + "v2", + ] + pruneopts = "NUT" + revision = "c8a15bac9b9fe955bd9f900272f9a306465d28cf" + version = "v2.0.3" + +[[projects]] + digest = "1:27b4ab41ffdc76ad6db56db327a4db234a59588ef059fc3fd678ba0bc6b9094f" + name = "github.com/googleapis/gnostic" + packages = [ + "OpenAPIv2", + "compiler", + "extensions", + ] + pruneopts = "NUT" + revision = "0c5108395e2debce0d731cf0287ddf7242066aba" + +[[projects]] + digest = "1:4a0c072e44da763409da72d41492373a034baf2e6d849c76d239b4abdfbb6c49" + name = "github.com/gorilla/websocket" + packages = ["."] + pruneopts = "NUT" + revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d" + version = "v1.4.0" + +[[projects]] + branch = "master" + digest = "1:7fdf3223c7372d1ced0b98bf53457c5e89d89aecbad9a77ba9fcc6e01f9e5621" + name = "github.com/gregjones/httpcache" + packages = [ + ".", + "diskcache", + ] + pruneopts = "NUT" + revision = "9cad4c3443a7200dd6400aef47183728de563a38" + +[[projects]] + digest = "1:475b179287e8afdcd352014b2c2500e67decdf63e66125e2129286873453e1cd" + name = "github.com/hashicorp/golang-lru" + packages = [ + ".", + "simplelru", + ] + pruneopts = "NUT" + revision = "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" + +[[projects]] + digest = "1:9a52adf44086cead3b384e5d0dbf7a1c1cce65e67552ee3383a8561c42a18cd3" + name = "github.com/imdario/mergo" + packages = ["."] + pruneopts = "NUT" + revision = "9f23e2d6bd2a77f959b2bf6acdbefd708a83a4a4" + version = "v0.3.6" + +[[projects]] + digest = "1:1f2aebae7e7c856562355ec0198d8ca2fa222fb05e5b1b66632a1fce39631885" + name = "github.com/jmespath/go-jmespath" + packages = ["."] + pruneopts = "NUT" + revision = "c2b33e84" + +[[projects]] + digest = "1:da62aa6632d04e080b8a8b85a59ed9ed1550842a0099a55f3ae3a20d02a3745a" + name = "github.com/joho/godotenv" + packages = ["."] + pruneopts = "NUT" + revision = "23d116af351c84513e1946b527c88823e476be13" + version = "v1.3.0" + +[[projects]] + digest = "1:0243cffa4a3410f161ee613dfdd903a636d07e838a42d341da95d81f42cd1d41" + name = "github.com/json-iterator/go" + packages = ["."] + pruneopts = "NUT" + revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682" + +[[projects]] + branch = "master" + digest = "1:d0d25d17a6ef5842ad4c0ea41af24bd3debd8f6c7f0f18cd49db690962a84a83" + name = "github.com/knative/test-infra" + packages = [ + "scripts", + "tools/dep-collector", + ] + pruneopts = "UT" + revision = "03b0eab127a39bccf71c1eadc3446f7fb13f8669" + +[[projects]] + digest = "1:56dbf15e091bf7926cb33a57cb6bdfc658fc6d3498d2f76f10a97ce7856f1fde" + name = "github.com/markbates/inflect" + packages = ["."] + pruneopts = "NUT" + revision = "24b83195037b3bc61fcda2d28b7b0518bce293b6" + version = "v1.0.4" + +[[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:c6aca19413b13dc59c220ad7430329e2ec454cc310bc6d8de2c7e2b93c18a0f6" + name = "github.com/modern-go/reflect2" + packages = ["."] + pruneopts = "NUT" + revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" + version = "1.0.1" + +[[projects]] + digest = "1:22d4043da943b919108e0d1b07983b8d29edeadfba9fb8f3213208d3e9798aae" + name = "github.com/openzipkin/zipkin-go" + packages = [ + ".", + "idgenerator", + "model", + "propagation", + "reporter", + "reporter/http", + "reporter/recorder", + ] + pruneopts = "NUT" + revision = "1b5162aa314e6ccfcf83777bfb5218988c9e8283" + version = "v0.1.6" + +[[projects]] + branch = "master" + digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" + name = "github.com/petar/GoLLRB" + packages = ["llrb"] + pruneopts = "NUT" + revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" + +[[projects]] + digest = "1:6c6d91dc326ed6778783cff869c49fb2f61303cdd2ebbcf90abe53505793f3b6" + name = "github.com/peterbourgon/diskv" + packages = ["."] + pruneopts = "NUT" + revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" + version = "v2.0.1" + +[[projects]] + digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24" + name = "github.com/pkg/errors" + packages = ["."] + pruneopts = "NUT" + revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" + version = "v0.8.1" + +[[projects]] + digest = "1:7c7cfeecd2b7147bcfec48a4bf622b4879e26aec145a9e373ce51d0c23b16f6b" + name = "github.com/prometheus/client_golang" + packages = [ + "prometheus", + "prometheus/internal", + "prometheus/promhttp", + ] + pruneopts = "NUT" + revision = "505eaef017263e299324067d40ca2c48f6a2cf50" + version = "v0.9.2" + +[[projects]] + branch = "master" + digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" + name = "github.com/prometheus/client_model" + packages = ["go"] + pruneopts = "NUT" + revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" + +[[projects]] + branch = "master" + digest = "1:fad5a35eea6a1a33d6c8f949fbc146f24275ca809ece854248187683f52cc30b" + name = "github.com/prometheus/common" + packages = [ + "expfmt", + "internal/bitbucket.org/ww/goautoneg", + "model", + ] + pruneopts = "NUT" + revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" + +[[projects]] + branch = "master" + digest = "1:102dea0c03a915acfc634b7c67f2662012b5483b56d9025e33f5188e112759b6" + name = "github.com/prometheus/procfs" + packages = [ + ".", + "internal/util", + "nfs", + "xfs", + ] + pruneopts = "NUT" + revision = "185b4288413d2a0dd0806f78c90dde719829e5ae" + +[[projects]] + digest = "1:e09ada96a5a41deda4748b1659cc8953961799e798aea557257b56baee4ecaf3" + name = "github.com/rogpeppe/go-internal" + packages = [ + "modfile", + "module", + "semver", + ] + pruneopts = "NUT" + revision = "4bbc89b6501cca7dd6b5557d78d70c8d2c6e8b97" + +[[projects]] + digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" + name = "github.com/sergi/go-diff" + packages = ["diffmatchpatch"] + pruneopts = "NUT" + revision = "1744e2970ca51c86172c8190fadad617561ed6e7" + version = "v1.0.0" + +[[projects]] + digest = "1:9d8420bbf131d1618bde6530af37c3799340d3762cc47210c1d9532a4c3a2779" + name = "github.com/spf13/pflag" + packages = ["."] + pruneopts = "NUT" + revision = "298182f68c66c05229eb03ac171abe6e309ee79a" + version = "v1.0.3" + +[[projects]] + digest = "1:b8baa7541ef444be218da02d3a7b607d33513263660e489d86d429afbffcdd86" + name = "go.opencensus.io" + packages = [ + ".", + "exporter/prometheus", + "exporter/zipkin", + "internal", + "internal/tagencoding", + "metric/metricdata", + "metric/metricproducer", + "plugin/ocgrpc", + "plugin/ochttp", + "plugin/ochttp/propagation/b3", + "resource", + "stats", + "stats/internal", + "stats/view", + "tag", + "trace", + "trace/internal", + "trace/propagation", + "trace/tracestate", + ] + pruneopts = "NUT" + revision = "75c0cca22312e51bfd4fafdbe9197ae399e18b38" + version = "v0.20.2" + +[[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:5ab79d2a36037de1ab2908733a2cab0c08b12f6956e3e1eab07cd1b2abf7b903" + name = "go.uber.org/zap" + packages = [ + ".", + "buffer", + "internal/bufferpool", + "internal/color", + "internal/exit", + "internal/ztest", + "zapcore", + "zaptest", + ] + pruneopts = "NUT" + revision = "67bc79d13d155c02fd008f721863ff8cc5f30659" + +[[projects]] + digest = "1:624a05c7c6ed502bf77364cd3d54631383dafc169982fddd8ee77b53c3d9cccf" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + pruneopts = "NUT" + revision = "81e90905daefcd6fd217b62423c0908922eadb30" + +[[projects]] + branch = "master" + digest = "1:3033eba8bb0c8f2c6720e68e4c14e55b577ae9debb5f5b7b8cc6f319d89edc82" + name = "golang.org/x/net" + packages = [ + "context", + "context/ctxhttp", + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace", + ] + pruneopts = "NUT" + revision = "49bb7cea24b1df9410e1712aa6433dae904ff66a" + +[[projects]] + branch = "master" + digest = "1:dcb89c032286a9c3c5118a1496f8e0e237c1437f5356ac9602f6fdef560a5c21" + name = "golang.org/x/oauth2" + packages = [ + ".", + "google", + "internal", + "jws", + "jwt", + ] + pruneopts = "NUT" + revision = "c57b0facaced709681d9f90397429b9430a74754" + +[[projects]] + branch = "master" + digest = "1:c313aef534e493304f3666fbd24dca5932ebf776a82b7a40f961c9355794a1b1" + name = "golang.org/x/sync" + packages = [ + "errgroup", + "semaphore", + ] + pruneopts = "NUT" + revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca" + +[[projects]] + branch = "master" + digest = "1:a801d3c417117b67a96353daad340b250619780b75c29b652ea13697c946553e" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows", + ] + pruneopts = "NUT" + revision = "e072cadbbdc8dd3d3ffa82b8b4b9304c261d9311" + +[[projects]] + digest = "1:e7071ed636b5422cc51c0e3a6cebc229d6c9fffc528814b519a980641422d619" + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + ] + pruneopts = "NUT" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + digest = "1:d37b0ef2944431fe9e8ef35c6fffc8990d9e2ca300588df94a6890f3649ae365" + name = "golang.org/x/time" + packages = ["rate"] + pruneopts = "NUT" + revision = "f51c12702a4d776e4c1fa9b0fabab841babae631" + +[[projects]] + branch = "master" + digest = "1:e1c96c8c8ce0af57da9dccb008e540b3d13b55ea04b530fb4fceb81706082bdd" + name = "golang.org/x/tools" + packages = [ + "go/ast/astutil", + "imports", + "internal/fastwalk", + ] + pruneopts = "NUT" + revision = "bfb5194568d3c40db30de765edc44cae9fc94671" + +[[projects]] + branch = "master" + digest = "1:7689634b1a2940f3e725a37a7598b5462674a5b016b17d8ce22c8f71cacb0b34" + name = "google.golang.org/api" + packages = [ + "googleapi/transport", + "internal", + "iterator", + "option", + "support/bundler", + "transport", + "transport/grpc", + "transport/http", + "transport/http/internal/propagation", + ] + pruneopts = "NUT" + revision = "ce4acf611b3920b111e21272a15ddaea10c1fd2e" + +[[projects]] + digest = "1:898bf528e5c601c4a1111586f75ab9515467ebe7a41ae849d5a839720d4e2580" + name = "google.golang.org/appengine" + packages = [ + ".", + "internal", + "internal/app_identity", + "internal/base", + "internal/datastore", + "internal/log", + "internal/modules", + "internal/remote_api", + "internal/socket", + "internal/urlfetch", + "socket", + "urlfetch", + ] + pruneopts = "NUT" + revision = "e9657d882bb81064595ca3b56cbe2546bbabf7b1" + version = "v1.4.0" + +[[projects]] + branch = "master" + digest = "1:3689f4cc57cc55b4631efc4b778c47d2a888a7060b4108f42cf289a2033be5ba" + name = "google.golang.org/genproto" + packages = [ + "googleapis/api", + "googleapis/api/annotations", + "googleapis/api/distribution", + "googleapis/api/label", + "googleapis/api/metric", + "googleapis/api/monitoredres", + "googleapis/container/v1", + "googleapis/devtools/cloudtrace/v2", + "googleapis/monitoring/v3", + "googleapis/rpc/status", + "protobuf/field_mask", + ] + pruneopts = "NUT" + revision = "e7d98fc518a78c9f8b5ee77be7b0b317475d89e1" + +[[projects]] + digest = "1:40d377bfddee53c669db275071aa08b68d021941311580d902ab7c862d8741c1" + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "balancer/base", + "balancer/roundrobin", + "binarylog/grpc_binarylog_v1", + "codes", + "connectivity", + "credentials", + "credentials/internal", + "credentials/oauth", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/binarylog", + "internal/channelz", + "internal/envconfig", + "internal/grpcrand", + "internal/grpcsync", + "internal/syscall", + "internal/transport", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "resolver/dns", + "resolver/passthrough", + "stats", + "status", + "tap", + ] + pruneopts = "NUT" + revision = "df014850f6dee74ba2fc94874043a9f3f75fbfd8" + version = "v1.17.0" + +[[projects]] + digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" + name = "gopkg.in/inf.v0" + packages = ["."] + pruneopts = "NUT" + revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" + version = "v0.9.1" + +[[projects]] + digest = "1:18108594151654e9e696b27b181b953f9a90b16bf14d253dd1b397b025a1487f" + name = "gopkg.in/yaml.v2" + packages = ["."] + pruneopts = "NUT" + revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" + version = "v2.2.2" + +[[projects]] + digest = "1:1d34342a53d8f8c625260d6c4c2e5c99442b1635bbf4208f426bd12aa210b870" + name = "k8s.io/api" + packages = [ + "admission/v1beta1", + "admissionregistration/v1alpha1", + "admissionregistration/v1beta1", + "apps/v1", + "apps/v1beta1", + "apps/v1beta2", + "authentication/v1", + "authentication/v1beta1", + "authorization/v1", + "authorization/v1beta1", + "autoscaling/v1", + "autoscaling/v2beta1", + "autoscaling/v2beta2", + "batch/v1", + "batch/v1beta1", + "batch/v2alpha1", + "certificates/v1beta1", + "coordination/v1beta1", + "core/v1", + "events/v1beta1", + "extensions/v1beta1", + "networking/v1", + "policy/v1beta1", + "rbac/v1", + "rbac/v1alpha1", + "rbac/v1beta1", + "scheduling/v1alpha1", + "scheduling/v1beta1", + "settings/v1alpha1", + "storage/v1", + "storage/v1alpha1", + "storage/v1beta1", + ] + pruneopts = "NUT" + revision = "145d52631d00cbfe68490d19ae4f0f501fd31a95" + version = "kubernetes-1.12.6" + +[[projects]] + digest = "1:119ae04ee44c5d179dcde1ee686f057cfe3fc54a7ee8484b920932a80309e88b" + name = "k8s.io/apimachinery" + packages = [ + "pkg/api/equality", + "pkg/api/errors", + "pkg/api/meta", + "pkg/api/resource", + "pkg/api/validation", + "pkg/apis/meta/internalversion", + "pkg/apis/meta/v1", + "pkg/apis/meta/v1/unstructured", + "pkg/apis/meta/v1/validation", + "pkg/apis/meta/v1beta1", + "pkg/conversion", + "pkg/conversion/queryparams", + "pkg/fields", + "pkg/labels", + "pkg/runtime", + "pkg/runtime/schema", + "pkg/runtime/serializer", + "pkg/runtime/serializer/json", + "pkg/runtime/serializer/protobuf", + "pkg/runtime/serializer/recognizer", + "pkg/runtime/serializer/streaming", + "pkg/runtime/serializer/versioning", + "pkg/selection", + "pkg/types", + "pkg/util/cache", + "pkg/util/clock", + "pkg/util/diff", + "pkg/util/errors", + "pkg/util/framer", + "pkg/util/intstr", + "pkg/util/json", + "pkg/util/mergepatch", + "pkg/util/naming", + "pkg/util/net", + "pkg/util/runtime", + "pkg/util/sets", + "pkg/util/sets/types", + "pkg/util/strategicpatch", + "pkg/util/validation", + "pkg/util/validation/field", + "pkg/util/wait", + "pkg/util/yaml", + "pkg/version", + "pkg/watch", + "third_party/forked/golang/json", + "third_party/forked/golang/reflect", + ] + pruneopts = "NUT" + revision = "01f179d85dbce0f2e0e4351a92394b38694b7cae" + version = "kubernetes-1.12.6" + +[[projects]] + digest = "1:b7dd0420e85cb2968ffb945f2810ea6c796dc2a08660618e2200c08c596f0624" + name = "k8s.io/client-go" + packages = [ + "discovery", + "discovery/fake", + "dynamic", + "dynamic/fake", + "informers", + "informers/admissionregistration", + "informers/admissionregistration/v1alpha1", + "informers/admissionregistration/v1beta1", + "informers/apps", + "informers/apps/v1", + "informers/apps/v1beta1", + "informers/apps/v1beta2", + "informers/autoscaling", + "informers/autoscaling/v1", + "informers/autoscaling/v2beta1", + "informers/autoscaling/v2beta2", + "informers/batch", + "informers/batch/v1", + "informers/batch/v1beta1", + "informers/batch/v2alpha1", + "informers/certificates", + "informers/certificates/v1beta1", + "informers/coordination", + "informers/coordination/v1beta1", + "informers/core", + "informers/core/v1", + "informers/events", + "informers/events/v1beta1", + "informers/extensions", + "informers/extensions/v1beta1", + "informers/internalinterfaces", + "informers/networking", + "informers/networking/v1", + "informers/policy", + "informers/policy/v1beta1", + "informers/rbac", + "informers/rbac/v1", + "informers/rbac/v1alpha1", + "informers/rbac/v1beta1", + "informers/scheduling", + "informers/scheduling/v1alpha1", + "informers/scheduling/v1beta1", + "informers/settings", + "informers/settings/v1alpha1", + "informers/storage", + "informers/storage/v1", + "informers/storage/v1alpha1", + "informers/storage/v1beta1", + "kubernetes", + "kubernetes/fake", + "kubernetes/scheme", + "kubernetes/typed/admissionregistration/v1alpha1", + "kubernetes/typed/admissionregistration/v1alpha1/fake", + "kubernetes/typed/admissionregistration/v1beta1", + "kubernetes/typed/admissionregistration/v1beta1/fake", + "kubernetes/typed/apps/v1", + "kubernetes/typed/apps/v1/fake", + "kubernetes/typed/apps/v1beta1", + "kubernetes/typed/apps/v1beta1/fake", + "kubernetes/typed/apps/v1beta2", + "kubernetes/typed/apps/v1beta2/fake", + "kubernetes/typed/authentication/v1", + "kubernetes/typed/authentication/v1/fake", + "kubernetes/typed/authentication/v1beta1", + "kubernetes/typed/authentication/v1beta1/fake", + "kubernetes/typed/authorization/v1", + "kubernetes/typed/authorization/v1/fake", + "kubernetes/typed/authorization/v1beta1", + "kubernetes/typed/authorization/v1beta1/fake", + "kubernetes/typed/autoscaling/v1", + "kubernetes/typed/autoscaling/v1/fake", + "kubernetes/typed/autoscaling/v2beta1", + "kubernetes/typed/autoscaling/v2beta1/fake", + "kubernetes/typed/autoscaling/v2beta2", + "kubernetes/typed/autoscaling/v2beta2/fake", + "kubernetes/typed/batch/v1", + "kubernetes/typed/batch/v1/fake", + "kubernetes/typed/batch/v1beta1", + "kubernetes/typed/batch/v1beta1/fake", + "kubernetes/typed/batch/v2alpha1", + "kubernetes/typed/batch/v2alpha1/fake", + "kubernetes/typed/certificates/v1beta1", + "kubernetes/typed/certificates/v1beta1/fake", + "kubernetes/typed/coordination/v1beta1", + "kubernetes/typed/coordination/v1beta1/fake", + "kubernetes/typed/core/v1", + "kubernetes/typed/core/v1/fake", + "kubernetes/typed/events/v1beta1", + "kubernetes/typed/events/v1beta1/fake", + "kubernetes/typed/extensions/v1beta1", + "kubernetes/typed/extensions/v1beta1/fake", + "kubernetes/typed/networking/v1", + "kubernetes/typed/networking/v1/fake", + "kubernetes/typed/policy/v1beta1", + "kubernetes/typed/policy/v1beta1/fake", + "kubernetes/typed/rbac/v1", + "kubernetes/typed/rbac/v1/fake", + "kubernetes/typed/rbac/v1alpha1", + "kubernetes/typed/rbac/v1alpha1/fake", + "kubernetes/typed/rbac/v1beta1", + "kubernetes/typed/rbac/v1beta1/fake", + "kubernetes/typed/scheduling/v1alpha1", + "kubernetes/typed/scheduling/v1alpha1/fake", + "kubernetes/typed/scheduling/v1beta1", + "kubernetes/typed/scheduling/v1beta1/fake", + "kubernetes/typed/settings/v1alpha1", + "kubernetes/typed/settings/v1alpha1/fake", + "kubernetes/typed/storage/v1", + "kubernetes/typed/storage/v1/fake", + "kubernetes/typed/storage/v1alpha1", + "kubernetes/typed/storage/v1alpha1/fake", + "kubernetes/typed/storage/v1beta1", + "kubernetes/typed/storage/v1beta1/fake", + "listers/admissionregistration/v1alpha1", + "listers/admissionregistration/v1beta1", + "listers/apps/v1", + "listers/apps/v1beta1", + "listers/apps/v1beta2", + "listers/autoscaling/v1", + "listers/autoscaling/v2beta1", + "listers/autoscaling/v2beta2", + "listers/batch/v1", + "listers/batch/v1beta1", + "listers/batch/v2alpha1", + "listers/certificates/v1beta1", + "listers/coordination/v1beta1", + "listers/core/v1", + "listers/events/v1beta1", + "listers/extensions/v1beta1", + "listers/networking/v1", + "listers/policy/v1beta1", + "listers/rbac/v1", + "listers/rbac/v1alpha1", + "listers/rbac/v1beta1", + "listers/scheduling/v1alpha1", + "listers/scheduling/v1beta1", + "listers/settings/v1alpha1", + "listers/storage/v1", + "listers/storage/v1alpha1", + "listers/storage/v1beta1", + "pkg/apis/clientauthentication", + "pkg/apis/clientauthentication/v1alpha1", + "pkg/apis/clientauthentication/v1beta1", + "pkg/version", + "plugin/pkg/client/auth/exec", + "rest", + "rest/watch", + "testing", + "tools/auth", + "tools/cache", + "tools/clientcmd", + "tools/clientcmd/api", + "tools/clientcmd/api/latest", + "tools/clientcmd/api/v1", + "tools/metrics", + "tools/pager", + "tools/record", + "tools/reference", + "transport", + "util/buffer", + "util/cert", + "util/connrotation", + "util/flowcontrol", + "util/homedir", + "util/integer", + "util/retry", + "util/workqueue", + ] + pruneopts = "NUT" + revision = "78295b709ec6fa5be12e35892477a326dea2b5d3" + version = "kubernetes-1.12.6" + +[[projects]] + digest = "1:26b81b5e76e3f84ea5140da4f74649576e470f79091d2ef8e0d1b5000bc636ca" + name = "k8s.io/code-generator" + packages = [ + "cmd/client-gen", + "cmd/client-gen/args", + "cmd/client-gen/generators", + "cmd/client-gen/generators/fake", + "cmd/client-gen/generators/scheme", + "cmd/client-gen/generators/util", + "cmd/client-gen/path", + "cmd/client-gen/types", + "cmd/deepcopy-gen", + "cmd/deepcopy-gen/args", + "cmd/defaulter-gen", + "cmd/defaulter-gen/args", + "cmd/informer-gen", + "cmd/informer-gen/args", + "cmd/informer-gen/generators", + "cmd/lister-gen", + "cmd/lister-gen/args", + "cmd/lister-gen/generators", + "pkg/util", + ] + pruneopts = "T" + revision = "b1289fc74931d4b6b04bd1a259acfc88a2cb0a66" + version = "kubernetes-1.12.6" + +[[projects]] + branch = "master" + digest = "1:39912eb5f8eaf46486faae0839586c27c93423e552f76875defa048f52c15c15" + name = "k8s.io/gengo" + packages = [ + "args", + "examples/deepcopy-gen/generators", + "examples/defaulter-gen/generators", + "examples/set-gen/sets", + "generator", + "namer", + "parser", + "types", + ] + pruneopts = "NUT" + revision = "e17681d19d3ac4837a019ece36c2a0ec31ffe985" + +[[projects]] + digest = "1:c263611800c3a97991dbcf9d3bc4de390f6224aaa8ca0a7226a9d734f65a416a" + name = "k8s.io/klog" + packages = ["."] + pruneopts = "NUT" + revision = "71442cd4037d612096940ceb0f3fec3f7fff66e0" + version = "v0.2.0" + +[[projects]] + branch = "master" + digest = "1:a2c842a1e0aed96fd732b535514556323a6f5edfded3b63e5e0ab1bce188aa54" + name = "k8s.io/kube-openapi" + packages = ["pkg/util/proto"] + pruneopts = "NUT" + revision = "e3762e86a74c878ffed47484592986685639c2cd" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "cloud.google.com/go/compute/metadata", + "contrib.go.opencensus.io/exporter/stackdriver", + "contrib.go.opencensus.io/exporter/stackdriver/monitoredresource", + "github.com/davecgh/go-spew/spew", + "github.com/evanphx/json-patch", + "github.com/ghodss/yaml", + "github.com/golang/glog", + "github.com/google/go-cmp/cmp", + "github.com/google/go-cmp/cmp/cmpopts", + "github.com/google/uuid", + "github.com/gorilla/websocket", + "github.com/knative/test-infra/scripts", + "github.com/knative/test-infra/tools/dep-collector", + "github.com/markbates/inflect", + "github.com/mattbaird/jsonpatch", + "github.com/openzipkin/zipkin-go", + "github.com/openzipkin/zipkin-go/model", + "github.com/openzipkin/zipkin-go/reporter", + "github.com/openzipkin/zipkin-go/reporter/http", + "github.com/openzipkin/zipkin-go/reporter/recorder", + "github.com/pkg/errors", + "github.com/rogpeppe/go-internal/semver", + "go.opencensus.io/exporter/prometheus", + "go.opencensus.io/exporter/zipkin", + "go.opencensus.io/plugin/ochttp", + "go.opencensus.io/plugin/ochttp/propagation/b3", + "go.opencensus.io/stats", + "go.opencensus.io/stats/view", + "go.opencensus.io/tag", + "go.opencensus.io/trace", + "go.uber.org/zap", + "go.uber.org/zap/zapcore", + "go.uber.org/zap/zaptest", + "golang.org/x/sync/errgroup", + "k8s.io/api/admission/v1beta1", + "k8s.io/api/admissionregistration/v1beta1", + "k8s.io/api/apps/v1", + "k8s.io/api/authentication/v1", + "k8s.io/api/batch/v1", + "k8s.io/api/core/v1", + "k8s.io/api/rbac/v1", + "k8s.io/apimachinery/pkg/api/equality", + "k8s.io/apimachinery/pkg/api/errors", + "k8s.io/apimachinery/pkg/api/meta", + "k8s.io/apimachinery/pkg/api/resource", + "k8s.io/apimachinery/pkg/api/validation", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", + "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/selection", + "k8s.io/apimachinery/pkg/types", + "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/version", + "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/dynamic/fake", + "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/typed/admissionregistration/v1beta1", + "k8s.io/client-go/kubernetes/typed/core/v1", + "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", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/knative/pkg/Gopkg.toml b/vendor/github.com/knative/pkg/Gopkg.toml new file mode 100644 index 00000000..e7e23114 --- /dev/null +++ b/vendor/github.com/knative/pkg/Gopkg.toml @@ -0,0 +1,74 @@ +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. + +required = [ + "k8s.io/apimachinery/pkg/util/sets/types", + "k8s.io/code-generator/cmd/deepcopy-gen", + "k8s.io/code-generator/cmd/defaulter-gen", + "k8s.io/code-generator/cmd/client-gen", + "k8s.io/code-generator/cmd/lister-gen", + "k8s.io/code-generator/cmd/informer-gen", + "github.com/evanphx/json-patch", + "github.com/knative/test-infra/scripts", + "github.com/knative/test-infra/tools/dep-collector", + "github.com/pkg/errors", +] + +[[constraint]] + name = "k8s.io/api" + version = "kubernetes-1.12.6" + +[[constraint]] + name = "k8s.io/apimachinery" + version = "kubernetes-1.12.6" + +[[constraint]] + name = "k8s.io/client-go" + version = "kubernetes-1.12.6" + +[[constraint]] + name = "k8s.io/code-generator" + version = "kubernetes-1.12.6" + +[[override]] + name = "github.com/json-iterator/go" + # This is the commit at which k8s depends on this in 1.11 + # It seems to be broken at HEAD. + revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682" + +[[override]] + name = "go.uber.org/zap" + revision = "67bc79d13d155c02fd008f721863ff8cc5f30659" + +[[constraint]] + name = "github.com/google/go-cmp" + # HEAD as of 2019-04-09 + revision = "6f77996f0c42f7b84e5a2b252227263f93432e9b" + +[[override]] + name = "github.com/rogpeppe/go-internal" + # HEAD as of 2019-01-09 + # Needed because release 1.0.0 does not contain a LICENSE file + revision = "4bbc89b6501cca7dd6b5557d78d70c8d2c6e8b97" + +[[constraint]] + name = "contrib.go.opencensus.io/exporter/stackdriver" + version = "0.9.2" + +[[constraint]] + name = "github.com/knative/test-infra" + branch = "master" + +[prune] + go-tests = true + unused-packages = true + non-go = true + +[[prune.project]] + name = "k8s.io/code-generator" + unused-packages = false + non-go = false + +[[prune.project]] + name = "github.com/knative/test-infra" + non-go = false diff --git a/vendor/github.com/knative/pkg/LICENSE b/vendor/github.com/knative/pkg/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/vendor/github.com/knative/pkg/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/vendor/github.com/knative/pkg/OWNERS b/vendor/github.com/knative/pkg/OWNERS new file mode 100644 index 00000000..e5d05338 --- /dev/null +++ b/vendor/github.com/knative/pkg/OWNERS @@ -0,0 +1,6 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- evankanderson +- mattmoor +- vaikas-google diff --git a/vendor/github.com/knative/pkg/README.md b/vendor/github.com/knative/pkg/README.md new file mode 100644 index 00000000..b0098ca9 --- /dev/null +++ b/vendor/github.com/knative/pkg/README.md @@ -0,0 +1,13 @@ +# Knative Common Packages + +[![GoDoc](https://godoc.org/github.com/knative/pkg?status.svg)](https://godoc.org/github.com/knative/pkg) +[![Go Report Card](https://goreportcard.com/badge/knative/pkg)](https://goreportcard.com/report/knative/pkg) + +Knative `pkg` provides a place for sharing common Knative packages across the +Knative repos. + +To learn more about Knative, please visit our +[Knative docs](https://github.com/knative/docs) repository. + +If you are interested in contributing, see [CONTRIBUTING.md](./CONTRIBUTING.md) +and [DEVELOPMENT.md](./DEVELOPMENT.md). diff --git a/vendor/github.com/knative/pkg/apis/OWNERS b/vendor/github.com/knative/pkg/apis/OWNERS new file mode 100644 index 00000000..887e8bc8 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/OWNERS @@ -0,0 +1,6 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- mattmoor +- vaikas-google +- n3wscott diff --git a/vendor/github.com/knative/pkg/apis/istio/OWNERS b/vendor/github.com/knative/pkg/apis/istio/OWNERS new file mode 100644 index 00000000..5fa3f101 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/OWNERS @@ -0,0 +1,4 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- tcnghia diff --git a/vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go b/vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go new file mode 100644 index 00000000..c34c2505 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/common/v1alpha1/string.go @@ -0,0 +1,35 @@ +/* +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 + +// Describes how to match a given string in HTTP headers. Match is +// case-sensitive. +type StringMatch struct { + // Specified exactly one of the fields below. + + // exact string match + Exact string `json:"exact,omitempty"` + + // prefix-based match + Prefix string `json:"prefix,omitempty"` + + // suffix-based match. + Suffix string `json:"suffix,omitempty"` + + // ECMAscript style regex-based match + Regex string `json:"regex,omitempty"` +} diff --git a/vendor/github.com/knative/pkg/apis/istio/register.go b/vendor/github.com/knative/pkg/apis/istio/register.go new file mode 100644 index 00000000..647eb38a --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/register.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 istio + +const ( + GroupName = "networking.istio.io" +) diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md new file mode 100644 index 00000000..bc1fb65a --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/README.md @@ -0,0 +1,17 @@ +# What are these files? + +These are Go structs for Istio CRD. We translated them from proto files in +https://github.com/istio/api/tree/master/networking/v1alpha3 . + +# Why do we hand-translate from proto? i.e Why can't we vendor these? + +Istio needs to run on many platforms and as a reason they represent their +objects internally as proto. On Kubernetes, their API take in JSON objects and +convert to proto before processing them. + +So they have nothing we can vendor, except for the Go files that are generated +by the proto compiler, which is not compatible with K8s API code-generator at +all. + +We may be able to donate our translation so they can maintain it themselves. See +https://github.com/istio/istio/issues/6084. diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go new file mode 100644 index 00000000..54a43b35 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/destinationrule_types.go @@ -0,0 +1,547 @@ +/* +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 v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// DestinationRule +type DestinationRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec DestinationRuleSpec `json:"spec"` +} + +// DestinationRule defines policies that apply to traffic intended for a +// service after routing has occurred. These rules specify configuration +// for load balancing, connection pool size from the sidecar, and outlier +// detection settings to detect and evict unhealthy hosts from the load +// balancing pool. For example, a simple load balancing policy for the +// ratings service would look as follows: +// +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// +// +// Version specific policies can be specified by defining a named +// subset and overriding the settings specified at the service level. The +// following rule uses a round robin load balancing policy for all traffic +// going to a subset named testversion that is composed of endpoints (e.g., +// pods) with labels (version:v3). +// +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// Traffic policies can be customized to specific ports as well. The +// following rule uses the least connection load balancing policy for all +// traffic to port 80, while uses a round robin load balancing setting for +// traffic to the port 9080. +// +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// +type DestinationRuleSpec struct { + // REQUIRED. The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntries](#ServiceEntry). Rules defined for + // services that do not exist in the service registry will be ignored. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + // + // Note that the host field applies to both HTTP and TCP services. + Host string `json:"host"` + + // Traffic policies to apply (load balancing policy, connection pool + // sizes, outlier detection). + TrafficPolicy *TrafficPolicy `json:"trafficPolicy,omitempty"` + + // One or more named sets that represent individual versions of a + // service. Traffic policies can be overridden at subset level. + Subsets []Subset `json:"subsets,omitempty"` +} + +// Traffic policies to apply for a specific destination, across all +// destination ports. See DestinationRule for examples. +type TrafficPolicy struct { + + // Settings controlling the load balancer algorithms. + LoadBalancer *LoadBalancerSettings `json:"loadBalancer,omitempty"` + + // Settings controlling the volume of connections to an upstream service + ConnectionPool *ConnectionPoolSettings `json:"connectionPool,omitempty"` + + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty"` + + // TLS related settings for connections to the upstream service. + TLS *TLSSettings `json:"tls,omitempty"` + + // Traffic policies specific to individual ports. Note that port level + // settings will override the destination-level settings. Traffic + // settings specified at the destination-level will not be inherited when + // overridden by port-level settings, i.e. default values will be applied + // to fields omitted in port-level traffic policies. + PortLevelSettings []PortTrafficPolicy `json:"portLevelSettings,omitempty"` +} + +// Traffic policies that apply to specific ports of the service +type PortTrafficPolicy struct { + // Specifies the port name or number of a port on the destination service + // on which this policy is being applied. + // + // Names must comply with DNS label syntax (rfc1035) and therefore cannot + // collide with numbers. If there are multiple ports on a service with + // the same protocol the names should be of the form -. + Port PortSelector `json:"port"` + + // Settings controlling the load balancer algorithms. + LoadBalancer *LoadBalancerSettings `json:"loadBalancer,omitempty"` + + // Settings controlling the volume of connections to an upstream service + ConnectionPool *ConnectionPoolSettings `json:"connectionPool,omitempty"` + + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty"` + + // TLS related settings for connections to the upstream service. + TLS *TLSSettings `json:"tls,omitempty"` +} + +// A subset of endpoints of a service. Subsets can be used for scenarios +// like A/B testing, or routing to a specific version of a service. Refer +// to [VirtualService](#VirtualService) documentation for examples of using +// subsets in these scenarios. In addition, traffic policies defined at the +// service-level can be overridden at a subset-level. The following rule +// uses a round robin load balancing policy for all traffic going to a +// subset named testversion that is composed of endpoints (e.g., pods) with +// labels (version:v3). +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +type Subset struct { + // REQUIRED. Name of the subset. The service name and the subset name can + // be used for traffic splitting in a route rule. + Name string `json:"name"` + + // REQUIRED. Labels apply a filter over the endpoints of a service in the + // service registry. See route rules for examples of usage. + Labels map[string]string `json:"labels"` + + // Traffic policies that apply to this subset. Subsets inherit the + // traffic policies specified at the DestinationRule level. Settings + // specified at the subset level will override the corresponding settings + // specified at the DestinationRule level. + TrafficPolicy *TrafficPolicy `json:"trafficPolicy,omitempty"` +} + +// Load balancing policies to apply for a specific destination. See Envoy's +// load balancing +// [documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/load_balancing.html) +// for more details. +// +// For example, the following rule uses a round robin load balancing policy +// for all traffic going to the ratings service. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// +// The following example sets up sticky sessions for the ratings service +// hashing-based load balancer for the same ratings service using the +// the User cookie as the hash key. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// consistentHash: +// httpCookie: +// name: user +// ttl: 0s +type LoadBalancerSettings struct { + // It is required to specify exactly one of the fields: + // Simple or ConsistentHash + Simple SimpleLB `json:"simple,omitempty"` + ConsistentHash *ConsistentHashLB `json:"consistentHash,omitempty"` +} + +// Standard load balancing algorithms that require no tuning. +type SimpleLB string + +const ( + // Round Robin policy. Default + SimpleLBRoundRobin SimpleLB = "ROUND_ROBIN" + + // The least request load balancer uses an O(1) algorithm which selects + // two random healthy hosts and picks the host which has fewer active + // requests. + SimpleLBLeastConn SimpleLB = "LEAST_CONN" + + // The random load balancer selects a random healthy host. The random + // load balancer generally performs better than round robin if no health + // checking policy is configured. + SimpleLBRandom SimpleLB = "RANDOM" + + // This option will forward the connection to the original IP address + // requested by the caller without doing any form of load + // balancing. This option must be used with care. It is meant for + // advanced use cases. Refer to Original Destination load balancer in + // Envoy for further details. + SimpleLBPassthrough SimpleLB = "PASSTHROUGH" +) + +// Consistent Hash-based load balancing can be used to provide soft +// session affinity based on HTTP headers, cookies or other +// properties. This load balancing policy is applicable only for HTTP +// connections. The affinity to a particular destination host will be +// lost when one or more hosts are added/removed from the destination +// service. +type ConsistentHashLB struct { + + // It is required to specify exactly one of the fields as hash key: + // HTTPHeaderName, HTTPCookie, or UseSourceIP. + // Hash based on a specific HTTP header. + HTTPHeaderName string `json:"httpHeaderName,omitempty"` + + // Hash based on HTTP cookie. + HTTPCookie *HTTPCookie `json:"httpCookie,omitempty"` + + // Hash based on the source IP address. + UseSourceIP bool `json:"useSourceIp,omitempty"` + + // The minimum number of virtual nodes to use for the hash + // ring. Defaults to 1024. Larger ring sizes result in more granular + // load distributions. If the number of hosts in the load balancing + // pool is larger than the ring size, each host will be assigned a + // single virtual node. + MinimumRingSize uint64 `json:"minimumRingSize,omitempty"` +} + +// Describes a HTTP cookie that will be used as the hash key for the +// Consistent Hash load balancer. If the cookie is not present, it will +// be generated. +type HTTPCookie struct { + // REQUIRED. Name of the cookie. + Name string `json:"name"` + + // Path to set for the cookie. + Path string `json:"path,omitempty"` + + // REQUIRED. Lifetime of the cookie. + TTL string `json:"ttl"` +} + +// Connection pool settings for an upstream host. The settings apply to +// each individual host in the upstream service. See Envoy's [circuit +// breaker](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/circuit_breaking) +// for more details. Connection pool settings can be applied at the TCP +// level as well as at HTTP level. +// +// For example, the following rule sets a limit of 100 connections to redis +// service called myredissrv with a connect timeout of 30ms +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-redis +// spec: +// host: myredissrv.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// connectTimeout: 30ms +type ConnectionPoolSettings struct { + + // Settings common to both HTTP and TCP upstream connections. + TCP *TCPSettings `json:"tcp,omitempty"` + + // HTTP connection pool settings. + HTTP *HTTPSettings `json:"http,omitempty"` +} + +// Settings common to both HTTP and TCP upstream connections. +type TCPSettings struct { + // Maximum number of HTTP1 /TCP connections to a destination host. + MaxConnections int32 `json:"maxConnections,omitempty"` + + // TCP connection timeout. + ConnectTimeout string `json:"connectTimeout,omitempty"` +} + +// Settings applicable to HTTP1.1/HTTP2/GRPC connections. +type HTTPSettings struct { + // Maximum number of pending HTTP requests to a destination. Default 1024. + HTTP1MaxPendingRequests int32 `json:"http1MaxPendingRequests,omitempty"` + + // Maximum number of requests to a backend. Default 1024. + HTTP2MaxRequests int32 `json:"http2MaxRequests,omitempty"` + + // Maximum number of requests per connection to a backend. Setting this + // parameter to 1 disables keep alive. + MaxRequestsPerConnection int32 `json:"maxRequestsPerConnection,omitempty"` + + // Maximum number of retries that can be outstanding to all hosts in a + // cluster at a given time. Defaults to 3. + MaxRetries int32 `json:"maxRetries,omitempty"` +} + +// A Circuit breaker implementation that tracks the status of each +// individual host in the upstream service. Applicable to both HTTP and +// TCP services. For HTTP services, hosts that continually return 5xx +// errors for API calls are ejected from the pool for a pre-defined period +// of time. For TCP services, connection timeouts or connection +// failures to a given host counts as an error when measuring the +// consecutive errors metric. See Envoy's [outlier +// detection](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/outlier) +// for more details. +// +// The following rule sets a connection pool size of 100 connections and +// 1000 concurrent HTTP2 requests, with no more than 10 req/connection to +// "reviews" service. In addition, it configures upstream hosts to be +// scanned every 5 mins, such that any host that fails 7 consecutive times +// with 5XX error code will be ejected for 15 minutes. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-cb-policy +// spec: +// host: reviews.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// http: +// http2MaxRequests: 1000 +// maxRequestsPerConnection: 10 +// outlierDetection: +// consecutiveErrors: 7 +// interval: 5m +// baseEjectionTime: 15m +type OutlierDetection struct { + // Number of errors before a host is ejected from the connection + // pool. Defaults to 5. When the upstream host is accessed over HTTP, a + // 5xx return code qualifies as an error. When the upstream host is + // accessed over an opaque TCP connection, connect timeouts and + // connection error/failure events qualify as an error. + ConsecutiveErrors int32 `json:"consecutiveErrors,omitempty"` + + // Time interval between ejection sweep analysis. format: + // 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. + Interval string `json:"interval,omitempty"` + + // Minimum ejection duration. A host will remain ejected for a period + // equal to the product of minimum ejection duration and the number of + // times the host has been ejected. This technique allows the system to + // automatically increase the ejection period for unhealthy upstream + // servers. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 30s. + BaseEjectionTime string `json:"baseEjectionTime,omitempty"` + + // Maximum % of hosts in the load balancing pool for the upstream + // service that can be ejected. Defaults to 10%. + MaxEjectionPercent int32 `json:"maxEjectionPercent,omitempty"` +} + +// SSL/TLS related settings for upstream connections. See Envoy's [TLS +// context](https://www.envoyproxy.io/docs/envoy/latest/api-v1/cluster_manager/cluster_ssl.html#config-cluster-manager-cluster-ssl) +// for more details. These settings are common to both HTTP and TCP upstreams. +// +// For example, the following rule configures a client to use mutual TLS +// for connections to upstream database cluster. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: db-mtls +// spec: +// host: mydbserver.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// +// The following rule configures a client to use TLS when talking to a +// foreign service whose domain matches *.foo.com. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: tls-foo +// spec: +// host: "*.foo.com" +// trafficPolicy: +// tls: +// mode: SIMPLE +// +// The following rule configures a client to use Istio mutual TLS when talking +// to rating services. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: ratings-istio-mtls +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: ISTIO_MUTUAL +type TLSSettings struct { + + // REQUIRED: Indicates whether connections to this port should be secured + // using TLS. The value of this field determines how TLS is enforced. + Mode TLSmode `json:"mode"` + + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client-side TLS certificate to use. + // Should be empty if mode is `ISTIO_MUTUAL`. + ClientCertificate string `json:"clientCertificate,omitempty"` + + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client's private key. + // Should be empty if mode is `ISTIO_MUTUAL`. + PrivateKey string `json:"privateKey,omitempty"` + + // OPTIONAL: The path to the file containing certificate authority + // certificates to use in verifying a presented server certificate. If + // omitted, the proxy will not verify the server's certificate. + // Should be empty if mode is `ISTIO_MUTUAL`. + CaCertificates string `json:"caCertificates,omitempty"` + + // A list of alternate names to verify the subject identity in the + // certificate. If specified, the proxy will verify that the server + // certificate's subject alt name matches one of the specified values. + // Should be empty if mode is `ISTIO_MUTUAL`. + SubjectAltNames []string `json:"subjectAltNames,omitempty"` + + // SNI string to present to the server during TLS handshake. + // Should be empty if mode is `ISTIO_MUTUAL`. + Sni string `json:"sni,omitempty"` +} + +// TLS connection mode +type TLSmode string + +const ( + // Do not setup a TLS connection to the upstream endpoint. + TLSmodeDisable TLSmode = "DISABLE" + + // Originate a TLS connection to the upstream endpoint. + TLSmodeSimple TLSmode = "SIMPLE" + + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + TLSmodeMutual TLSmode = "MUTUAL" + + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + // Compared to Mutual mode, this mode uses certificates generated + // automatically by Istio for mTLS authentication. When this mode is + // used, all other fields in `TLSSettings` should be empty. + TLSmodeIstioMutual TLSmode = "ISTIO_MUTUAL" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// DestinationRuleList is a list of DestinationRule resources +type DestinationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []DestinationRule `json:"items"` +} diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go new file mode 100644 index 00000000..47ec83da --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/doc.go @@ -0,0 +1,23 @@ +/* +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. +*/ + +// Api versions allow the api contract for a resource to be changed while keeping +// backward compatibility by support multiple concurrent versions +// of the same resource + +// +k8s:deepcopy-gen=package +// +groupName=networking.istio.io +package v1alpha3 diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go new file mode 100644 index 00000000..460c3f6a --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/gateway_types.go @@ -0,0 +1,336 @@ +/* +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 v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Gateway describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. The specification +// describes a set of ports that should be exposed, the type of protocol to +// use, SNI configuration for the load balancer, etc. +// +// For example, the following gateway spec sets up a proxy to act as a load +// balancer exposing port 80 and 9080 (http), 443 (https), and port 2379 +// (TCP) for ingress. The gateway will be applied to the proxy running on +// a pod with labels "app: my-gateway-controller". While Istio will configure the +// proxy to listen on these ports, it is the responsibility of the user to +// ensure that external traffic to these ports are allowed into the mesh. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// spec: +// selector: +// app: my-gatweway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 302 redirect for http requests +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE #enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// # no hosts implies wildcard match +// - port: +// number: 2379 #to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// +// The gateway specification above describes the L4-L6 properties of a load +// balancer. A VirtualService can then be bound to a gateway to control +// the forwarding of traffic arriving at a particular host or gateway port. +// +// For example, the following VirtualService splits traffic for +// https://uk.bookinfo.com/reviews, https://eu.bookinfo.com/reviews, +// http://uk.bookinfo.com:9080/reviews, http://eu.bookinfo.com:9080/reviews +// into two versions (prod and qa) of an internal reviews service on port +// 9080. In addition, requests containing the cookie user: dev-123 will be +// sent to special port 7777 in the qa version. The same rule is also +// applicable inside the mesh for requests to the reviews.prod +// service. This rule is applicable across ports 443, 9080. Note that +// http://uk.bookinfo.com gets redirected to https://uk.bookinfo.com +// (i.e. 80 redirects to 443). +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// spec: +// hosts: +// - reviews.prod +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// user: dev-123 +// route: +// - destination: +// port: +// number: 7777 +// name: reviews.qa +// - match: +// uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if its the only port for reviews +// name: reviews.prod +// weight: 80 +// - destination: +// name: reviews.qa +// weight: 20 +// +// The following VirtualService forwards traffic arriving at (external) port +// 2379 from 172.17.16.0/24 subnet to internal Mongo server on port 5555. This +// rule is not applicable internally in the mesh as the gateway list omits +// the reserved name "mesh". +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongosvr #name of Mongo service +// gateways: +// - my-gateway +// tcp: +// - match: +// - port: +// number: 2379 +// sourceSubnet: "172.17.16.0/24" +// route: +// - destination: +// name: mongo.prod +// +type Gateway struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec GatewaySpec `json:"spec"` +} + +type GatewaySpec struct { + // REQUIRED: A list of server specifications. + Servers []Server `json:"servers"` + + // One or more labels that indicate a specific set of pods/VMs + // on which this gateway configuration should be applied. + // If no selectors are provided, the gateway will be implemented by + // the default istio-ingress controller. + Selector map[string]string `json:"selector,omitempty"` +} + +// Server describes the properties of the proxy on a given load balancer port. +// For example, +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-ingress +// spec: +// selector: +// app: my-ingress-controller +// servers: +// - port: +// number: 80 +// name: http2 +// protocol: HTTP2 +// +// Another example +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tcp-ingress +// spec: +// selector: +// app: my-tcp-ingress-controller +// servers: +// - port: +// number: 27018 +// name: mongo +// protocol: MONGO +// +// The following is an example of TLS configuration for port 443 +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tls-ingress +// spec: +// selector: +// app: my-tls-ingress-controller +// servers: +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// tls: +// mode: SIMPLE +// serverCertificate: /etc/certs/server.pem +// privateKey: /etc/certs/privatekey.pem +// +type Server struct { + // REQUIRED: The Port on which the proxy should listen for incoming + // connections + Port Port `json:"port"` + + // A list of hosts exposed by this gateway. While + // typically applicable to HTTP services, it can also be used for TCP + // services using TLS with SNI. Standard DNS wildcard prefix syntax + // is permitted. + // + // A VirtualService that is bound to a gateway must having a matching host + // in its default destination. Specifically one of the VirtualService + // destination hosts is a strict suffix of a gateway host or + // a gateway host is a suffix of one of the VirtualService hosts. + Hosts []string `json:"hosts,omitempty"` + + // Set of TLS related options that govern the server's behavior. Use + // these options to control if all http requests should be redirected to + // https, and the TLS modes to use. + TLS *TLSOptions `json:"tls,omitempty"` +} + +type TLSOptions struct { + // If set to true, the load balancer will send a 302 redirect for all + // http connections, asking the clients to use HTTPS. + HTTPSRedirect bool `json:"httpsRedirect"` + + // Optional: Indicates whether connections to this port should be + // secured using TLS. The value of this field determines how TLS is + // enforced. + Mode TLSMode `json:"mode,omitempty"` + + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file + // holding the server-side TLS certificate to use. + ServerCertificate string `json:"serverCertificate"` + + // REQUIRED if mode is "SIMPLE" or "MUTUAL". The path to the file + // holding the server's private key. + PrivateKey string `json:"privateKey"` + + // REQUIRED if mode is "MUTUAL". The path to a file containing + // certificate authority certificates to use in verifying a presented + // client side certificate. + CaCertificates string `json:"caCertificates"` + + // The credentialName stands for a unique identifier that can be used + // to identify the serverCertificate and the privateKey. The + // credentialName appended with suffix "-cacert" is used to identify + // the CaCertificates associated with this server. Gateway workloads + // capable of fetching credentials from a remote credential store such + // as Kubernetes secrets, will be configured to retrieve the + // serverCertificate and the privateKey using credentialName, instead + // of using the file system paths specified above. If using mutual TLS, + // gateway workload instances will retrieve the CaCertificates using + // credentialName-cacert. The semantics of the name are platform + // dependent. In Kubernetes, the default Istio supplied credential + // server expects the credentialName to match the name of the + // Kubernetes secret that holds the server certificate, the private + // key, and the CA certificate (if using mutual TLS). Set the + // `ISTIO_META_USER_SDS` metadata variable in the gateway's proxy to + // enable the dynamic credential fetching feature. + CredentialName string `json:"credentialName,omitempty"` + + // A list of alternate names to verify the subject identity in the + // certificate presented by the client. + SubjectAltNames []string `json:"subjectAltNames"` +} + +// TLS modes enforced by the proxy +type TLSMode string + +const ( + // If set to "PASSTHROUGH", the proxy will forward the connection + // to the upstream server selected based on the SNI string presented + // by the client. + TLSModePassThrough TLSMode = "PASSTHROUGH" + + // If set to "SIMPLE", the proxy will secure connections with + // standard TLS semantics. + TLSModeSimple TLSMode = "SIMPLE" + + // If set to "MUTUAL", the proxy will secure connections to the + // upstream using mutual TLS by presenting client certificates for + // authentication. + TLSModeMutual TLSMode = "MUTUAL" +) + +// Port describes the properties of a specific port of a service. +type Port struct { + // REQUIRED: A valid non-negative integer port number. + Number int `json:"number"` + + // REQUIRED: The protocol exposed on the port. + // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP. + Protocol PortProtocol `json:"protocol"` + + // Label assigned to the port. + Name string `json:"name,omitempty"` +} + +type PortProtocol string + +const ( + ProtocolHTTP PortProtocol = "HTTP" + ProtocolHTTPS PortProtocol = "HTTPS" + ProtocolGRPC PortProtocol = "GRPC" + ProtocolHTTP2 PortProtocol = "HTTP2" + ProtocolMongo PortProtocol = "Mongo" + ProtocolTCP PortProtocol = "TCP" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// GatewayList is a list of Gateway resources +type GatewayList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Gateway `json:"items"` +} diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go new file mode 100644 index 00000000..0e17d9d9 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/register.go @@ -0,0 +1,58 @@ +/* +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 v1alpha3 + +import ( + "github.com/knative/pkg/apis/istio" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: istio.GroupName, Version: "v1alpha3"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &VirtualService{}, + &Gateway{}, + &DestinationRule{}, + &VirtualServiceList{}, + &GatewayList{}, + &DestinationRuleList{}, + &ServiceEntry{}, + &ServiceEntryList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/service_entry.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/service_entry.go new file mode 100644 index 00000000..76331a2f --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/service_entry.go @@ -0,0 +1,39 @@ +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ServiceEntry struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ServiceEntrySpec `json:"spec"` +} + +type ServiceEntrySpec struct { + Hosts []string `json:"hosts,omitempty"` + Addresses []string `json:"addresses,omitempty"` + Ports []Port `json:"ports,omitempty"` + Location int32 `json:"location,omitempty"` + Resolution int32 `json:"resolution,omitempty"` + Endpoints []ServiceEntry_Endpoint `json:"endpoints,omitempty"` +} + +type ServiceEntry_Endpoint struct { + Address string `json:"address,omitempty"` + Ports map[string]uint32 `json:"ports,omitempty"` + Labels map[string]string `json:"labels,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ServiceEntryList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ServiceEntry `json:"items"` +} diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go new file mode 100644 index 00000000..8798cfa3 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/virtualservice_types.go @@ -0,0 +1,882 @@ +/* +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 v1alpha3 + +import ( + "github.com/knative/pkg/apis/istio/common/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualService +type VirtualService struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VirtualServiceSpec `json:"spec"` +} + +// A VirtualService defines a set of traffic routing rules to apply when a host is +// addressed. Each routing rule defines matching criteria for traffic of a specific +// protocol. If the traffic is matched, then it is sent to a named destination service +// (or subset/version of it) defined in the registry. +// +// The source of traffic can also be matched in a routing rule. This allows routing +// to be customized for specific client contexts. +// +// The following example routes all HTTP traffic by default to +// pods of the reviews service with label "version: v1". In addition, +// HTTP requests containing /wpcatalog/, /consumercatalog/ url prefixes will +// be rewritten to /newcatalog and sent to pods with label "version: v2". The +// rules will be applied at the gateway named "bookinfo" as well as at all +// the sidecars in the mesh (indicated by the reserved gateway name +// "mesh"). +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews +// gateways: # if omitted, defaults to "mesh" +// - bookinfo +// - mesh +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews +// subset: v2 +// - route: +// - destination: +// host: reviews +// subset: v1 +// +// A subset/version of a route destination is identified with a reference +// to a named service subset which must be declared in a corresponding +// DestinationRule. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// +// A host name can be defined by only one VirtualService. A single +// VirtualService can be used to describe traffic properties for multiple +// HTTP and TCP ports. +type VirtualServiceSpec struct { + // REQUIRED. The destination address for traffic captured by this virtual + // service. Could be a DNS name with wildcard prefix or a CIDR + // prefix. Depending on the platform, short-names can also be used + // instead of a FQDN (i.e. has no dots in the name). In such a scenario, + // the FQDN of the host would be derived based on the underlying + // platform. + // + // For example on Kubernetes, when hosts contains a short name, Istio will + // interpret the short name based on the namespace of the rule. Thus, when a + // client namespace applies a rule in the "default" namespace containing a name + // "reviews, Istio will setup routes to the "reviews.default.svc.cluster.local" + // service. However, if a different name such as "reviews.sales.svc.cluster.local" + // is used, it would be treated as a FQDN during virtual host matching. + // In Consul, a plain service name would be resolved to the FQDN + // "reviews.service.consul". + // + // Note that the hosts field applies to both HTTP and TCP + // services. Service inside the mesh, i.e., those found in the service + // registry, must always be referred to using their alphanumeric + // names. IP addresses or CIDR prefixes are allowed only for services + // defined via the Gateway. + Hosts []string `json:"hosts"` + + // The names of gateways and sidecars that should apply these routes. A + // single VirtualService is used for sidecars inside the mesh as well + // as for one or more gateways. The selection condition imposed by this field + // can be overridden using the source field in the match conditions of HTTP/TCP + // routes. The reserved word "mesh" is used to imply all the sidecars in + // the mesh. When this field is omitted, the default gateway ("mesh") + // will be used, which would apply the rule to all sidecars in the + // mesh. If a list of gateway names is provided, the rules will apply + // only to the gateways. To apply the rules to both gateways and sidecars, + // specify "mesh" as one of the gateway names. + Gateways []string `json:"gateways,omitempty"` + + // An ordered list of route rules for HTTP traffic. + // The first rule matching an incoming request is used. + HTTP []HTTPRoute `json:"http,omitempty"` + + // An ordered list of route rules for TCP traffic. + // The first rule matching an incoming request is used. + TCP []TCPRoute `json:"tcp,omitempty"` + + TLS []TLSRoute `json:"tls,omitempty"` +} + +// Describes match conditions and actions for routing HTTP/1.1, HTTP2, and +// gRPC traffic. See VirtualService for usage examples. +type HTTPRoute struct { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []HTTPMatchRequest `json:"match,omitempty"` + + // A http rule can either redirect or forward (default) traffic. The + // forwarding target can be one of several versions of a service (see + // glossary in beginning of document). Weights associated with the + // service version determine the proportion of traffic it receives. + Route []HTTPRouteDestination `json:"route,omitempty"` + + // A http rule can either redirect or forward (default) traffic. If + // traffic passthrough option is specified in the rule, + // route/redirect will be ignored. The redirect primitive can be used to + // send a HTTP 302 redirect to a different URI or Authority. + Redirect *HTTPRedirect `json:"redirect,omitempty"` + + // Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with + // Redirect primitive. Rewrite will be performed before forwarding. + Rewrite *HTTPRewrite `json:"rewrite,omitempty"` + + // Indicates that a HTTP/1.1 client connection to this particular route + // should be allowed (and expected) to upgrade to a WebSocket connection. + // The default is false. Istio's reference sidecar implementation (Envoy) + // expects the first request to this route to contain the WebSocket + // upgrade headers. Otherwise, the request will be rejected. Note that + // Websocket allows secondary protocol negotiation which may then be + // subject to further routing rules based on the protocol selected. + WebsocketUpgrade bool `json:"websocketUpgrade,omitempty"` + + // Timeout for HTTP requests. + Timeout string `json:"timeout,omitempty"` + + // Retry policy for HTTP requests. + Retries *HTTPRetry `json:"retries,omitempty"` + + // Fault injection policy to apply on HTTP traffic. + Fault *HTTPFaultInjection `json:"fault,omitempty"` + + // Mirror HTTP traffic to a another destination in addition to forwarding + // the requests to the intended destination. Mirrored traffic is on a + // best effort basis where the sidecar/gateway will not wait for the + // mirrored cluster to respond before returning the response from the + // original destination. Statistics will be generated for the mirrored + // destination. + Mirror *Destination `json:"mirror,omitempty"` + + // Additional HTTP headers to add before forwarding a request to the + // destination service. + DeprecatedAppendHeaders map[string]string `json:"appendHeaders,omitempty"` + + // Header manipulation rules + Headers *Headers `json:"headers,omitempty"` + + // Http headers to remove before returning the response to the caller + RemoveResponseHeaders map[string]string `json:"removeResponseHeaders,omitempty"` + + // Cross-Origin Resource Sharing policy + CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"` +} + +// Headers describes header manipulation rules. +type Headers struct { + // Header manipulation rules to apply before forwarding a request + // to the destination service + Request *HeaderOperations `json:"request,omitempty"` + + // Header manipulation rules to apply before returning a response + // to the caller + Response *HeaderOperations `json:"response,omitempty"` +} + +// HeaderOperations Describes the header manipulations to apply +type HeaderOperations struct { + // Overwrite the headers specified by key with the given values + Set map[string]string `json:"set,omitempty"` + + // Append the given values to the headers specified by keys + // (will create a comma-separated list of values) + Add map[string]string `json:"add,omitempty"` + + // Remove a the specified headers + Remove []string `json:"remove,omitempty"` +} + +// HttpMatchRequest specifies a set of criterion to be met in order for the +// rule to be applied to the HTTP request. For example, the following +// restricts the rule to match only requests where the URL path +// starts with /ratings/v2/ and the request contains a "cookie" with value +// "user=jason". +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - match: +// - headers: +// cookie: +// regex: "^(.*?;)?(user=jason)(;.*)?" +// uri: +// prefix: "/ratings/v2/" +// route: +// - destination: +// host: ratings +// +// HTTPMatchRequest CANNOT be empty. +type HTTPMatchRequest struct { + // URI to match + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + URI *v1alpha1.StringMatch `json:"uri,omitempty"` + + // URI Scheme + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Scheme *v1alpha1.StringMatch `json:"scheme,omitempty"` + + // HTTP Method + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Method *v1alpha1.StringMatch `json:"method,omitempty"` + + // HTTP Authority + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Authority *v1alpha1.StringMatch `json:"authority,omitempty"` + + // The header keys must be lowercase and use hyphen as the separator, + // e.g. _x-request-id_. + // + // Header values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + // **Note:** The keys `uri`, `scheme`, `method`, and `authority` will be ignored. + Headers map[string]v1alpha1.StringMatch `json:"headers,omitempty"` + + // Specifies the ports on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + Port uint32 `json:"port,omitempty"` + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified at the top, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + SourceLabels map[string]string `json:"sourceLabels,omitempty"` + + // Names of gateways where the rule should be applied to. Gateway names + // at the top of the VirtualService (if any) are overridden. The gateway match is + // independent of sourceLabels. + Gateways []string `json:"gateways,omitempty"` +} + +type HTTPRouteDestination struct { + // REQUIRED. Destination uniquely identifies the instances of a service + // to which the request/connection should be forwarded to. + Destination Destination `json:"destination"` + + // REQUIRED. The proportion of traffic to be forwarded to the service + // version. (0-100). Sum of weights across destinations SHOULD BE == 100. + // If there is only destination in a rule, the weight value is assumed to + // be 100. + Weight int `json:"weight"` + + // Header manipulation rules + Headers *Headers `json:"headers,omitempty"` +} + +// Destination indicates the network addressable service to which the +// request/connection will be sent after processing a routing rule. The +// destination.name should unambiguously refer to a service in the service +// registry. It can be a short name or a fully qualified domain name from +// the service registry, a resolvable DNS name, an IP address or a service +// name from the service registry and a subset name. The order of inference +// is as follows: +// +// 1. Service registry lookup. The entire name is looked up in the service +// registry. If the lookup succeeds, the search terminates. The requests +// will be routed to any instance of the service in the mesh. When the +// service name consists of a single word, the FQDN will be constructed in +// a platform specific manner. For example, in Kubernetes, the namespace +// associated with the routing rule will be used to identify the service as +// .. However, if the service name contains +// multiple words separated by a dot (e.g., reviews.prod), the name in its +// entirety would be looked up in the service registry. +// +// 2. Runtime DNS lookup by the proxy. If step 1 fails, and the name is not +// an IP address, it will be considered as a DNS name that is not in the +// service registry (e.g., wikipedia.org). The sidecar/gateway will resolve +// the DNS and load balance requests appropriately. See Envoy's strict_dns +// for details. +// +// The following example routes all traffic by default to pods of the +// reviews service with label "version: v1" (i.e., subset v1), and some +// to subset v2, in a kubernetes environment. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews # namespace is same as the client/caller's namespace +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews +// subset: v2 +// - route: +// - destination: +// host: reviews +// subset: v1 +// +// And the associated DestinationRule +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// +// The following VirtualService sets a timeout of 5s for all calls to +// productpage.prod service. Notice that there are no subsets defined in +// this rule. Istio will fetch all instances of productpage.prod service +// from the service registry and populate the sidecar's load balancing +// pool. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-productpage-rule +// spec: +// hosts: +// - productpage.prod # in kubernetes, this applies only to prod namespace +// http: +// - timeout: 5s +// route: +// - destination: +// host: productpage.prod +// +// The following sets a timeout of 5s for all calls to the external +// service wikipedia.org, as there is no internal service of that name. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-wiki-rule +// spec: +// hosts: +// - wikipedia.org +// http: +// - timeout: 5s +// route: +// - destination: +// host: wikipedia.org +// +type Destination struct { + // REQUIRED. The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntry](#ServiceEntry). Traffic forwarded to + // destinations that are not found in either of the two, will be dropped. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + Host string `json:"host"` + + // The name of a subset within the service. Applicable only to services + // within the mesh. The subset must be defined in a corresponding + // DestinationRule. + Subset string `json:"subset,omitempty"` + + // Specifies the port on the host that is being addressed. If a service + // exposes only a single port it is not required to explicitly select the + // port. + Port PortSelector `json:"port,omitempty"` +} + +// PortSelector specifies the number of a port to be used for +// matching or selection for final routing. +type PortSelector struct { + // Choose one of the fields below. + + // Valid port number + Number uint32 `json:"number,omitempty"` + + // Valid port name + Name string `json:"name,omitempty"` +} + +// Describes match conditions and actions for routing TCP traffic. The +// following routing rule forwards traffic arriving at port 27017 for +// mongo.prod.svc.cluster.local from 172.17.16.* subnet to another Mongo +// server on port 5555. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongo.prod.svc.cluster.local +// tcp: +// - match: +// - port: 27017 +// sourceSubnet: "172.17.16.0/24" +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 +// ``` +type TCPRoute struct { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []L4MatchAttributes `json:"match"` + + // The destinations to which the connection should be forwarded to. Weights + // must add to 100%. + Route []HTTPRouteDestination `json:"route"` +} + +// Describes match conditions and actions for routing unterminated TLS +// traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS +// traffic arriving at port 443 of gateway called mygateway to internal +// services in the mesh based on the SNI value. +// +// ```yaml +// kind: VirtualService +// metadata: +// name: bookinfo-sni +// spec: +// hosts: +// - '*.bookinfo.com' +// gateways: +// - mygateway +// tls: +// - match: +// - port: 443 +// sniHosts: +// - login.bookinfo.com +// route: +// - destination: +// host: login.prod.svc.cluster.local +// - match: +// - port: 443 +// sniHosts: +// - reviews.bookinfo.com +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// ``` +type TLSRoute struct { + // REQUIRED. Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []TLSMatchAttributes `json:"match"` + + // The destination to which the connection should be forwarded to. + Route []HTTPRouteDestination `json:"route"` +} + +// L4 connection match attributes. Note that L4 connection matching support +// is incomplete. +type L4MatchAttributes struct { + // IPv4 or IPv6 ip address of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + DestinationSubnets []string `json:"destinationSubnets,omitempty"` + + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + Port int `json:"port,omitempty"` + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified at the top, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + SourceLabels map[string]string `json:"sourceLabels,omitempty"` + + // Names of gateways where the rule should be applied to. Gateway names + // at the top of the VirtualService (if any) are overridden. The gateway match is + // independent of sourceLabels. + Gateways []string `json:"gateways,omitempty"` +} + +// TLS connection match attributes. +type TLSMatchAttributes struct { + // REQUIRED. SNI (server name indicator) to match on. Wildcard prefixes + // can be used in the SNI value, e.g., *.com will match foo.example.com + // as well as example.com. An SNI value must be a subset (i.e., fall + // within the domain) of the corresponding virtual service's hosts + SniHosts []string `json:"sniHosts"` + + // IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + DestinationSubnets []string `json:"destinationSubnets,omitempty"` + + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + Port int `json:"port,omitempty"` + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified at the top, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + SourceLabels map[string]string `json:"sourceLabels,omitempty"` + + // Names of gateways where the rule should be applied to. Gateway names + // at the top of the VirtualService (if any) are overridden. The gateway match is + // independent of sourceLabels. + Gateways []string `json:"gateways,omitempty"` +} + +// HTTPRedirect can be used to send a 302 redirect response to the caller, +// where the Authority/Host and the URI in the response can be swapped with +// the specified values. For example, the following rule redirects +// requests for /v1/getProductRatings API on the ratings service to +// /v1/bookRatings provided by the bookratings service. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: bookratings.default.svc.cluster.local +// ... +// +type HTTPRedirect struct { + // On a redirect, overwrite the Path portion of the URL with this + // value. Note that the entire path will be replaced, irrespective of the + // request URI being matched as an exact path or prefix. + URI string `json:"uri,omitempty"` + + // On a redirect, overwrite the Authority/Host portion of the URL with + // this value. + Authority string `json:"authority,omitempty"` +} + +// HTTPRewrite can be used to rewrite specific parts of a HTTP request +// before forwarding the request to the destination. Rewrite primitive can +// be used only with the HTTPRouteDestinations. The following example +// demonstrates how to rewrite the URL prefix for api call (/ratings) to +// ratings service before making the actual API call. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - match: +// - uri: +// prefix: /ratings +// rewrite: +// uri: /v1/bookRatings +// route: +// - destination: +// host: ratings +// subset: v1 +// +type HTTPRewrite struct { + // rewrite the path (or the prefix) portion of the URI with this + // value. If the original URI was matched based on prefix, the value + // provided in this field will replace the corresponding matched prefix. + URI string `json:"uri,omitempty"` + + // rewrite the Authority/Host header with this value. + Authority string `json:"authority,omitempty"` +} + +// Describes the retry policy to use when a HTTP request fails. For +// example, the following rule sets the maximum number of retries to 3 when +// calling ratings:v1 service, with a 2s timeout per retry attempt. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - route: +// - destination: +// host: ratings +// subset: v1 +// retries: +// attempts: 3 +// perTryTimeout: 2s +// +type HTTPRetry struct { + // REQUIRED. Number of retries for a given request. The interval + // between retries will be determined automatically (25ms+). Actual + // number of retries attempted depends on the httpReqTimeout. + Attempts int `json:"attempts"` + + // Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms. + PerTryTimeout string `json:"perTryTimeout"` +} + +// Describes the Cross-Origin Resource Sharing (CORS) policy, for a given +// service. Refer to +// https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS +// for further details about cross origin resource sharing. For example, +// the following rule restricts cross origin requests to those originating +// from example.com domain using HTTP POST/GET, and sets the +// Access-Control-Allow-Credentials header to false. In addition, it only +// exposes X-Foo-bar header and sets an expiry period of 1 day. +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - route: +// - destination: +// host: ratings +// subset: v1 +// corsPolicy: +// allowOrigin: +// - example.com +// allowMethods: +// - POST +// - GET +// allowCredentials: false +// allowHeaders: +// - X-Foo-Bar +// maxAge: "1d" +// +type CorsPolicy struct { + // The list of origins that are allowed to perform CORS requests. The + // content will be serialized into the Access-Control-Allow-Origin + // header. Wildcard * will allow all origins. + AllowOrigin []string `json:"allowOrigin,omitempty"` + + // List of HTTP methods allowed to access the resource. The content will + // be serialized into the Access-Control-Allow-Methods header. + AllowMethods []string `json:"allowMethods,omitempty"` + + // List of HTTP headers that can be used when requesting the + // resource. Serialized to Access-Control-Allow-Methods header. + AllowHeaders []string `json:"allowHeaders,omitempty"` + + // A white list of HTTP headers that the browsers are allowed to + // access. Serialized into Access-Control-Expose-Headers header. + ExposeHeaders []string `json:"exposeHeaders,omitempty"` + + // Specifies how long the results of a preflight request can be + // cached. Translates to the Access-Control-Max-Age header. + MaxAge string `json:"maxAge,omitempty"` + + // Indicates whether the caller is allowed to send the actual request + // (not the preflight) using credentials. Translates to + // Access-Control-Allow-Credentials header. + AllowCredentials bool `json:"allowCredentials,omitempty"` +} + +// HTTPFaultInjection can be used to specify one or more faults to inject +// while forwarding http requests to the destination specified in a route. +// Fault specification is part of a VirtualService rule. Faults include +// aborting the Http request from downstream service, and/or delaying +// proxying of requests. A fault rule MUST HAVE delay or abort or both. +// +// *Note:* Delay and abort faults are independent of one another, even if +// both are specified simultaneously. +type HTTPFaultInjection struct { + // Delay requests before forwarding, emulating various failures such as + // network issues, overloaded upstream service, etc. + Delay *InjectDelay `json:"delay,omitempty"` + + // Abort Http request attempts and return error codes back to downstream + // service, giving the impression that the upstream service is faulty. + Abort *InjectAbort `json:"abort,omitempty"` +} + +// Delay specification is used to inject latency into the request +// forwarding path. The following example will introduce a 5 second delay +// in 10% of the requests to the "v1" version of the "reviews" +// service from all pods with label env: prod +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews +// http: +// - match: +// - sourceLabels: +// env: prod +// route: +// - destination: +// host: reviews +// subset: v1 +// fault: +// delay: +// percent: 10 +// fixedDelay: 5s +// +// The _fixedDelay_ field is used to indicate the amount of delay in +// seconds. An optional _percent_ field, a value between 0 and 100, can +// be used to only delay a certain percentage of requests. If left +// unspecified, all request will be delayed. +type InjectDelay struct { + // Percentage of requests on which the delay will be injected (0-100). + Percent int `json:"percent,omitempty"` + + // REQUIRED. Add a fixed delay before forwarding the request. Format: + // 1h/1m/1s/1ms. MUST be >=1ms. + FixedDelay string `json:"fixedDelay"` + + // (-- Add a delay (based on an exponential function) before forwarding + // the request. mean delay needed to derive the exponential delay + // values --) + ExponentialDelay string `json:"exponentialDelay,omitempty"` +} + +// Abort specification is used to prematurely abort a request with a +// pre-specified error code. The following example will return an HTTP +// 400 error code for 10% of the requests to the "ratings" service "v1". +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings +// http: +// - route: +// - destination: +// host: ratings +// subset: v1 +// fault: +// abort: +// percent: 10 +// httpStatus: 400 +// +// The _httpStatus_ field is used to indicate the HTTP status code to +// return to the caller. The optional _percent_ field, a value between 0 +// and 100, is used to only abort a certain percentage of requests. If +// not specified, all requests are aborted. +type InjectAbort struct { + // Percentage of requests to be aborted with the error code provided (0-100). + Percent int `json:"percent,omitempty"` + + // REQUIRED. HTTP status code to use to abort the Http request. + HTTPStatus int `json:"httpStatus"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// VirtualServiceList is a list of VirtualService resources +type VirtualServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []VirtualService `json:"items"` +} diff --git a/vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go new file mode 100644 index 00000000..b4e7f835 --- /dev/null +++ b/vendor/github.com/knative/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go @@ -0,0 +1,1287 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 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. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha1 "github.com/knative/pkg/apis/istio/common/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionPoolSettings) DeepCopyInto(out *ConnectionPoolSettings) { + *out = *in + if in.TCP != nil { + in, out := &in.TCP, &out.TCP + *out = new(TCPSettings) + **out = **in + } + if in.HTTP != nil { + in, out := &in.HTTP, &out.HTTP + *out = new(HTTPSettings) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSettings. +func (in *ConnectionPoolSettings) DeepCopy() *ConnectionPoolSettings { + if in == nil { + return nil + } + out := new(ConnectionPoolSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsistentHashLB) DeepCopyInto(out *ConsistentHashLB) { + *out = *in + if in.HTTPCookie != nil { + in, out := &in.HTTPCookie, &out.HTTPCookie + *out = new(HTTPCookie) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsistentHashLB. +func (in *ConsistentHashLB) DeepCopy() *ConsistentHashLB { + if in == nil { + return nil + } + out := new(ConsistentHashLB) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CorsPolicy) DeepCopyInto(out *CorsPolicy) { + *out = *in + if in.AllowOrigin != nil { + in, out := &in.AllowOrigin, &out.AllowOrigin + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowMethods != nil { + in, out := &in.AllowMethods, &out.AllowMethods + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AllowHeaders != nil { + in, out := &in.AllowHeaders, &out.AllowHeaders + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExposeHeaders != nil { + in, out := &in.ExposeHeaders, &out.ExposeHeaders + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorsPolicy. +func (in *CorsPolicy) DeepCopy() *CorsPolicy { + if in == nil { + return nil + } + out := new(CorsPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Destination) DeepCopyInto(out *Destination) { + *out = *in + out.Port = in.Port + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. +func (in *Destination) DeepCopy() *Destination { + if in == nil { + return nil + } + out := new(Destination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRule) DeepCopyInto(out *DestinationRule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRule. +func (in *DestinationRule) DeepCopy() *DestinationRule { + if in == nil { + return nil + } + out := new(DestinationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleList) DeepCopyInto(out *DestinationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DestinationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleList. +func (in *DestinationRuleList) DeepCopy() *DestinationRuleList { + if in == nil { + return nil + } + out := new(DestinationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleSpec) DeepCopyInto(out *DestinationRuleSpec) { + *out = *in + if in.TrafficPolicy != nil { + in, out := &in.TrafficPolicy, &out.TrafficPolicy + *out = new(TrafficPolicy) + (*in).DeepCopyInto(*out) + } + if in.Subsets != nil { + in, out := &in.Subsets, &out.Subsets + *out = make([]Subset, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleSpec. +func (in *DestinationRuleSpec) DeepCopy() *DestinationRuleSpec { + if in == nil { + return nil + } + out := new(DestinationRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gateway) DeepCopyInto(out *Gateway) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Gateway) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayList) DeepCopyInto(out *GatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Gateway, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. +func (in *GatewayList) DeepCopy() *GatewayList { + if in == nil { + return nil + } + out := new(GatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { + *out = *in + if in.Servers != nil { + in, out := &in.Servers, &out.Servers + *out = make([]Server, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. +func (in *GatewaySpec) DeepCopy() *GatewaySpec { + if in == nil { + return nil + } + out := new(GatewaySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPCookie) DeepCopyInto(out *HTTPCookie) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPCookie. +func (in *HTTPCookie) DeepCopy() *HTTPCookie { + if in == nil { + return nil + } + out := new(HTTPCookie) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPFaultInjection) DeepCopyInto(out *HTTPFaultInjection) { + *out = *in + if in.Delay != nil { + in, out := &in.Delay, &out.Delay + *out = new(InjectDelay) + **out = **in + } + if in.Abort != nil { + in, out := &in.Abort, &out.Abort + *out = new(InjectAbort) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection. +func (in *HTTPFaultInjection) DeepCopy() *HTTPFaultInjection { + if in == nil { + return nil + } + out := new(HTTPFaultInjection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPMatchRequest) DeepCopyInto(out *HTTPMatchRequest) { + *out = *in + if in.URI != nil { + in, out := &in.URI, &out.URI + *out = new(v1alpha1.StringMatch) + **out = **in + } + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(v1alpha1.StringMatch) + **out = **in + } + if in.Method != nil { + in, out := &in.Method, &out.Method + *out = new(v1alpha1.StringMatch) + **out = **in + } + if in.Authority != nil { + in, out := &in.Authority, &out.Authority + *out = new(v1alpha1.StringMatch) + **out = **in + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make(map[string]v1alpha1.StringMatch, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SourceLabels != nil { + in, out := &in.SourceLabels, &out.SourceLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest. +func (in *HTTPMatchRequest) DeepCopy() *HTTPMatchRequest { + if in == nil { + return nil + } + out := new(HTTPMatchRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRedirect) DeepCopyInto(out *HTTPRedirect) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRedirect. +func (in *HTTPRedirect) DeepCopy() *HTTPRedirect { + if in == nil { + return nil + } + out := new(HTTPRedirect) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRetry) DeepCopyInto(out *HTTPRetry) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRetry. +func (in *HTTPRetry) DeepCopy() *HTTPRetry { + if in == nil { + return nil + } + out := new(HTTPRetry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRewrite) DeepCopyInto(out *HTTPRewrite) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRewrite. +func (in *HTTPRewrite) DeepCopy() *HTTPRewrite { + if in == nil { + return nil + } + out := new(HTTPRewrite) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { + *out = *in + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]HTTPMatchRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = make([]HTTPRouteDestination, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Redirect != nil { + in, out := &in.Redirect, &out.Redirect + *out = new(HTTPRedirect) + **out = **in + } + if in.Rewrite != nil { + in, out := &in.Rewrite, &out.Rewrite + *out = new(HTTPRewrite) + **out = **in + } + if in.Retries != nil { + in, out := &in.Retries, &out.Retries + *out = new(HTTPRetry) + **out = **in + } + if in.Fault != nil { + in, out := &in.Fault, &out.Fault + *out = new(HTTPFaultInjection) + (*in).DeepCopyInto(*out) + } + if in.Mirror != nil { + in, out := &in.Mirror, &out.Mirror + *out = new(Destination) + **out = **in + } + if in.DeprecatedAppendHeaders != nil { + in, out := &in.DeprecatedAppendHeaders, &out.DeprecatedAppendHeaders + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = new(Headers) + (*in).DeepCopyInto(*out) + } + if in.RemoveResponseHeaders != nil { + in, out := &in.RemoveResponseHeaders, &out.RemoveResponseHeaders + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CorsPolicy != nil { + in, out := &in.CorsPolicy, &out.CorsPolicy + *out = new(CorsPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. +func (in *HTTPRoute) DeepCopy() *HTTPRoute { + if in == nil { + return nil + } + out := new(HTTPRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPRouteDestination) DeepCopyInto(out *HTTPRouteDestination) { + *out = *in + out.Destination = in.Destination + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = new(Headers) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteDestination. +func (in *HTTPRouteDestination) DeepCopy() *HTTPRouteDestination { + if in == nil { + return nil + } + out := new(HTTPRouteDestination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPSettings) DeepCopyInto(out *HTTPSettings) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPSettings. +func (in *HTTPSettings) DeepCopy() *HTTPSettings { + if in == nil { + return nil + } + out := new(HTTPSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HeaderOperations) DeepCopyInto(out *HeaderOperations) { + *out = *in + if in.Set != nil { + in, out := &in.Set, &out.Set + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Add != nil { + in, out := &in.Add, &out.Add + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Remove != nil { + in, out := &in.Remove, &out.Remove + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HeaderOperations. +func (in *HeaderOperations) DeepCopy() *HeaderOperations { + if in == nil { + return nil + } + out := new(HeaderOperations) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Headers) DeepCopyInto(out *Headers) { + *out = *in + if in.Request != nil { + in, out := &in.Request, &out.Request + *out = new(HeaderOperations) + (*in).DeepCopyInto(*out) + } + if in.Response != nil { + in, out := &in.Response, &out.Response + *out = new(HeaderOperations) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Headers. +func (in *Headers) DeepCopy() *Headers { + if in == nil { + return nil + } + out := new(Headers) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InjectAbort) DeepCopyInto(out *InjectAbort) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InjectAbort. +func (in *InjectAbort) DeepCopy() *InjectAbort { + if in == nil { + return nil + } + out := new(InjectAbort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InjectDelay) DeepCopyInto(out *InjectDelay) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InjectDelay. +func (in *InjectDelay) DeepCopy() *InjectDelay { + if in == nil { + return nil + } + out := new(InjectDelay) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *L4MatchAttributes) DeepCopyInto(out *L4MatchAttributes) { + *out = *in + if in.DestinationSubnets != nil { + in, out := &in.DestinationSubnets, &out.DestinationSubnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceLabels != nil { + in, out := &in.SourceLabels, &out.SourceLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new L4MatchAttributes. +func (in *L4MatchAttributes) DeepCopy() *L4MatchAttributes { + if in == nil { + return nil + } + out := new(L4MatchAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerSettings) DeepCopyInto(out *LoadBalancerSettings) { + *out = *in + if in.ConsistentHash != nil { + in, out := &in.ConsistentHash, &out.ConsistentHash + *out = new(ConsistentHashLB) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSettings. +func (in *LoadBalancerSettings) DeepCopy() *LoadBalancerSettings { + if in == nil { + return nil + } + out := new(LoadBalancerSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutlierDetection) DeepCopyInto(out *OutlierDetection) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutlierDetection. +func (in *OutlierDetection) DeepCopy() *OutlierDetection { + if in == nil { + return nil + } + out := new(OutlierDetection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Port) DeepCopyInto(out *Port) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port. +func (in *Port) DeepCopy() *Port { + if in == nil { + return nil + } + out := new(Port) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortSelector) DeepCopyInto(out *PortSelector) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortSelector. +func (in *PortSelector) DeepCopy() *PortSelector { + if in == nil { + return nil + } + out := new(PortSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PortTrafficPolicy) DeepCopyInto(out *PortTrafficPolicy) { + *out = *in + out.Port = in.Port + if in.LoadBalancer != nil { + in, out := &in.LoadBalancer, &out.LoadBalancer + *out = new(LoadBalancerSettings) + (*in).DeepCopyInto(*out) + } + if in.ConnectionPool != nil { + in, out := &in.ConnectionPool, &out.ConnectionPool + *out = new(ConnectionPoolSettings) + (*in).DeepCopyInto(*out) + } + if in.OutlierDetection != nil { + in, out := &in.OutlierDetection, &out.OutlierDetection + *out = new(OutlierDetection) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSSettings) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortTrafficPolicy. +func (in *PortTrafficPolicy) DeepCopy() *PortTrafficPolicy { + if in == nil { + return nil + } + out := new(PortTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Server) DeepCopyInto(out *Server) { + *out = *in + out.Port = in.Port + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSOptions) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Server. +func (in *Server) DeepCopy() *Server { + if in == nil { + return nil + } + out := new(Server) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntry) DeepCopyInto(out *ServiceEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntry. +func (in *ServiceEntry) DeepCopy() *ServiceEntry { + if in == nil { + return nil + } + out := new(ServiceEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntryList) DeepCopyInto(out *ServiceEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntryList. +func (in *ServiceEntryList) DeepCopy() *ServiceEntryList { + if in == nil { + return nil + } + out := new(ServiceEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntrySpec) DeepCopyInto(out *ServiceEntrySpec) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]Port, len(*in)) + copy(*out, *in) + } + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]ServiceEntry_Endpoint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntrySpec. +func (in *ServiceEntrySpec) DeepCopy() *ServiceEntrySpec { + if in == nil { + return nil + } + out := new(ServiceEntrySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceEntry_Endpoint) DeepCopyInto(out *ServiceEntry_Endpoint) { + *out = *in + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make(map[string]uint32, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntry_Endpoint. +func (in *ServiceEntry_Endpoint) DeepCopy() *ServiceEntry_Endpoint { + if in == nil { + return nil + } + out := new(ServiceEntry_Endpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subset) DeepCopyInto(out *Subset) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.TrafficPolicy != nil { + in, out := &in.TrafficPolicy, &out.TrafficPolicy + *out = new(TrafficPolicy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subset. +func (in *Subset) DeepCopy() *Subset { + if in == nil { + return nil + } + out := new(Subset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { + *out = *in + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]L4MatchAttributes, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = make([]HTTPRouteDestination, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPRoute. +func (in *TCPRoute) DeepCopy() *TCPRoute { + if in == nil { + return nil + } + out := new(TCPRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TCPSettings) DeepCopyInto(out *TCPSettings) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPSettings. +func (in *TCPSettings) DeepCopy() *TCPSettings { + if in == nil { + return nil + } + out := new(TCPSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSMatchAttributes) DeepCopyInto(out *TLSMatchAttributes) { + *out = *in + if in.SniHosts != nil { + in, out := &in.SniHosts, &out.SniHosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.DestinationSubnets != nil { + in, out := &in.DestinationSubnets, &out.DestinationSubnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceLabels != nil { + in, out := &in.SourceLabels, &out.SourceLabels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSMatchAttributes. +func (in *TLSMatchAttributes) DeepCopy() *TLSMatchAttributes { + if in == nil { + return nil + } + out := new(TLSMatchAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSOptions) DeepCopyInto(out *TLSOptions) { + *out = *in + if in.SubjectAltNames != nil { + in, out := &in.SubjectAltNames, &out.SubjectAltNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSOptions. +func (in *TLSOptions) DeepCopy() *TLSOptions { + if in == nil { + return nil + } + out := new(TLSOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSRoute) DeepCopyInto(out *TLSRoute) { + *out = *in + if in.Match != nil { + in, out := &in.Match, &out.Match + *out = make([]TLSMatchAttributes, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Route != nil { + in, out := &in.Route, &out.Route + *out = make([]HTTPRouteDestination, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSRoute. +func (in *TLSRoute) DeepCopy() *TLSRoute { + if in == nil { + return nil + } + out := new(TLSRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSSettings) DeepCopyInto(out *TLSSettings) { + *out = *in + if in.SubjectAltNames != nil { + in, out := &in.SubjectAltNames, &out.SubjectAltNames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSSettings. +func (in *TLSSettings) DeepCopy() *TLSSettings { + if in == nil { + return nil + } + out := new(TLSSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TrafficPolicy) DeepCopyInto(out *TrafficPolicy) { + *out = *in + if in.LoadBalancer != nil { + in, out := &in.LoadBalancer, &out.LoadBalancer + *out = new(LoadBalancerSettings) + (*in).DeepCopyInto(*out) + } + if in.ConnectionPool != nil { + in, out := &in.ConnectionPool, &out.ConnectionPool + *out = new(ConnectionPoolSettings) + (*in).DeepCopyInto(*out) + } + if in.OutlierDetection != nil { + in, out := &in.OutlierDetection, &out.OutlierDetection + *out = new(OutlierDetection) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSSettings) + (*in).DeepCopyInto(*out) + } + if in.PortLevelSettings != nil { + in, out := &in.PortLevelSettings, &out.PortLevelSettings + *out = make([]PortTrafficPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficPolicy. +func (in *TrafficPolicy) DeepCopy() *TrafficPolicy { + if in == nil { + return nil + } + out := new(TrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualService) DeepCopyInto(out *VirtualService) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualService. +func (in *VirtualService) DeepCopy() *VirtualService { + if in == nil { + return nil + } + out := new(VirtualService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualService) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceList) DeepCopyInto(out *VirtualServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]VirtualService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceList. +func (in *VirtualServiceList) DeepCopy() *VirtualServiceList { + if in == nil { + return nil + } + out := new(VirtualServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceSpec) DeepCopyInto(out *VirtualServiceSpec) { + *out = *in + if in.Hosts != nil { + in, out := &in.Hosts, &out.Hosts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Gateways != nil { + in, out := &in.Gateways, &out.Gateways + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.HTTP != nil { + in, out := &in.HTTP, &out.HTTP + *out = make([]HTTPRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TCP != nil { + in, out := &in.TCP, &out.TCP + *out = make([]TCPRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = make([]TLSRoute, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceSpec. +func (in *VirtualServiceSpec) DeepCopy() *VirtualServiceSpec { + if in == nil { + return nil + } + out := new(VirtualServiceSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/knative/pkg/code-of-conduct.md b/vendor/github.com/knative/pkg/code-of-conduct.md new file mode 100644 index 00000000..5f04b318 --- /dev/null +++ b/vendor/github.com/knative/pkg/code-of-conduct.md @@ -0,0 +1,75 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at +knative-code-of-conduct@googlegroups.com. All complaints will be reviewed and +investigated and will result in a response that is deemed necessary and +appropriate to the circumstances. The project team is obligated to maintain +confidentiality with regard to the reporter of an incident. Further details of +specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org From bd5a9e3e53eff0df4d8bda7cd7c6ea12b05c22c7 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Mon, 17 Jun 2019 10:50:12 +0800 Subject: [PATCH 2/3] Add istio VirtualService and DestinationRule types --- apis/project.cattle.io/v3/schema/schema.go | 20 +++++++++++++++++++- config/context.go | 14 ++++++++++++++ main.go | 8 ++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/apis/project.cattle.io/v3/schema/schema.go b/apis/project.cattle.io/v3/schema/schema.go index 5b6190fb..f58fecad 100644 --- a/apis/project.cattle.io/v3/schema/schema.go +++ b/apis/project.cattle.io/v3/schema/schema.go @@ -4,6 +4,7 @@ import ( "net/http" monitoringv1 "github.com/coreos/prometheus-operator/pkg/client/monitoring/v1" + istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" "github.com/rancher/norman/types" m "github.com/rancher/norman/types/mapper" v3 "github.com/rancher/types/apis/project.cattle.io/v3" @@ -46,7 +47,8 @@ var ( Init(appTypes). Init(pipelineTypes). Init(monitoringTypes). - Init(autoscalingTypes) + Init(autoscalingTypes). + Init(istioTypes) ) func configMapTypes(schemas *types.Schemas) *types.Schemas { @@ -1088,3 +1090,19 @@ func autoscalingTypes(schemas *types.Schemas) *types.Schemas { Description string `json:"description,omitempty"` }{}) } + +func istioTypes(schemas *types.Schemas) *types.Schemas { + return schemas. + MustImport(&Version, istiov1alpha3.HTTPMatchRequest{}, struct { + Port *uint32 `json:"port,omitempty"` + }{}). + MustImport(&Version, istiov1alpha3.HTTPRoute{}, struct { + WebsocketUpgrade *bool `json:"websocketUpgrade,omitempty"` + }{}). + MustImport(&Version, istiov1alpha3.VirtualService{}, projectOverride{}, struct { + Status interface{} + }{}). + MustImport(&Version, istiov1alpha3.DestinationRule{}, projectOverride{}, struct { + Status interface{} + }{}) +} diff --git a/config/context.go b/config/context.go index 5250521e..5b602534 100644 --- a/config/context.go +++ b/config/context.go @@ -20,6 +20,7 @@ import ( managementv3 "github.com/rancher/types/apis/management.cattle.io/v3" managementSchema "github.com/rancher/types/apis/management.cattle.io/v3/schema" monitoringv1 "github.com/rancher/types/apis/monitoring.coreos.com/v1" + istiov1alpha3 "github.com/rancher/types/apis/networking.istio.io/v1alpha3" knetworkingv1 "github.com/rancher/types/apis/networking.k8s.io/v1" projectv3 "github.com/rancher/types/apis/project.cattle.io/v3" projectSchema "github.com/rancher/types/apis/project.cattle.io/v3/schema" @@ -189,6 +190,7 @@ type UserContext struct { Networking knetworkingv1.Interface Monitoring monitoringv1.Interface Cluster clusterv3.Interface + Istio istiov1alpha3.Interface } func (w *UserContext) controllers() []controller.Starter { @@ -224,6 +226,7 @@ func (w *UserContext) UserOnlyContext() *UserOnlyContext { BatchV1Beta1: w.BatchV1Beta1, Monitoring: w.Monitoring, Cluster: w.Cluster, + Istio: w.Istio, } } @@ -244,6 +247,7 @@ type UserOnlyContext struct { BatchV1Beta1 batchv1beta1.Interface Monitoring monitoringv1.Interface Cluster clusterv3.Interface + Istio istiov1alpha3.Interface } func (w *UserOnlyContext) controllers() []controller.Starter { @@ -408,6 +412,11 @@ func NewUserContext(scaledContext *ScaledContext, config rest.Config, clusterNam return nil, err } + context.Istio, err = istiov1alpha3.NewForConfig(config) + if err != nil { + return nil, err + } + dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil { dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer @@ -497,6 +506,11 @@ func NewUserOnlyContext(config rest.Config) (*UserOnlyContext, error) { return nil, err } + context.Istio, err = istiov1alpha3.NewForConfig(config) + if err != nil { + return nil, err + } + dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil { dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer diff --git a/main.go b/main.go index 6b978f3c..ef84f8c1 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ package main import ( monitoringv1 "github.com/coreos/prometheus-operator/pkg/client/monitoring/v1" + istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" clusterSchema "github.com/rancher/types/apis/cluster.cattle.io/v3/schema" managementSchema "github.com/rancher/types/apis/management.cattle.io/v3/schema" publicSchema "github.com/rancher/types/apis/management.cattle.io/v3public/schema" @@ -96,4 +97,11 @@ func main() { }, []interface{}{}, ) + generator.GenerateNativeTypes(istiov1alpha3.SchemeGroupVersion, + []interface{}{ + istiov1alpha3.VirtualService{}, + istiov1alpha3.DestinationRule{}, + }, + []interface{}{}, + ) } From a0afba4d18291b412621ae54ad80b1a8aea898c8 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Mon, 17 Jun 2019 17:40:23 +0800 Subject: [PATCH 3/3] go generate --- .../zz_generated_destination_rule_mock.go | 1741 +++++++++++++++++ .../zz_generated_virtual_service_mock.go | 1741 +++++++++++++++++ .../v1alpha3/zz_generated_deepcopy.go | 72 + ...z_generated_destination_rule_controller.go | 506 +++++ ...ated_destination_rule_lifecycle_adapter.go | 63 + .../v1alpha3/zz_generated_k8s_client.go | 139 ++ .../v1alpha3/zz_generated_scheme.go | 42 + ...zz_generated_virtual_service_controller.go | 506 +++++ ...rated_virtual_service_lifecycle_adapter.go | 63 + client/project/v3/zz_generated_client.go | 4 + .../zz_generated_connection_pool_settings.go | 12 + .../v3/zz_generated_consistent_hash_lb.go | 16 + client/project/v3/zz_generated_cors_policy.go | 20 + client/project/v3/zz_generated_destination.go | 14 + .../v3/zz_generated_destination_rule.go | 117 ++ .../v3/zz_generated_destination_rule_spec.go | 14 + .../v3/zz_generated_header_operations.go | 14 + client/project/v3/zz_generated_headers.go | 12 + client/project/v3/zz_generated_http_cookie.go | 14 + .../v3/zz_generated_http_fault_injection.go | 12 + .../v3/zz_generated_http_match_request.go | 24 + .../project/v3/zz_generated_http_redirect.go | 12 + client/project/v3/zz_generated_http_retry.go | 12 + .../project/v3/zz_generated_http_rewrite.go | 12 + client/project/v3/zz_generated_http_route.go | 34 + .../v3/zz_generated_http_route_destination.go | 14 + .../project/v3/zz_generated_http_settings.go | 16 + .../project/v3/zz_generated_inject_abort.go | 12 + .../project/v3/zz_generated_inject_delay.go | 14 + .../v3/zz_generated_l4match_attributes.go | 16 + .../v3/zz_generated_load_balancer_settings.go | 12 + .../v3/zz_generated_outlier_detection.go | 16 + .../project/v3/zz_generated_port_selector.go | 12 + .../v3/zz_generated_port_traffic_policy.go | 18 + .../project/v3/zz_generated_string_match.go | 16 + client/project/v3/zz_generated_subset.go | 14 + client/project/v3/zz_generated_tcp_route.go | 12 + .../project/v3/zz_generated_tcp_settings.go | 12 + .../v3/zz_generated_tls_match_attributes.go | 18 + client/project/v3/zz_generated_tls_route.go | 12 + .../project/v3/zz_generated_tls_settings.go | 20 + .../project/v3/zz_generated_traffic_policy.go | 18 + .../v3/zz_generated_virtual_service.go | 121 ++ .../v3/zz_generated_virtual_service_spec.go | 18 + compose/zz_generated_compose.go | 2 + 45 files changed, 5609 insertions(+) create mode 100644 apis/networking.istio.io/v1alpha3/fakes/zz_generated_destination_rule_mock.go create mode 100644 apis/networking.istio.io/v1alpha3/fakes/zz_generated_virtual_service_mock.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_deepcopy.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_controller.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_lifecycle_adapter.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_k8s_client.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_scheme.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_controller.go create mode 100644 apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_lifecycle_adapter.go create mode 100644 client/project/v3/zz_generated_connection_pool_settings.go create mode 100644 client/project/v3/zz_generated_consistent_hash_lb.go create mode 100644 client/project/v3/zz_generated_cors_policy.go create mode 100644 client/project/v3/zz_generated_destination.go create mode 100644 client/project/v3/zz_generated_destination_rule.go create mode 100644 client/project/v3/zz_generated_destination_rule_spec.go create mode 100644 client/project/v3/zz_generated_header_operations.go create mode 100644 client/project/v3/zz_generated_headers.go create mode 100644 client/project/v3/zz_generated_http_cookie.go create mode 100644 client/project/v3/zz_generated_http_fault_injection.go create mode 100644 client/project/v3/zz_generated_http_match_request.go create mode 100644 client/project/v3/zz_generated_http_redirect.go create mode 100644 client/project/v3/zz_generated_http_retry.go create mode 100644 client/project/v3/zz_generated_http_rewrite.go create mode 100644 client/project/v3/zz_generated_http_route.go create mode 100644 client/project/v3/zz_generated_http_route_destination.go create mode 100644 client/project/v3/zz_generated_http_settings.go create mode 100644 client/project/v3/zz_generated_inject_abort.go create mode 100644 client/project/v3/zz_generated_inject_delay.go create mode 100644 client/project/v3/zz_generated_l4match_attributes.go create mode 100644 client/project/v3/zz_generated_load_balancer_settings.go create mode 100644 client/project/v3/zz_generated_outlier_detection.go create mode 100644 client/project/v3/zz_generated_port_selector.go create mode 100644 client/project/v3/zz_generated_port_traffic_policy.go create mode 100644 client/project/v3/zz_generated_string_match.go create mode 100644 client/project/v3/zz_generated_subset.go create mode 100644 client/project/v3/zz_generated_tcp_route.go create mode 100644 client/project/v3/zz_generated_tcp_settings.go create mode 100644 client/project/v3/zz_generated_tls_match_attributes.go create mode 100644 client/project/v3/zz_generated_tls_route.go create mode 100644 client/project/v3/zz_generated_tls_settings.go create mode 100644 client/project/v3/zz_generated_traffic_policy.go create mode 100644 client/project/v3/zz_generated_virtual_service.go create mode 100644 client/project/v3/zz_generated_virtual_service_spec.go diff --git a/apis/networking.istio.io/v1alpha3/fakes/zz_generated_destination_rule_mock.go b/apis/networking.istio.io/v1alpha3/fakes/zz_generated_destination_rule_mock.go new file mode 100644 index 00000000..5b801c79 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/fakes/zz_generated_destination_rule_mock.go @@ -0,0 +1,1741 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + + v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v1alpha3a "github.com/rancher/types/apis/networking.istio.io/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockDestinationRuleListerMockGet sync.RWMutex + lockDestinationRuleListerMockList sync.RWMutex +) + +// Ensure, that DestinationRuleListerMock does implement DestinationRuleLister. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.DestinationRuleLister = &DestinationRuleListerMock{} + +// DestinationRuleListerMock is a mock implementation of DestinationRuleLister. +// +// func TestSomethingThatUsesDestinationRuleLister(t *testing.T) { +// +// // make and configure a mocked DestinationRuleLister +// mockedDestinationRuleLister := &DestinationRuleListerMock{ +// GetFunc: func(namespace string, name string) (*v1alpha3.DestinationRule, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v1alpha3.DestinationRule, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedDestinationRuleLister in code that requires DestinationRuleLister +// // and then make assertions. +// +// } +type DestinationRuleListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v1alpha3.DestinationRule, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v1alpha3.DestinationRule, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *DestinationRuleListerMock) Get(namespace string, name string) (*v1alpha3.DestinationRule, error) { + if mock.GetFunc == nil { + panic("DestinationRuleListerMock.GetFunc: method is nil but DestinationRuleLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockDestinationRuleListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockDestinationRuleListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedDestinationRuleLister.GetCalls()) +func (mock *DestinationRuleListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockDestinationRuleListerMockGet.RLock() + calls = mock.calls.Get + lockDestinationRuleListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *DestinationRuleListerMock) List(namespace string, selector labels.Selector) ([]*v1alpha3.DestinationRule, error) { + if mock.ListFunc == nil { + panic("DestinationRuleListerMock.ListFunc: method is nil but DestinationRuleLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockDestinationRuleListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockDestinationRuleListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedDestinationRuleLister.ListCalls()) +func (mock *DestinationRuleListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockDestinationRuleListerMockList.RLock() + calls = mock.calls.List + lockDestinationRuleListerMockList.RUnlock() + return calls +} + +var ( + lockDestinationRuleControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockDestinationRuleControllerMockAddClusterScopedHandler sync.RWMutex + lockDestinationRuleControllerMockAddFeatureHandler sync.RWMutex + lockDestinationRuleControllerMockAddHandler sync.RWMutex + lockDestinationRuleControllerMockEnqueue sync.RWMutex + lockDestinationRuleControllerMockGeneric sync.RWMutex + lockDestinationRuleControllerMockInformer sync.RWMutex + lockDestinationRuleControllerMockLister sync.RWMutex + lockDestinationRuleControllerMockStart sync.RWMutex + lockDestinationRuleControllerMockSync sync.RWMutex +) + +// Ensure, that DestinationRuleControllerMock does implement DestinationRuleController. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.DestinationRuleController = &DestinationRuleControllerMock{} + +// DestinationRuleControllerMock is a mock implementation of DestinationRuleController. +// +// func TestSomethingThatUsesDestinationRuleController(t *testing.T) { +// +// // make and configure a mocked DestinationRuleController +// mockedDestinationRuleController := &DestinationRuleControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v1alpha3a.DestinationRuleLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedDestinationRuleController in code that requires DestinationRuleController +// // and then make assertions. +// +// } +type DestinationRuleControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v1alpha3a.DestinationRuleHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v1alpha3a.DestinationRuleLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v1alpha3a.DestinationRuleHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v1alpha3a.DestinationRuleHandlerFunc + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.DestinationRuleHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v1alpha3a.DestinationRuleHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *DestinationRuleControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("DestinationRuleControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but DestinationRuleController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockDestinationRuleControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockDestinationRuleControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedDestinationRuleController.AddClusterScopedFeatureHandlerCalls()) +func (mock *DestinationRuleControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockDestinationRuleControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *DestinationRuleControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("DestinationRuleControllerMock.AddClusterScopedHandlerFunc: method is nil but DestinationRuleController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockDestinationRuleControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockDestinationRuleControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedDestinationRuleController.AddClusterScopedHandlerCalls()) +func (mock *DestinationRuleControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockDestinationRuleControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *DestinationRuleControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("DestinationRuleControllerMock.AddFeatureHandlerFunc: method is nil but DestinationRuleController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockDestinationRuleControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockDestinationRuleControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedDestinationRuleController.AddFeatureHandlerCalls()) +func (mock *DestinationRuleControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockDestinationRuleControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *DestinationRuleControllerMock) AddHandler(ctx context.Context, name string, handler v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("DestinationRuleControllerMock.AddHandlerFunc: method is nil but DestinationRuleController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockDestinationRuleControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockDestinationRuleControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedDestinationRuleController.AddHandlerCalls()) +func (mock *DestinationRuleControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockDestinationRuleControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *DestinationRuleControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("DestinationRuleControllerMock.EnqueueFunc: method is nil but DestinationRuleController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockDestinationRuleControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockDestinationRuleControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedDestinationRuleController.EnqueueCalls()) +func (mock *DestinationRuleControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockDestinationRuleControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockDestinationRuleControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *DestinationRuleControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("DestinationRuleControllerMock.GenericFunc: method is nil but DestinationRuleController.Generic was just called") + } + callInfo := struct { + }{} + lockDestinationRuleControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockDestinationRuleControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedDestinationRuleController.GenericCalls()) +func (mock *DestinationRuleControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockDestinationRuleControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockDestinationRuleControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *DestinationRuleControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("DestinationRuleControllerMock.InformerFunc: method is nil but DestinationRuleController.Informer was just called") + } + callInfo := struct { + }{} + lockDestinationRuleControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockDestinationRuleControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedDestinationRuleController.InformerCalls()) +func (mock *DestinationRuleControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockDestinationRuleControllerMockInformer.RLock() + calls = mock.calls.Informer + lockDestinationRuleControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *DestinationRuleControllerMock) Lister() v1alpha3a.DestinationRuleLister { + if mock.ListerFunc == nil { + panic("DestinationRuleControllerMock.ListerFunc: method is nil but DestinationRuleController.Lister was just called") + } + callInfo := struct { + }{} + lockDestinationRuleControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockDestinationRuleControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedDestinationRuleController.ListerCalls()) +func (mock *DestinationRuleControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockDestinationRuleControllerMockLister.RLock() + calls = mock.calls.Lister + lockDestinationRuleControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *DestinationRuleControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("DestinationRuleControllerMock.StartFunc: method is nil but DestinationRuleController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockDestinationRuleControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockDestinationRuleControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedDestinationRuleController.StartCalls()) +func (mock *DestinationRuleControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockDestinationRuleControllerMockStart.RLock() + calls = mock.calls.Start + lockDestinationRuleControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *DestinationRuleControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("DestinationRuleControllerMock.SyncFunc: method is nil but DestinationRuleController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockDestinationRuleControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockDestinationRuleControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedDestinationRuleController.SyncCalls()) +func (mock *DestinationRuleControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockDestinationRuleControllerMockSync.RLock() + calls = mock.calls.Sync + lockDestinationRuleControllerMockSync.RUnlock() + return calls +} + +var ( + lockDestinationRuleInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockDestinationRuleInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockDestinationRuleInterfaceMockAddClusterScopedHandler sync.RWMutex + lockDestinationRuleInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockDestinationRuleInterfaceMockAddFeatureHandler sync.RWMutex + lockDestinationRuleInterfaceMockAddFeatureLifecycle sync.RWMutex + lockDestinationRuleInterfaceMockAddHandler sync.RWMutex + lockDestinationRuleInterfaceMockAddLifecycle sync.RWMutex + lockDestinationRuleInterfaceMockController sync.RWMutex + lockDestinationRuleInterfaceMockCreate sync.RWMutex + lockDestinationRuleInterfaceMockDelete sync.RWMutex + lockDestinationRuleInterfaceMockDeleteCollection sync.RWMutex + lockDestinationRuleInterfaceMockDeleteNamespaced sync.RWMutex + lockDestinationRuleInterfaceMockGet sync.RWMutex + lockDestinationRuleInterfaceMockGetNamespaced sync.RWMutex + lockDestinationRuleInterfaceMockList sync.RWMutex + lockDestinationRuleInterfaceMockObjectClient sync.RWMutex + lockDestinationRuleInterfaceMockUpdate sync.RWMutex + lockDestinationRuleInterfaceMockWatch sync.RWMutex +) + +// Ensure, that DestinationRuleInterfaceMock does implement DestinationRuleInterface. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.DestinationRuleInterface = &DestinationRuleInterfaceMock{} + +// DestinationRuleInterfaceMock is a mock implementation of DestinationRuleInterface. +// +// func TestSomethingThatUsesDestinationRuleInterface(t *testing.T) { +// +// // make and configure a mocked DestinationRuleInterface +// mockedDestinationRuleInterface := &DestinationRuleInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v1alpha3a.DestinationRuleController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v1alpha3a.DestinationRuleList, error) { +// panic("mock out the List method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedDestinationRuleInterface in code that requires DestinationRuleInterface +// // and then make assertions. +// +// } +type DestinationRuleInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v1alpha3a.DestinationRuleHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v1alpha3a.DestinationRuleController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v1alpha3a.DestinationRuleList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v1alpha3a.DestinationRuleHandlerFunc + } + // AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v1alpha3a.DestinationRuleHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.DestinationRuleHandlerFunc + } + // AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method. + AddFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.DestinationRuleHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v1alpha3.DestinationRule + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v1alpha3.DestinationRule + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *DestinationRuleInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("DestinationRuleInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but DestinationRuleInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockDestinationRuleInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockDestinationRuleInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedDestinationRuleInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *DestinationRuleInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockDestinationRuleInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *DestinationRuleInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("DestinationRuleInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but DestinationRuleInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockDestinationRuleInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockDestinationRuleInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedDestinationRuleInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *DestinationRuleInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + lockDestinationRuleInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockDestinationRuleInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *DestinationRuleInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("DestinationRuleInterfaceMock.AddClusterScopedHandlerFunc: method is nil but DestinationRuleInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockDestinationRuleInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockDestinationRuleInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedDestinationRuleInterface.AddClusterScopedHandlerCalls()) +func (mock *DestinationRuleInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockDestinationRuleInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *DestinationRuleInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.DestinationRuleLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("DestinationRuleInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but DestinationRuleInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockDestinationRuleInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockDestinationRuleInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedDestinationRuleInterface.AddClusterScopedLifecycleCalls()) +func (mock *DestinationRuleInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + lockDestinationRuleInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockDestinationRuleInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *DestinationRuleInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("DestinationRuleInterfaceMock.AddFeatureHandlerFunc: method is nil but DestinationRuleInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockDestinationRuleInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockDestinationRuleInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedDestinationRuleInterface.AddFeatureHandlerCalls()) +func (mock *DestinationRuleInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockDestinationRuleInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *DestinationRuleInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("DestinationRuleInterfaceMock.AddFeatureLifecycleFunc: method is nil but DestinationRuleInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockDestinationRuleInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockDestinationRuleInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedDestinationRuleInterface.AddFeatureLifecycleCalls()) +func (mock *DestinationRuleInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + lockDestinationRuleInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockDestinationRuleInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *DestinationRuleInterfaceMock) AddHandler(ctx context.Context, name string, sync v1alpha3a.DestinationRuleHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("DestinationRuleInterfaceMock.AddHandlerFunc: method is nil but DestinationRuleInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockDestinationRuleInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockDestinationRuleInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedDestinationRuleInterface.AddHandlerCalls()) +func (mock *DestinationRuleInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v1alpha3a.DestinationRuleHandlerFunc + } + lockDestinationRuleInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockDestinationRuleInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *DestinationRuleInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v1alpha3a.DestinationRuleLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("DestinationRuleInterfaceMock.AddLifecycleFunc: method is nil but DestinationRuleInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockDestinationRuleInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockDestinationRuleInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedDestinationRuleInterface.AddLifecycleCalls()) +func (mock *DestinationRuleInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.DestinationRuleLifecycle + } + lockDestinationRuleInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockDestinationRuleInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *DestinationRuleInterfaceMock) Controller() v1alpha3a.DestinationRuleController { + if mock.ControllerFunc == nil { + panic("DestinationRuleInterfaceMock.ControllerFunc: method is nil but DestinationRuleInterface.Controller was just called") + } + callInfo := struct { + }{} + lockDestinationRuleInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockDestinationRuleInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedDestinationRuleInterface.ControllerCalls()) +func (mock *DestinationRuleInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockDestinationRuleInterfaceMockController.RLock() + calls = mock.calls.Controller + lockDestinationRuleInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *DestinationRuleInterfaceMock) Create(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + if mock.CreateFunc == nil { + panic("DestinationRuleInterfaceMock.CreateFunc: method is nil but DestinationRuleInterface.Create was just called") + } + callInfo := struct { + In1 *v1alpha3.DestinationRule + }{ + In1: in1, + } + lockDestinationRuleInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockDestinationRuleInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedDestinationRuleInterface.CreateCalls()) +func (mock *DestinationRuleInterfaceMock) CreateCalls() []struct { + In1 *v1alpha3.DestinationRule +} { + var calls []struct { + In1 *v1alpha3.DestinationRule + } + lockDestinationRuleInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockDestinationRuleInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *DestinationRuleInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("DestinationRuleInterfaceMock.DeleteFunc: method is nil but DestinationRuleInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockDestinationRuleInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockDestinationRuleInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedDestinationRuleInterface.DeleteCalls()) +func (mock *DestinationRuleInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockDestinationRuleInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockDestinationRuleInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *DestinationRuleInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("DestinationRuleInterfaceMock.DeleteCollectionFunc: method is nil but DestinationRuleInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockDestinationRuleInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockDestinationRuleInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedDestinationRuleInterface.DeleteCollectionCalls()) +func (mock *DestinationRuleInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockDestinationRuleInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockDestinationRuleInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *DestinationRuleInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("DestinationRuleInterfaceMock.DeleteNamespacedFunc: method is nil but DestinationRuleInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockDestinationRuleInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockDestinationRuleInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedDestinationRuleInterface.DeleteNamespacedCalls()) +func (mock *DestinationRuleInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockDestinationRuleInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockDestinationRuleInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *DestinationRuleInterfaceMock) Get(name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) { + if mock.GetFunc == nil { + panic("DestinationRuleInterfaceMock.GetFunc: method is nil but DestinationRuleInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockDestinationRuleInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockDestinationRuleInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedDestinationRuleInterface.GetCalls()) +func (mock *DestinationRuleInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockDestinationRuleInterfaceMockGet.RLock() + calls = mock.calls.Get + lockDestinationRuleInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *DestinationRuleInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v1alpha3.DestinationRule, error) { + if mock.GetNamespacedFunc == nil { + panic("DestinationRuleInterfaceMock.GetNamespacedFunc: method is nil but DestinationRuleInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockDestinationRuleInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockDestinationRuleInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedDestinationRuleInterface.GetNamespacedCalls()) +func (mock *DestinationRuleInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockDestinationRuleInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockDestinationRuleInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *DestinationRuleInterfaceMock) List(opts v1.ListOptions) (*v1alpha3a.DestinationRuleList, error) { + if mock.ListFunc == nil { + panic("DestinationRuleInterfaceMock.ListFunc: method is nil but DestinationRuleInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockDestinationRuleInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockDestinationRuleInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedDestinationRuleInterface.ListCalls()) +func (mock *DestinationRuleInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockDestinationRuleInterfaceMockList.RLock() + calls = mock.calls.List + lockDestinationRuleInterfaceMockList.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *DestinationRuleInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("DestinationRuleInterfaceMock.ObjectClientFunc: method is nil but DestinationRuleInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockDestinationRuleInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockDestinationRuleInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedDestinationRuleInterface.ObjectClientCalls()) +func (mock *DestinationRuleInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockDestinationRuleInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockDestinationRuleInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *DestinationRuleInterfaceMock) Update(in1 *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + if mock.UpdateFunc == nil { + panic("DestinationRuleInterfaceMock.UpdateFunc: method is nil but DestinationRuleInterface.Update was just called") + } + callInfo := struct { + In1 *v1alpha3.DestinationRule + }{ + In1: in1, + } + lockDestinationRuleInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockDestinationRuleInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedDestinationRuleInterface.UpdateCalls()) +func (mock *DestinationRuleInterfaceMock) UpdateCalls() []struct { + In1 *v1alpha3.DestinationRule +} { + var calls []struct { + In1 *v1alpha3.DestinationRule + } + lockDestinationRuleInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockDestinationRuleInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *DestinationRuleInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("DestinationRuleInterfaceMock.WatchFunc: method is nil but DestinationRuleInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockDestinationRuleInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockDestinationRuleInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedDestinationRuleInterface.WatchCalls()) +func (mock *DestinationRuleInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockDestinationRuleInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockDestinationRuleInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockDestinationRulesGetterMockDestinationRules sync.RWMutex +) + +// Ensure, that DestinationRulesGetterMock does implement DestinationRulesGetter. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.DestinationRulesGetter = &DestinationRulesGetterMock{} + +// DestinationRulesGetterMock is a mock implementation of DestinationRulesGetter. +// +// func TestSomethingThatUsesDestinationRulesGetter(t *testing.T) { +// +// // make and configure a mocked DestinationRulesGetter +// mockedDestinationRulesGetter := &DestinationRulesGetterMock{ +// DestinationRulesFunc: func(namespace string) v1alpha3a.DestinationRuleInterface { +// panic("mock out the DestinationRules method") +// }, +// } +// +// // use mockedDestinationRulesGetter in code that requires DestinationRulesGetter +// // and then make assertions. +// +// } +type DestinationRulesGetterMock struct { + // DestinationRulesFunc mocks the DestinationRules method. + DestinationRulesFunc func(namespace string) v1alpha3a.DestinationRuleInterface + + // calls tracks calls to the methods. + calls struct { + // DestinationRules holds details about calls to the DestinationRules method. + DestinationRules []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// DestinationRules calls DestinationRulesFunc. +func (mock *DestinationRulesGetterMock) DestinationRules(namespace string) v1alpha3a.DestinationRuleInterface { + if mock.DestinationRulesFunc == nil { + panic("DestinationRulesGetterMock.DestinationRulesFunc: method is nil but DestinationRulesGetter.DestinationRules was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockDestinationRulesGetterMockDestinationRules.Lock() + mock.calls.DestinationRules = append(mock.calls.DestinationRules, callInfo) + lockDestinationRulesGetterMockDestinationRules.Unlock() + return mock.DestinationRulesFunc(namespace) +} + +// DestinationRulesCalls gets all the calls that were made to DestinationRules. +// Check the length with: +// len(mockedDestinationRulesGetter.DestinationRulesCalls()) +func (mock *DestinationRulesGetterMock) DestinationRulesCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockDestinationRulesGetterMockDestinationRules.RLock() + calls = mock.calls.DestinationRules + lockDestinationRulesGetterMockDestinationRules.RUnlock() + return calls +} diff --git a/apis/networking.istio.io/v1alpha3/fakes/zz_generated_virtual_service_mock.go b/apis/networking.istio.io/v1alpha3/fakes/zz_generated_virtual_service_mock.go new file mode 100644 index 00000000..43fcf888 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/fakes/zz_generated_virtual_service_mock.go @@ -0,0 +1,1741 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fakes + +import ( + context "context" + sync "sync" + + v1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" + controller "github.com/rancher/norman/controller" + objectclient "github.com/rancher/norman/objectclient" + v1alpha3a "github.com/rancher/types/apis/networking.istio.io/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +var ( + lockVirtualServiceListerMockGet sync.RWMutex + lockVirtualServiceListerMockList sync.RWMutex +) + +// Ensure, that VirtualServiceListerMock does implement VirtualServiceLister. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.VirtualServiceLister = &VirtualServiceListerMock{} + +// VirtualServiceListerMock is a mock implementation of VirtualServiceLister. +// +// func TestSomethingThatUsesVirtualServiceLister(t *testing.T) { +// +// // make and configure a mocked VirtualServiceLister +// mockedVirtualServiceLister := &VirtualServiceListerMock{ +// GetFunc: func(namespace string, name string) (*v1alpha3.VirtualService, error) { +// panic("mock out the Get method") +// }, +// ListFunc: func(namespace string, selector labels.Selector) ([]*v1alpha3.VirtualService, error) { +// panic("mock out the List method") +// }, +// } +// +// // use mockedVirtualServiceLister in code that requires VirtualServiceLister +// // and then make assertions. +// +// } +type VirtualServiceListerMock struct { + // GetFunc mocks the Get method. + GetFunc func(namespace string, name string) (*v1alpha3.VirtualService, error) + + // ListFunc mocks the List method. + ListFunc func(namespace string, selector labels.Selector) ([]*v1alpha3.VirtualService, error) + + // calls tracks calls to the methods. + calls struct { + // Get holds details about calls to the Get method. + Get []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // List holds details about calls to the List method. + List []struct { + // Namespace is the namespace argument value. + Namespace string + // Selector is the selector argument value. + Selector labels.Selector + } + } +} + +// Get calls GetFunc. +func (mock *VirtualServiceListerMock) Get(namespace string, name string) (*v1alpha3.VirtualService, error) { + if mock.GetFunc == nil { + panic("VirtualServiceListerMock.GetFunc: method is nil but VirtualServiceLister.Get was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockVirtualServiceListerMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockVirtualServiceListerMockGet.Unlock() + return mock.GetFunc(namespace, name) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedVirtualServiceLister.GetCalls()) +func (mock *VirtualServiceListerMock) GetCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockVirtualServiceListerMockGet.RLock() + calls = mock.calls.Get + lockVirtualServiceListerMockGet.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *VirtualServiceListerMock) List(namespace string, selector labels.Selector) ([]*v1alpha3.VirtualService, error) { + if mock.ListFunc == nil { + panic("VirtualServiceListerMock.ListFunc: method is nil but VirtualServiceLister.List was just called") + } + callInfo := struct { + Namespace string + Selector labels.Selector + }{ + Namespace: namespace, + Selector: selector, + } + lockVirtualServiceListerMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockVirtualServiceListerMockList.Unlock() + return mock.ListFunc(namespace, selector) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedVirtualServiceLister.ListCalls()) +func (mock *VirtualServiceListerMock) ListCalls() []struct { + Namespace string + Selector labels.Selector +} { + var calls []struct { + Namespace string + Selector labels.Selector + } + lockVirtualServiceListerMockList.RLock() + calls = mock.calls.List + lockVirtualServiceListerMockList.RUnlock() + return calls +} + +var ( + lockVirtualServiceControllerMockAddClusterScopedFeatureHandler sync.RWMutex + lockVirtualServiceControllerMockAddClusterScopedHandler sync.RWMutex + lockVirtualServiceControllerMockAddFeatureHandler sync.RWMutex + lockVirtualServiceControllerMockAddHandler sync.RWMutex + lockVirtualServiceControllerMockEnqueue sync.RWMutex + lockVirtualServiceControllerMockGeneric sync.RWMutex + lockVirtualServiceControllerMockInformer sync.RWMutex + lockVirtualServiceControllerMockLister sync.RWMutex + lockVirtualServiceControllerMockStart sync.RWMutex + lockVirtualServiceControllerMockSync sync.RWMutex +) + +// Ensure, that VirtualServiceControllerMock does implement VirtualServiceController. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.VirtualServiceController = &VirtualServiceControllerMock{} + +// VirtualServiceControllerMock is a mock implementation of VirtualServiceController. +// +// func TestSomethingThatUsesVirtualServiceController(t *testing.T) { +// +// // make and configure a mocked VirtualServiceController +// mockedVirtualServiceController := &VirtualServiceControllerMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, handler v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// EnqueueFunc: func(namespace string, name string) { +// panic("mock out the Enqueue method") +// }, +// GenericFunc: func() controller.GenericController { +// panic("mock out the Generic method") +// }, +// InformerFunc: func() cache.SharedIndexInformer { +// panic("mock out the Informer method") +// }, +// ListerFunc: func() v1alpha3a.VirtualServiceLister { +// panic("mock out the Lister method") +// }, +// StartFunc: func(ctx context.Context, threadiness int) error { +// panic("mock out the Start method") +// }, +// SyncFunc: func(ctx context.Context) error { +// panic("mock out the Sync method") +// }, +// } +// +// // use mockedVirtualServiceController in code that requires VirtualServiceController +// // and then make assertions. +// +// } +type VirtualServiceControllerMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, handler v1alpha3a.VirtualServiceHandlerFunc) + + // EnqueueFunc mocks the Enqueue method. + EnqueueFunc func(namespace string, name string) + + // GenericFunc mocks the Generic method. + GenericFunc func() controller.GenericController + + // InformerFunc mocks the Informer method. + InformerFunc func() cache.SharedIndexInformer + + // ListerFunc mocks the Lister method. + ListerFunc func() v1alpha3a.VirtualServiceLister + + // StartFunc mocks the Start method. + StartFunc func(ctx context.Context, threadiness int) error + + // SyncFunc mocks the Sync method. + SyncFunc func(ctx context.Context) error + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v1alpha3a.VirtualServiceHandlerFunc + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Handler is the handler argument value. + Handler v1alpha3a.VirtualServiceHandlerFunc + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.VirtualServiceHandlerFunc + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Handler is the handler argument value. + Handler v1alpha3a.VirtualServiceHandlerFunc + } + // Enqueue holds details about calls to the Enqueue method. + Enqueue []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + } + // Generic holds details about calls to the Generic method. + Generic []struct { + } + // Informer holds details about calls to the Informer method. + Informer []struct { + } + // Lister holds details about calls to the Lister method. + Lister []struct { + } + // Start holds details about calls to the Start method. + Start []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Threadiness is the threadiness argument value. + Threadiness int + } + // Sync holds details about calls to the Sync method. + Sync []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *VirtualServiceControllerMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("VirtualServiceControllerMock.AddClusterScopedFeatureHandlerFunc: method is nil but VirtualServiceController.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockVirtualServiceControllerMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockVirtualServiceControllerMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, handler) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedVirtualServiceController.AddClusterScopedFeatureHandlerCalls()) +func (mock *VirtualServiceControllerMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceControllerMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockVirtualServiceControllerMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *VirtualServiceControllerMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, handler v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("VirtualServiceControllerMock.AddClusterScopedHandlerFunc: method is nil but VirtualServiceController.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Handler: handler, + } + lockVirtualServiceControllerMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockVirtualServiceControllerMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, handler) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedVirtualServiceController.AddClusterScopedHandlerCalls()) +func (mock *VirtualServiceControllerMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Handler v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceControllerMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockVirtualServiceControllerMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *VirtualServiceControllerMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("VirtualServiceControllerMock.AddFeatureHandlerFunc: method is nil but VirtualServiceController.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockVirtualServiceControllerMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockVirtualServiceControllerMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedVirtualServiceController.AddFeatureHandlerCalls()) +func (mock *VirtualServiceControllerMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceControllerMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockVirtualServiceControllerMockAddFeatureHandler.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *VirtualServiceControllerMock) AddHandler(ctx context.Context, name string, handler v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("VirtualServiceControllerMock.AddHandlerFunc: method is nil but VirtualServiceController.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Handler v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + Handler: handler, + } + lockVirtualServiceControllerMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockVirtualServiceControllerMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, handler) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedVirtualServiceController.AddHandlerCalls()) +func (mock *VirtualServiceControllerMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Handler v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Handler v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceControllerMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockVirtualServiceControllerMockAddHandler.RUnlock() + return calls +} + +// Enqueue calls EnqueueFunc. +func (mock *VirtualServiceControllerMock) Enqueue(namespace string, name string) { + if mock.EnqueueFunc == nil { + panic("VirtualServiceControllerMock.EnqueueFunc: method is nil but VirtualServiceController.Enqueue was just called") + } + callInfo := struct { + Namespace string + Name string + }{ + Namespace: namespace, + Name: name, + } + lockVirtualServiceControllerMockEnqueue.Lock() + mock.calls.Enqueue = append(mock.calls.Enqueue, callInfo) + lockVirtualServiceControllerMockEnqueue.Unlock() + mock.EnqueueFunc(namespace, name) +} + +// EnqueueCalls gets all the calls that were made to Enqueue. +// Check the length with: +// len(mockedVirtualServiceController.EnqueueCalls()) +func (mock *VirtualServiceControllerMock) EnqueueCalls() []struct { + Namespace string + Name string +} { + var calls []struct { + Namespace string + Name string + } + lockVirtualServiceControllerMockEnqueue.RLock() + calls = mock.calls.Enqueue + lockVirtualServiceControllerMockEnqueue.RUnlock() + return calls +} + +// Generic calls GenericFunc. +func (mock *VirtualServiceControllerMock) Generic() controller.GenericController { + if mock.GenericFunc == nil { + panic("VirtualServiceControllerMock.GenericFunc: method is nil but VirtualServiceController.Generic was just called") + } + callInfo := struct { + }{} + lockVirtualServiceControllerMockGeneric.Lock() + mock.calls.Generic = append(mock.calls.Generic, callInfo) + lockVirtualServiceControllerMockGeneric.Unlock() + return mock.GenericFunc() +} + +// GenericCalls gets all the calls that were made to Generic. +// Check the length with: +// len(mockedVirtualServiceController.GenericCalls()) +func (mock *VirtualServiceControllerMock) GenericCalls() []struct { +} { + var calls []struct { + } + lockVirtualServiceControllerMockGeneric.RLock() + calls = mock.calls.Generic + lockVirtualServiceControllerMockGeneric.RUnlock() + return calls +} + +// Informer calls InformerFunc. +func (mock *VirtualServiceControllerMock) Informer() cache.SharedIndexInformer { + if mock.InformerFunc == nil { + panic("VirtualServiceControllerMock.InformerFunc: method is nil but VirtualServiceController.Informer was just called") + } + callInfo := struct { + }{} + lockVirtualServiceControllerMockInformer.Lock() + mock.calls.Informer = append(mock.calls.Informer, callInfo) + lockVirtualServiceControllerMockInformer.Unlock() + return mock.InformerFunc() +} + +// InformerCalls gets all the calls that were made to Informer. +// Check the length with: +// len(mockedVirtualServiceController.InformerCalls()) +func (mock *VirtualServiceControllerMock) InformerCalls() []struct { +} { + var calls []struct { + } + lockVirtualServiceControllerMockInformer.RLock() + calls = mock.calls.Informer + lockVirtualServiceControllerMockInformer.RUnlock() + return calls +} + +// Lister calls ListerFunc. +func (mock *VirtualServiceControllerMock) Lister() v1alpha3a.VirtualServiceLister { + if mock.ListerFunc == nil { + panic("VirtualServiceControllerMock.ListerFunc: method is nil but VirtualServiceController.Lister was just called") + } + callInfo := struct { + }{} + lockVirtualServiceControllerMockLister.Lock() + mock.calls.Lister = append(mock.calls.Lister, callInfo) + lockVirtualServiceControllerMockLister.Unlock() + return mock.ListerFunc() +} + +// ListerCalls gets all the calls that were made to Lister. +// Check the length with: +// len(mockedVirtualServiceController.ListerCalls()) +func (mock *VirtualServiceControllerMock) ListerCalls() []struct { +} { + var calls []struct { + } + lockVirtualServiceControllerMockLister.RLock() + calls = mock.calls.Lister + lockVirtualServiceControllerMockLister.RUnlock() + return calls +} + +// Start calls StartFunc. +func (mock *VirtualServiceControllerMock) Start(ctx context.Context, threadiness int) error { + if mock.StartFunc == nil { + panic("VirtualServiceControllerMock.StartFunc: method is nil but VirtualServiceController.Start was just called") + } + callInfo := struct { + Ctx context.Context + Threadiness int + }{ + Ctx: ctx, + Threadiness: threadiness, + } + lockVirtualServiceControllerMockStart.Lock() + mock.calls.Start = append(mock.calls.Start, callInfo) + lockVirtualServiceControllerMockStart.Unlock() + return mock.StartFunc(ctx, threadiness) +} + +// StartCalls gets all the calls that were made to Start. +// Check the length with: +// len(mockedVirtualServiceController.StartCalls()) +func (mock *VirtualServiceControllerMock) StartCalls() []struct { + Ctx context.Context + Threadiness int +} { + var calls []struct { + Ctx context.Context + Threadiness int + } + lockVirtualServiceControllerMockStart.RLock() + calls = mock.calls.Start + lockVirtualServiceControllerMockStart.RUnlock() + return calls +} + +// Sync calls SyncFunc. +func (mock *VirtualServiceControllerMock) Sync(ctx context.Context) error { + if mock.SyncFunc == nil { + panic("VirtualServiceControllerMock.SyncFunc: method is nil but VirtualServiceController.Sync was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + lockVirtualServiceControllerMockSync.Lock() + mock.calls.Sync = append(mock.calls.Sync, callInfo) + lockVirtualServiceControllerMockSync.Unlock() + return mock.SyncFunc(ctx) +} + +// SyncCalls gets all the calls that were made to Sync. +// Check the length with: +// len(mockedVirtualServiceController.SyncCalls()) +func (mock *VirtualServiceControllerMock) SyncCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + lockVirtualServiceControllerMockSync.RLock() + calls = mock.calls.Sync + lockVirtualServiceControllerMockSync.RUnlock() + return calls +} + +var ( + lockVirtualServiceInterfaceMockAddClusterScopedFeatureHandler sync.RWMutex + lockVirtualServiceInterfaceMockAddClusterScopedFeatureLifecycle sync.RWMutex + lockVirtualServiceInterfaceMockAddClusterScopedHandler sync.RWMutex + lockVirtualServiceInterfaceMockAddClusterScopedLifecycle sync.RWMutex + lockVirtualServiceInterfaceMockAddFeatureHandler sync.RWMutex + lockVirtualServiceInterfaceMockAddFeatureLifecycle sync.RWMutex + lockVirtualServiceInterfaceMockAddHandler sync.RWMutex + lockVirtualServiceInterfaceMockAddLifecycle sync.RWMutex + lockVirtualServiceInterfaceMockController sync.RWMutex + lockVirtualServiceInterfaceMockCreate sync.RWMutex + lockVirtualServiceInterfaceMockDelete sync.RWMutex + lockVirtualServiceInterfaceMockDeleteCollection sync.RWMutex + lockVirtualServiceInterfaceMockDeleteNamespaced sync.RWMutex + lockVirtualServiceInterfaceMockGet sync.RWMutex + lockVirtualServiceInterfaceMockGetNamespaced sync.RWMutex + lockVirtualServiceInterfaceMockList sync.RWMutex + lockVirtualServiceInterfaceMockObjectClient sync.RWMutex + lockVirtualServiceInterfaceMockUpdate sync.RWMutex + lockVirtualServiceInterfaceMockWatch sync.RWMutex +) + +// Ensure, that VirtualServiceInterfaceMock does implement VirtualServiceInterface. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.VirtualServiceInterface = &VirtualServiceInterfaceMock{} + +// VirtualServiceInterfaceMock is a mock implementation of VirtualServiceInterface. +// +// func TestSomethingThatUsesVirtualServiceInterface(t *testing.T) { +// +// // make and configure a mocked VirtualServiceInterface +// mockedVirtualServiceInterface := &VirtualServiceInterfaceMock{ +// AddClusterScopedFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddClusterScopedFeatureHandler method") +// }, +// AddClusterScopedFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) { +// panic("mock out the AddClusterScopedFeatureLifecycle method") +// }, +// AddClusterScopedHandlerFunc: func(ctx context.Context, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddClusterScopedHandler method") +// }, +// AddClusterScopedLifecycleFunc: func(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) { +// panic("mock out the AddClusterScopedLifecycle method") +// }, +// AddFeatureHandlerFunc: func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddFeatureHandler method") +// }, +// AddFeatureLifecycleFunc: func(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) { +// panic("mock out the AddFeatureLifecycle method") +// }, +// AddHandlerFunc: func(ctx context.Context, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { +// panic("mock out the AddHandler method") +// }, +// AddLifecycleFunc: func(ctx context.Context, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) { +// panic("mock out the AddLifecycle method") +// }, +// ControllerFunc: func() v1alpha3a.VirtualServiceController { +// panic("mock out the Controller method") +// }, +// CreateFunc: func(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { +// panic("mock out the Create method") +// }, +// DeleteFunc: func(name string, options *v1.DeleteOptions) error { +// panic("mock out the Delete method") +// }, +// DeleteCollectionFunc: func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { +// panic("mock out the DeleteCollection method") +// }, +// DeleteNamespacedFunc: func(namespace string, name string, options *v1.DeleteOptions) error { +// panic("mock out the DeleteNamespaced method") +// }, +// GetFunc: func(name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) { +// panic("mock out the Get method") +// }, +// GetNamespacedFunc: func(namespace string, name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) { +// panic("mock out the GetNamespaced method") +// }, +// ListFunc: func(opts v1.ListOptions) (*v1alpha3a.VirtualServiceList, error) { +// panic("mock out the List method") +// }, +// ObjectClientFunc: func() *objectclient.ObjectClient { +// panic("mock out the ObjectClient method") +// }, +// UpdateFunc: func(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { +// panic("mock out the Update method") +// }, +// WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { +// panic("mock out the Watch method") +// }, +// } +// +// // use mockedVirtualServiceInterface in code that requires VirtualServiceInterface +// // and then make assertions. +// +// } +type VirtualServiceInterfaceMock struct { + // AddClusterScopedFeatureHandlerFunc mocks the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) + + // AddClusterScopedFeatureLifecycleFunc mocks the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) + + // AddClusterScopedHandlerFunc mocks the AddClusterScopedHandler method. + AddClusterScopedHandlerFunc func(ctx context.Context, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) + + // AddClusterScopedLifecycleFunc mocks the AddClusterScopedLifecycle method. + AddClusterScopedLifecycleFunc func(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) + + // AddFeatureHandlerFunc mocks the AddFeatureHandler method. + AddFeatureHandlerFunc func(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) + + // AddFeatureLifecycleFunc mocks the AddFeatureLifecycle method. + AddFeatureLifecycleFunc func(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) + + // AddHandlerFunc mocks the AddHandler method. + AddHandlerFunc func(ctx context.Context, name string, sync v1alpha3a.VirtualServiceHandlerFunc) + + // AddLifecycleFunc mocks the AddLifecycle method. + AddLifecycleFunc func(ctx context.Context, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) + + // ControllerFunc mocks the Controller method. + ControllerFunc func() v1alpha3a.VirtualServiceController + + // CreateFunc mocks the Create method. + CreateFunc func(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + + // DeleteFunc mocks the Delete method. + DeleteFunc func(name string, options *v1.DeleteOptions) error + + // DeleteCollectionFunc mocks the DeleteCollection method. + DeleteCollectionFunc func(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error + + // DeleteNamespacedFunc mocks the DeleteNamespaced method. + DeleteNamespacedFunc func(namespace string, name string, options *v1.DeleteOptions) error + + // GetFunc mocks the Get method. + GetFunc func(name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) + + // GetNamespacedFunc mocks the GetNamespaced method. + GetNamespacedFunc func(namespace string, name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) + + // ListFunc mocks the List method. + ListFunc func(opts v1.ListOptions) (*v1alpha3a.VirtualServiceList, error) + + // ObjectClientFunc mocks the ObjectClient method. + ObjectClientFunc func() *objectclient.ObjectClient + + // UpdateFunc mocks the Update method. + UpdateFunc func(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + + // WatchFunc mocks the Watch method. + WatchFunc func(opts v1.ListOptions) (watch.Interface, error) + + // calls tracks calls to the methods. + calls struct { + // AddClusterScopedFeatureHandler holds details about calls to the AddClusterScopedFeatureHandler method. + AddClusterScopedFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v1alpha3a.VirtualServiceHandlerFunc + } + // AddClusterScopedFeatureLifecycle holds details about calls to the AddClusterScopedFeatureLifecycle method. + AddClusterScopedFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + // AddClusterScopedHandler holds details about calls to the AddClusterScopedHandler method. + AddClusterScopedHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Sync is the sync argument value. + Sync v1alpha3a.VirtualServiceHandlerFunc + } + // AddClusterScopedLifecycle holds details about calls to the AddClusterScopedLifecycle method. + AddClusterScopedLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // ClusterName is the clusterName argument value. + ClusterName string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + // AddFeatureHandler holds details about calls to the AddFeatureHandler method. + AddFeatureHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.VirtualServiceHandlerFunc + } + // AddFeatureLifecycle holds details about calls to the AddFeatureLifecycle method. + AddFeatureLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Enabled is the enabled argument value. + Enabled func() bool + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + // AddHandler holds details about calls to the AddHandler method. + AddHandler []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Sync is the sync argument value. + Sync v1alpha3a.VirtualServiceHandlerFunc + } + // AddLifecycle holds details about calls to the AddLifecycle method. + AddLifecycle []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Name is the name argument value. + Name string + // Lifecycle is the lifecycle argument value. + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + // Controller holds details about calls to the Controller method. + Controller []struct { + } + // Create holds details about calls to the Create method. + Create []struct { + // In1 is the in1 argument value. + In1 *v1alpha3.VirtualService + } + // Delete holds details about calls to the Delete method. + Delete []struct { + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // DeleteCollection holds details about calls to the DeleteCollection method. + DeleteCollection []struct { + // DeleteOpts is the deleteOpts argument value. + DeleteOpts *v1.DeleteOptions + // ListOpts is the listOpts argument value. + ListOpts v1.ListOptions + } + // DeleteNamespaced holds details about calls to the DeleteNamespaced method. + DeleteNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Options is the options argument value. + Options *v1.DeleteOptions + } + // Get holds details about calls to the Get method. + Get []struct { + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // GetNamespaced holds details about calls to the GetNamespaced method. + GetNamespaced []struct { + // Namespace is the namespace argument value. + Namespace string + // Name is the name argument value. + Name string + // Opts is the opts argument value. + Opts v1.GetOptions + } + // List holds details about calls to the List method. + List []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + // ObjectClient holds details about calls to the ObjectClient method. + ObjectClient []struct { + } + // Update holds details about calls to the Update method. + Update []struct { + // In1 is the in1 argument value. + In1 *v1alpha3.VirtualService + } + // Watch holds details about calls to the Watch method. + Watch []struct { + // Opts is the opts argument value. + Opts v1.ListOptions + } + } +} + +// AddClusterScopedFeatureHandler calls AddClusterScopedFeatureHandlerFunc. +func (mock *VirtualServiceInterfaceMock) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddClusterScopedFeatureHandlerFunc == nil { + panic("VirtualServiceInterfaceMock.AddClusterScopedFeatureHandlerFunc: method is nil but VirtualServiceInterface.AddClusterScopedFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockVirtualServiceInterfaceMockAddClusterScopedFeatureHandler.Lock() + mock.calls.AddClusterScopedFeatureHandler = append(mock.calls.AddClusterScopedFeatureHandler, callInfo) + lockVirtualServiceInterfaceMockAddClusterScopedFeatureHandler.Unlock() + mock.AddClusterScopedFeatureHandlerFunc(ctx, enabled, name, clusterName, sync) +} + +// AddClusterScopedFeatureHandlerCalls gets all the calls that were made to AddClusterScopedFeatureHandler. +// Check the length with: +// len(mockedVirtualServiceInterface.AddClusterScopedFeatureHandlerCalls()) +func (mock *VirtualServiceInterfaceMock) AddClusterScopedFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceInterfaceMockAddClusterScopedFeatureHandler.RLock() + calls = mock.calls.AddClusterScopedFeatureHandler + lockVirtualServiceInterfaceMockAddClusterScopedFeatureHandler.RUnlock() + return calls +} + +// AddClusterScopedFeatureLifecycle calls AddClusterScopedFeatureLifecycleFunc. +func (mock *VirtualServiceInterfaceMock) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) { + if mock.AddClusterScopedFeatureLifecycleFunc == nil { + panic("VirtualServiceInterfaceMock.AddClusterScopedFeatureLifecycleFunc: method is nil but VirtualServiceInterface.AddClusterScopedFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockVirtualServiceInterfaceMockAddClusterScopedFeatureLifecycle.Lock() + mock.calls.AddClusterScopedFeatureLifecycle = append(mock.calls.AddClusterScopedFeatureLifecycle, callInfo) + lockVirtualServiceInterfaceMockAddClusterScopedFeatureLifecycle.Unlock() + mock.AddClusterScopedFeatureLifecycleFunc(ctx, enabled, name, clusterName, lifecycle) +} + +// AddClusterScopedFeatureLifecycleCalls gets all the calls that were made to AddClusterScopedFeatureLifecycle. +// Check the length with: +// len(mockedVirtualServiceInterface.AddClusterScopedFeatureLifecycleCalls()) +func (mock *VirtualServiceInterfaceMock) AddClusterScopedFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + lockVirtualServiceInterfaceMockAddClusterScopedFeatureLifecycle.RLock() + calls = mock.calls.AddClusterScopedFeatureLifecycle + lockVirtualServiceInterfaceMockAddClusterScopedFeatureLifecycle.RUnlock() + return calls +} + +// AddClusterScopedHandler calls AddClusterScopedHandlerFunc. +func (mock *VirtualServiceInterfaceMock) AddClusterScopedHandler(ctx context.Context, name string, clusterName string, sync v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddClusterScopedHandlerFunc == nil { + panic("VirtualServiceInterfaceMock.AddClusterScopedHandlerFunc: method is nil but VirtualServiceInterface.AddClusterScopedHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Sync: sync, + } + lockVirtualServiceInterfaceMockAddClusterScopedHandler.Lock() + mock.calls.AddClusterScopedHandler = append(mock.calls.AddClusterScopedHandler, callInfo) + lockVirtualServiceInterfaceMockAddClusterScopedHandler.Unlock() + mock.AddClusterScopedHandlerFunc(ctx, name, clusterName, sync) +} + +// AddClusterScopedHandlerCalls gets all the calls that were made to AddClusterScopedHandler. +// Check the length with: +// len(mockedVirtualServiceInterface.AddClusterScopedHandlerCalls()) +func (mock *VirtualServiceInterfaceMock) AddClusterScopedHandlerCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Sync v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceInterfaceMockAddClusterScopedHandler.RLock() + calls = mock.calls.AddClusterScopedHandler + lockVirtualServiceInterfaceMockAddClusterScopedHandler.RUnlock() + return calls +} + +// AddClusterScopedLifecycle calls AddClusterScopedLifecycleFunc. +func (mock *VirtualServiceInterfaceMock) AddClusterScopedLifecycle(ctx context.Context, name string, clusterName string, lifecycle v1alpha3a.VirtualServiceLifecycle) { + if mock.AddClusterScopedLifecycleFunc == nil { + panic("VirtualServiceInterfaceMock.AddClusterScopedLifecycleFunc: method is nil but VirtualServiceInterface.AddClusterScopedLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle + }{ + Ctx: ctx, + Name: name, + ClusterName: clusterName, + Lifecycle: lifecycle, + } + lockVirtualServiceInterfaceMockAddClusterScopedLifecycle.Lock() + mock.calls.AddClusterScopedLifecycle = append(mock.calls.AddClusterScopedLifecycle, callInfo) + lockVirtualServiceInterfaceMockAddClusterScopedLifecycle.Unlock() + mock.AddClusterScopedLifecycleFunc(ctx, name, clusterName, lifecycle) +} + +// AddClusterScopedLifecycleCalls gets all the calls that were made to AddClusterScopedLifecycle. +// Check the length with: +// len(mockedVirtualServiceInterface.AddClusterScopedLifecycleCalls()) +func (mock *VirtualServiceInterfaceMock) AddClusterScopedLifecycleCalls() []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + ClusterName string + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + lockVirtualServiceInterfaceMockAddClusterScopedLifecycle.RLock() + calls = mock.calls.AddClusterScopedLifecycle + lockVirtualServiceInterfaceMockAddClusterScopedLifecycle.RUnlock() + return calls +} + +// AddFeatureHandler calls AddFeatureHandlerFunc. +func (mock *VirtualServiceInterfaceMock) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddFeatureHandlerFunc == nil { + panic("VirtualServiceInterfaceMock.AddFeatureHandlerFunc: method is nil but VirtualServiceInterface.AddFeatureHandler was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Sync: sync, + } + lockVirtualServiceInterfaceMockAddFeatureHandler.Lock() + mock.calls.AddFeatureHandler = append(mock.calls.AddFeatureHandler, callInfo) + lockVirtualServiceInterfaceMockAddFeatureHandler.Unlock() + mock.AddFeatureHandlerFunc(ctx, enabled, name, sync) +} + +// AddFeatureHandlerCalls gets all the calls that were made to AddFeatureHandler. +// Check the length with: +// len(mockedVirtualServiceInterface.AddFeatureHandlerCalls()) +func (mock *VirtualServiceInterfaceMock) AddFeatureHandlerCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceInterfaceMockAddFeatureHandler.RLock() + calls = mock.calls.AddFeatureHandler + lockVirtualServiceInterfaceMockAddFeatureHandler.RUnlock() + return calls +} + +// AddFeatureLifecycle calls AddFeatureLifecycleFunc. +func (mock *VirtualServiceInterfaceMock) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) { + if mock.AddFeatureLifecycleFunc == nil { + panic("VirtualServiceInterfaceMock.AddFeatureLifecycleFunc: method is nil but VirtualServiceInterface.AddFeatureLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle + }{ + Ctx: ctx, + Enabled: enabled, + Name: name, + Lifecycle: lifecycle, + } + lockVirtualServiceInterfaceMockAddFeatureLifecycle.Lock() + mock.calls.AddFeatureLifecycle = append(mock.calls.AddFeatureLifecycle, callInfo) + lockVirtualServiceInterfaceMockAddFeatureLifecycle.Unlock() + mock.AddFeatureLifecycleFunc(ctx, enabled, name, lifecycle) +} + +// AddFeatureLifecycleCalls gets all the calls that were made to AddFeatureLifecycle. +// Check the length with: +// len(mockedVirtualServiceInterface.AddFeatureLifecycleCalls()) +func (mock *VirtualServiceInterfaceMock) AddFeatureLifecycleCalls() []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Enabled func() bool + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + lockVirtualServiceInterfaceMockAddFeatureLifecycle.RLock() + calls = mock.calls.AddFeatureLifecycle + lockVirtualServiceInterfaceMockAddFeatureLifecycle.RUnlock() + return calls +} + +// AddHandler calls AddHandlerFunc. +func (mock *VirtualServiceInterfaceMock) AddHandler(ctx context.Context, name string, sync v1alpha3a.VirtualServiceHandlerFunc) { + if mock.AddHandlerFunc == nil { + panic("VirtualServiceInterfaceMock.AddHandlerFunc: method is nil but VirtualServiceInterface.AddHandler was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + }{ + Ctx: ctx, + Name: name, + Sync: sync, + } + lockVirtualServiceInterfaceMockAddHandler.Lock() + mock.calls.AddHandler = append(mock.calls.AddHandler, callInfo) + lockVirtualServiceInterfaceMockAddHandler.Unlock() + mock.AddHandlerFunc(ctx, name, sync) +} + +// AddHandlerCalls gets all the calls that were made to AddHandler. +// Check the length with: +// len(mockedVirtualServiceInterface.AddHandlerCalls()) +func (mock *VirtualServiceInterfaceMock) AddHandlerCalls() []struct { + Ctx context.Context + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc +} { + var calls []struct { + Ctx context.Context + Name string + Sync v1alpha3a.VirtualServiceHandlerFunc + } + lockVirtualServiceInterfaceMockAddHandler.RLock() + calls = mock.calls.AddHandler + lockVirtualServiceInterfaceMockAddHandler.RUnlock() + return calls +} + +// AddLifecycle calls AddLifecycleFunc. +func (mock *VirtualServiceInterfaceMock) AddLifecycle(ctx context.Context, name string, lifecycle v1alpha3a.VirtualServiceLifecycle) { + if mock.AddLifecycleFunc == nil { + panic("VirtualServiceInterfaceMock.AddLifecycleFunc: method is nil but VirtualServiceInterface.AddLifecycle was just called") + } + callInfo := struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle + }{ + Ctx: ctx, + Name: name, + Lifecycle: lifecycle, + } + lockVirtualServiceInterfaceMockAddLifecycle.Lock() + mock.calls.AddLifecycle = append(mock.calls.AddLifecycle, callInfo) + lockVirtualServiceInterfaceMockAddLifecycle.Unlock() + mock.AddLifecycleFunc(ctx, name, lifecycle) +} + +// AddLifecycleCalls gets all the calls that were made to AddLifecycle. +// Check the length with: +// len(mockedVirtualServiceInterface.AddLifecycleCalls()) +func (mock *VirtualServiceInterfaceMock) AddLifecycleCalls() []struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle +} { + var calls []struct { + Ctx context.Context + Name string + Lifecycle v1alpha3a.VirtualServiceLifecycle + } + lockVirtualServiceInterfaceMockAddLifecycle.RLock() + calls = mock.calls.AddLifecycle + lockVirtualServiceInterfaceMockAddLifecycle.RUnlock() + return calls +} + +// Controller calls ControllerFunc. +func (mock *VirtualServiceInterfaceMock) Controller() v1alpha3a.VirtualServiceController { + if mock.ControllerFunc == nil { + panic("VirtualServiceInterfaceMock.ControllerFunc: method is nil but VirtualServiceInterface.Controller was just called") + } + callInfo := struct { + }{} + lockVirtualServiceInterfaceMockController.Lock() + mock.calls.Controller = append(mock.calls.Controller, callInfo) + lockVirtualServiceInterfaceMockController.Unlock() + return mock.ControllerFunc() +} + +// ControllerCalls gets all the calls that were made to Controller. +// Check the length with: +// len(mockedVirtualServiceInterface.ControllerCalls()) +func (mock *VirtualServiceInterfaceMock) ControllerCalls() []struct { +} { + var calls []struct { + } + lockVirtualServiceInterfaceMockController.RLock() + calls = mock.calls.Controller + lockVirtualServiceInterfaceMockController.RUnlock() + return calls +} + +// Create calls CreateFunc. +func (mock *VirtualServiceInterfaceMock) Create(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + if mock.CreateFunc == nil { + panic("VirtualServiceInterfaceMock.CreateFunc: method is nil but VirtualServiceInterface.Create was just called") + } + callInfo := struct { + In1 *v1alpha3.VirtualService + }{ + In1: in1, + } + lockVirtualServiceInterfaceMockCreate.Lock() + mock.calls.Create = append(mock.calls.Create, callInfo) + lockVirtualServiceInterfaceMockCreate.Unlock() + return mock.CreateFunc(in1) +} + +// CreateCalls gets all the calls that were made to Create. +// Check the length with: +// len(mockedVirtualServiceInterface.CreateCalls()) +func (mock *VirtualServiceInterfaceMock) CreateCalls() []struct { + In1 *v1alpha3.VirtualService +} { + var calls []struct { + In1 *v1alpha3.VirtualService + } + lockVirtualServiceInterfaceMockCreate.RLock() + calls = mock.calls.Create + lockVirtualServiceInterfaceMockCreate.RUnlock() + return calls +} + +// Delete calls DeleteFunc. +func (mock *VirtualServiceInterfaceMock) Delete(name string, options *v1.DeleteOptions) error { + if mock.DeleteFunc == nil { + panic("VirtualServiceInterfaceMock.DeleteFunc: method is nil but VirtualServiceInterface.Delete was just called") + } + callInfo := struct { + Name string + Options *v1.DeleteOptions + }{ + Name: name, + Options: options, + } + lockVirtualServiceInterfaceMockDelete.Lock() + mock.calls.Delete = append(mock.calls.Delete, callInfo) + lockVirtualServiceInterfaceMockDelete.Unlock() + return mock.DeleteFunc(name, options) +} + +// DeleteCalls gets all the calls that were made to Delete. +// Check the length with: +// len(mockedVirtualServiceInterface.DeleteCalls()) +func (mock *VirtualServiceInterfaceMock) DeleteCalls() []struct { + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Name string + Options *v1.DeleteOptions + } + lockVirtualServiceInterfaceMockDelete.RLock() + calls = mock.calls.Delete + lockVirtualServiceInterfaceMockDelete.RUnlock() + return calls +} + +// DeleteCollection calls DeleteCollectionFunc. +func (mock *VirtualServiceInterfaceMock) DeleteCollection(deleteOpts *v1.DeleteOptions, listOpts v1.ListOptions) error { + if mock.DeleteCollectionFunc == nil { + panic("VirtualServiceInterfaceMock.DeleteCollectionFunc: method is nil but VirtualServiceInterface.DeleteCollection was just called") + } + callInfo := struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + }{ + DeleteOpts: deleteOpts, + ListOpts: listOpts, + } + lockVirtualServiceInterfaceMockDeleteCollection.Lock() + mock.calls.DeleteCollection = append(mock.calls.DeleteCollection, callInfo) + lockVirtualServiceInterfaceMockDeleteCollection.Unlock() + return mock.DeleteCollectionFunc(deleteOpts, listOpts) +} + +// DeleteCollectionCalls gets all the calls that were made to DeleteCollection. +// Check the length with: +// len(mockedVirtualServiceInterface.DeleteCollectionCalls()) +func (mock *VirtualServiceInterfaceMock) DeleteCollectionCalls() []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions +} { + var calls []struct { + DeleteOpts *v1.DeleteOptions + ListOpts v1.ListOptions + } + lockVirtualServiceInterfaceMockDeleteCollection.RLock() + calls = mock.calls.DeleteCollection + lockVirtualServiceInterfaceMockDeleteCollection.RUnlock() + return calls +} + +// DeleteNamespaced calls DeleteNamespacedFunc. +func (mock *VirtualServiceInterfaceMock) DeleteNamespaced(namespace string, name string, options *v1.DeleteOptions) error { + if mock.DeleteNamespacedFunc == nil { + panic("VirtualServiceInterfaceMock.DeleteNamespacedFunc: method is nil but VirtualServiceInterface.DeleteNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Options *v1.DeleteOptions + }{ + Namespace: namespace, + Name: name, + Options: options, + } + lockVirtualServiceInterfaceMockDeleteNamespaced.Lock() + mock.calls.DeleteNamespaced = append(mock.calls.DeleteNamespaced, callInfo) + lockVirtualServiceInterfaceMockDeleteNamespaced.Unlock() + return mock.DeleteNamespacedFunc(namespace, name, options) +} + +// DeleteNamespacedCalls gets all the calls that were made to DeleteNamespaced. +// Check the length with: +// len(mockedVirtualServiceInterface.DeleteNamespacedCalls()) +func (mock *VirtualServiceInterfaceMock) DeleteNamespacedCalls() []struct { + Namespace string + Name string + Options *v1.DeleteOptions +} { + var calls []struct { + Namespace string + Name string + Options *v1.DeleteOptions + } + lockVirtualServiceInterfaceMockDeleteNamespaced.RLock() + calls = mock.calls.DeleteNamespaced + lockVirtualServiceInterfaceMockDeleteNamespaced.RUnlock() + return calls +} + +// Get calls GetFunc. +func (mock *VirtualServiceInterfaceMock) Get(name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) { + if mock.GetFunc == nil { + panic("VirtualServiceInterfaceMock.GetFunc: method is nil but VirtualServiceInterface.Get was just called") + } + callInfo := struct { + Name string + Opts v1.GetOptions + }{ + Name: name, + Opts: opts, + } + lockVirtualServiceInterfaceMockGet.Lock() + mock.calls.Get = append(mock.calls.Get, callInfo) + lockVirtualServiceInterfaceMockGet.Unlock() + return mock.GetFunc(name, opts) +} + +// GetCalls gets all the calls that were made to Get. +// Check the length with: +// len(mockedVirtualServiceInterface.GetCalls()) +func (mock *VirtualServiceInterfaceMock) GetCalls() []struct { + Name string + Opts v1.GetOptions +} { + var calls []struct { + Name string + Opts v1.GetOptions + } + lockVirtualServiceInterfaceMockGet.RLock() + calls = mock.calls.Get + lockVirtualServiceInterfaceMockGet.RUnlock() + return calls +} + +// GetNamespaced calls GetNamespacedFunc. +func (mock *VirtualServiceInterfaceMock) GetNamespaced(namespace string, name string, opts v1.GetOptions) (*v1alpha3.VirtualService, error) { + if mock.GetNamespacedFunc == nil { + panic("VirtualServiceInterfaceMock.GetNamespacedFunc: method is nil but VirtualServiceInterface.GetNamespaced was just called") + } + callInfo := struct { + Namespace string + Name string + Opts v1.GetOptions + }{ + Namespace: namespace, + Name: name, + Opts: opts, + } + lockVirtualServiceInterfaceMockGetNamespaced.Lock() + mock.calls.GetNamespaced = append(mock.calls.GetNamespaced, callInfo) + lockVirtualServiceInterfaceMockGetNamespaced.Unlock() + return mock.GetNamespacedFunc(namespace, name, opts) +} + +// GetNamespacedCalls gets all the calls that were made to GetNamespaced. +// Check the length with: +// len(mockedVirtualServiceInterface.GetNamespacedCalls()) +func (mock *VirtualServiceInterfaceMock) GetNamespacedCalls() []struct { + Namespace string + Name string + Opts v1.GetOptions +} { + var calls []struct { + Namespace string + Name string + Opts v1.GetOptions + } + lockVirtualServiceInterfaceMockGetNamespaced.RLock() + calls = mock.calls.GetNamespaced + lockVirtualServiceInterfaceMockGetNamespaced.RUnlock() + return calls +} + +// List calls ListFunc. +func (mock *VirtualServiceInterfaceMock) List(opts v1.ListOptions) (*v1alpha3a.VirtualServiceList, error) { + if mock.ListFunc == nil { + panic("VirtualServiceInterfaceMock.ListFunc: method is nil but VirtualServiceInterface.List was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockVirtualServiceInterfaceMockList.Lock() + mock.calls.List = append(mock.calls.List, callInfo) + lockVirtualServiceInterfaceMockList.Unlock() + return mock.ListFunc(opts) +} + +// ListCalls gets all the calls that were made to List. +// Check the length with: +// len(mockedVirtualServiceInterface.ListCalls()) +func (mock *VirtualServiceInterfaceMock) ListCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockVirtualServiceInterfaceMockList.RLock() + calls = mock.calls.List + lockVirtualServiceInterfaceMockList.RUnlock() + return calls +} + +// ObjectClient calls ObjectClientFunc. +func (mock *VirtualServiceInterfaceMock) ObjectClient() *objectclient.ObjectClient { + if mock.ObjectClientFunc == nil { + panic("VirtualServiceInterfaceMock.ObjectClientFunc: method is nil but VirtualServiceInterface.ObjectClient was just called") + } + callInfo := struct { + }{} + lockVirtualServiceInterfaceMockObjectClient.Lock() + mock.calls.ObjectClient = append(mock.calls.ObjectClient, callInfo) + lockVirtualServiceInterfaceMockObjectClient.Unlock() + return mock.ObjectClientFunc() +} + +// ObjectClientCalls gets all the calls that were made to ObjectClient. +// Check the length with: +// len(mockedVirtualServiceInterface.ObjectClientCalls()) +func (mock *VirtualServiceInterfaceMock) ObjectClientCalls() []struct { +} { + var calls []struct { + } + lockVirtualServiceInterfaceMockObjectClient.RLock() + calls = mock.calls.ObjectClient + lockVirtualServiceInterfaceMockObjectClient.RUnlock() + return calls +} + +// Update calls UpdateFunc. +func (mock *VirtualServiceInterfaceMock) Update(in1 *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + if mock.UpdateFunc == nil { + panic("VirtualServiceInterfaceMock.UpdateFunc: method is nil but VirtualServiceInterface.Update was just called") + } + callInfo := struct { + In1 *v1alpha3.VirtualService + }{ + In1: in1, + } + lockVirtualServiceInterfaceMockUpdate.Lock() + mock.calls.Update = append(mock.calls.Update, callInfo) + lockVirtualServiceInterfaceMockUpdate.Unlock() + return mock.UpdateFunc(in1) +} + +// UpdateCalls gets all the calls that were made to Update. +// Check the length with: +// len(mockedVirtualServiceInterface.UpdateCalls()) +func (mock *VirtualServiceInterfaceMock) UpdateCalls() []struct { + In1 *v1alpha3.VirtualService +} { + var calls []struct { + In1 *v1alpha3.VirtualService + } + lockVirtualServiceInterfaceMockUpdate.RLock() + calls = mock.calls.Update + lockVirtualServiceInterfaceMockUpdate.RUnlock() + return calls +} + +// Watch calls WatchFunc. +func (mock *VirtualServiceInterfaceMock) Watch(opts v1.ListOptions) (watch.Interface, error) { + if mock.WatchFunc == nil { + panic("VirtualServiceInterfaceMock.WatchFunc: method is nil but VirtualServiceInterface.Watch was just called") + } + callInfo := struct { + Opts v1.ListOptions + }{ + Opts: opts, + } + lockVirtualServiceInterfaceMockWatch.Lock() + mock.calls.Watch = append(mock.calls.Watch, callInfo) + lockVirtualServiceInterfaceMockWatch.Unlock() + return mock.WatchFunc(opts) +} + +// WatchCalls gets all the calls that were made to Watch. +// Check the length with: +// len(mockedVirtualServiceInterface.WatchCalls()) +func (mock *VirtualServiceInterfaceMock) WatchCalls() []struct { + Opts v1.ListOptions +} { + var calls []struct { + Opts v1.ListOptions + } + lockVirtualServiceInterfaceMockWatch.RLock() + calls = mock.calls.Watch + lockVirtualServiceInterfaceMockWatch.RUnlock() + return calls +} + +var ( + lockVirtualServicesGetterMockVirtualServices sync.RWMutex +) + +// Ensure, that VirtualServicesGetterMock does implement VirtualServicesGetter. +// If this is not the case, regenerate this file with moq. +var _ v1alpha3a.VirtualServicesGetter = &VirtualServicesGetterMock{} + +// VirtualServicesGetterMock is a mock implementation of VirtualServicesGetter. +// +// func TestSomethingThatUsesVirtualServicesGetter(t *testing.T) { +// +// // make and configure a mocked VirtualServicesGetter +// mockedVirtualServicesGetter := &VirtualServicesGetterMock{ +// VirtualServicesFunc: func(namespace string) v1alpha3a.VirtualServiceInterface { +// panic("mock out the VirtualServices method") +// }, +// } +// +// // use mockedVirtualServicesGetter in code that requires VirtualServicesGetter +// // and then make assertions. +// +// } +type VirtualServicesGetterMock struct { + // VirtualServicesFunc mocks the VirtualServices method. + VirtualServicesFunc func(namespace string) v1alpha3a.VirtualServiceInterface + + // calls tracks calls to the methods. + calls struct { + // VirtualServices holds details about calls to the VirtualServices method. + VirtualServices []struct { + // Namespace is the namespace argument value. + Namespace string + } + } +} + +// VirtualServices calls VirtualServicesFunc. +func (mock *VirtualServicesGetterMock) VirtualServices(namespace string) v1alpha3a.VirtualServiceInterface { + if mock.VirtualServicesFunc == nil { + panic("VirtualServicesGetterMock.VirtualServicesFunc: method is nil but VirtualServicesGetter.VirtualServices was just called") + } + callInfo := struct { + Namespace string + }{ + Namespace: namespace, + } + lockVirtualServicesGetterMockVirtualServices.Lock() + mock.calls.VirtualServices = append(mock.calls.VirtualServices, callInfo) + lockVirtualServicesGetterMockVirtualServices.Unlock() + return mock.VirtualServicesFunc(namespace) +} + +// VirtualServicesCalls gets all the calls that were made to VirtualServices. +// Check the length with: +// len(mockedVirtualServicesGetter.VirtualServicesCalls()) +func (mock *VirtualServicesGetterMock) VirtualServicesCalls() []struct { + Namespace string +} { + var calls []struct { + Namespace string + } + lockVirtualServicesGetterMockVirtualServices.RLock() + calls = mock.calls.VirtualServices + lockVirtualServicesGetterMockVirtualServices.RUnlock() + return calls +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_deepcopy.go b/apis/networking.istio.io/v1alpha3/zz_generated_deepcopy.go new file mode 100644 index 00000000..61e90826 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_deepcopy.go @@ -0,0 +1,72 @@ +package v1alpha3 + +import ( + istiov1alpha3 "github.com/knative/pkg/apis/istio/v1alpha3" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationRuleList) DeepCopyInto(out *DestinationRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]istiov1alpha3.DestinationRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRuleList. +func (in *DestinationRuleList) DeepCopy() *DestinationRuleList { + if in == nil { + return nil + } + out := new(DestinationRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DestinationRuleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualServiceList) DeepCopyInto(out *VirtualServiceList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]istiov1alpha3.VirtualService, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualServiceList. +func (in *VirtualServiceList) DeepCopy() *VirtualServiceList { + if in == nil { + return nil + } + out := new(VirtualServiceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VirtualServiceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_controller.go b/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_controller.go new file mode 100644 index 00000000..9ac50508 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_controller.go @@ -0,0 +1,506 @@ +package v1alpha3 + +import ( + "context" + + "github.com/knative/pkg/apis/istio/v1alpha3" + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "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/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + DestinationRuleGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "DestinationRule", + } + DestinationRuleResource = metav1.APIResource{ + Name: "destinationrules", + SingularName: "destinationrule", + Namespaced: true, + + Kind: DestinationRuleGroupVersionKind.Kind, + } + + DestinationRuleGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "destinationrules", + } +) + +func init() { + resource.Put(DestinationRuleGroupVersionResource) +} + +func NewDestinationRule(namespace, name string, obj v1alpha3.DestinationRule) *v1alpha3.DestinationRule { + obj.APIVersion, obj.Kind = DestinationRuleGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type DestinationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []v1alpha3.DestinationRule `json:"items"` +} + +type DestinationRuleHandlerFunc func(key string, obj *v1alpha3.DestinationRule) (runtime.Object, error) + +type DestinationRuleChangeHandlerFunc func(obj *v1alpha3.DestinationRule) (runtime.Object, error) + +type DestinationRuleLister interface { + List(namespace string, selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) + Get(namespace, name string) (*v1alpha3.DestinationRule, error) +} + +type DestinationRuleController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() DestinationRuleLister + AddHandler(ctx context.Context, name string, handler DestinationRuleHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DestinationRuleHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler DestinationRuleHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler DestinationRuleHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type DestinationRuleInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) + Get(name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) + Update(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*DestinationRuleList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() DestinationRuleController + AddHandler(ctx context.Context, name string, sync DestinationRuleHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DestinationRuleHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle DestinationRuleLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DestinationRuleLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DestinationRuleHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DestinationRuleHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DestinationRuleLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DestinationRuleLifecycle) +} + +type destinationRuleLister struct { + controller *destinationRuleController +} + +func (l *destinationRuleLister) List(namespace string, selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*v1alpha3.DestinationRule)) + }) + return +} + +func (l *destinationRuleLister) Get(namespace, name string) (*v1alpha3.DestinationRule, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: DestinationRuleGroupVersionKind.Group, + Resource: "destinationRule", + }, key) + } + return obj.(*v1alpha3.DestinationRule), nil +} + +type destinationRuleController struct { + controller.GenericController +} + +func (c *destinationRuleController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *destinationRuleController) Lister() DestinationRuleLister { + return &destinationRuleLister{ + controller: c, + } +} + +func (c *destinationRuleController) AddHandler(ctx context.Context, name string, handler DestinationRuleHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.DestinationRule); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *destinationRuleController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler DestinationRuleHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.DestinationRule); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *destinationRuleController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler DestinationRuleHandlerFunc) { + resource.PutClusterScoped(DestinationRuleGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.DestinationRule); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *destinationRuleController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler DestinationRuleHandlerFunc) { + resource.PutClusterScoped(DestinationRuleGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.DestinationRule); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type destinationRuleFactory struct { +} + +func (c destinationRuleFactory) Object() runtime.Object { + return &v1alpha3.DestinationRule{} +} + +func (c destinationRuleFactory) List() runtime.Object { + return &DestinationRuleList{} +} + +func (s *destinationRuleClient) Controller() DestinationRuleController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.destinationRuleControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(DestinationRuleGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &destinationRuleController{ + GenericController: genericController, + } + + s.client.destinationRuleControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type destinationRuleClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller DestinationRuleController +} + +func (s *destinationRuleClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *destinationRuleClient) Create(o *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + obj, err := s.objectClient.Create(o) + return obj.(*v1alpha3.DestinationRule), err +} + +func (s *destinationRuleClient) Get(name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*v1alpha3.DestinationRule), err +} + +func (s *destinationRuleClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*v1alpha3.DestinationRule), err +} + +func (s *destinationRuleClient) Update(o *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*v1alpha3.DestinationRule), err +} + +func (s *destinationRuleClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *destinationRuleClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *destinationRuleClient) List(opts metav1.ListOptions) (*DestinationRuleList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*DestinationRuleList), err +} + +func (s *destinationRuleClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *destinationRuleClient) Patch(o *v1alpha3.DestinationRule, patchType types.PatchType, data []byte, subresources ...string) (*v1alpha3.DestinationRule, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*v1alpha3.DestinationRule), err +} + +func (s *destinationRuleClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *destinationRuleClient) AddHandler(ctx context.Context, name string, sync DestinationRuleHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *destinationRuleClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync DestinationRuleHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *destinationRuleClient) AddLifecycle(ctx context.Context, name string, lifecycle DestinationRuleLifecycle) { + sync := NewDestinationRuleLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *destinationRuleClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle DestinationRuleLifecycle) { + sync := NewDestinationRuleLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *destinationRuleClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync DestinationRuleHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *destinationRuleClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync DestinationRuleHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *destinationRuleClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle DestinationRuleLifecycle) { + sync := NewDestinationRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *destinationRuleClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle DestinationRuleLifecycle) { + sync := NewDestinationRuleLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +type DestinationRuleIndexer func(obj *v1alpha3.DestinationRule) ([]string, error) + +type DestinationRuleClientCache interface { + Get(namespace, name string) (*v1alpha3.DestinationRule, error) + List(namespace string, selector labels.Selector) ([]*v1alpha3.DestinationRule, error) + + Index(name string, indexer DestinationRuleIndexer) + GetIndexed(name, key string) ([]*v1alpha3.DestinationRule, error) +} + +type DestinationRuleClient interface { + Create(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + Get(namespace, name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) + Update(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*DestinationRuleList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() DestinationRuleClientCache + + OnCreate(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() DestinationRuleInterface +} + +type destinationRuleClientCache struct { + client *destinationRuleClient2 +} + +type destinationRuleClient2 struct { + iface DestinationRuleInterface + controller DestinationRuleController +} + +func (n *destinationRuleClient2) Interface() DestinationRuleInterface { + return n.iface +} + +func (n *destinationRuleClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *destinationRuleClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *destinationRuleClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *destinationRuleClient2) Create(obj *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + return n.iface.Create(obj) +} + +func (n *destinationRuleClient2) Get(namespace, name string, opts metav1.GetOptions) (*v1alpha3.DestinationRule, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *destinationRuleClient2) Update(obj *v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) { + return n.iface.Update(obj) +} + +func (n *destinationRuleClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *destinationRuleClient2) List(namespace string, opts metav1.ListOptions) (*DestinationRuleList, error) { + return n.iface.List(opts) +} + +func (n *destinationRuleClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *destinationRuleClientCache) Get(namespace, name string) (*v1alpha3.DestinationRule, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *destinationRuleClientCache) List(namespace string, selector labels.Selector) ([]*v1alpha3.DestinationRule, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *destinationRuleClient2) Cache() DestinationRuleClientCache { + n.loadController() + return &destinationRuleClientCache{ + client: n, + } +} + +func (n *destinationRuleClient2) OnCreate(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &destinationRuleLifecycleDelegate{create: sync}) +} + +func (n *destinationRuleClient2) OnChange(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &destinationRuleLifecycleDelegate{update: sync}) +} + +func (n *destinationRuleClient2) OnRemove(ctx context.Context, name string, sync DestinationRuleChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &destinationRuleLifecycleDelegate{remove: sync}) +} + +func (n *destinationRuleClientCache) Index(name string, indexer DestinationRuleIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*v1alpha3.DestinationRule); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *destinationRuleClientCache) GetIndexed(name, key string) ([]*v1alpha3.DestinationRule, error) { + var result []*v1alpha3.DestinationRule + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*v1alpha3.DestinationRule); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *destinationRuleClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type destinationRuleLifecycleDelegate struct { + create DestinationRuleChangeHandlerFunc + update DestinationRuleChangeHandlerFunc + remove DestinationRuleChangeHandlerFunc +} + +func (n *destinationRuleLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *destinationRuleLifecycleDelegate) Create(obj *v1alpha3.DestinationRule) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *destinationRuleLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *destinationRuleLifecycleDelegate) Remove(obj *v1alpha3.DestinationRule) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *destinationRuleLifecycleDelegate) Updated(obj *v1alpha3.DestinationRule) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_lifecycle_adapter.go b/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_lifecycle_adapter.go new file mode 100644 index 00000000..64519a9e --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_destination_rule_lifecycle_adapter.go @@ -0,0 +1,63 @@ +package v1alpha3 + +import ( + "github.com/knative/pkg/apis/istio/v1alpha3" + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type DestinationRuleLifecycle interface { + Create(obj *v1alpha3.DestinationRule) (runtime.Object, error) + Remove(obj *v1alpha3.DestinationRule) (runtime.Object, error) + Updated(obj *v1alpha3.DestinationRule) (runtime.Object, error) +} + +type destinationRuleLifecycleAdapter struct { + lifecycle DestinationRuleLifecycle +} + +func (w *destinationRuleLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *destinationRuleLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *destinationRuleLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*v1alpha3.DestinationRule)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *destinationRuleLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*v1alpha3.DestinationRule)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *destinationRuleLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*v1alpha3.DestinationRule)) + if o == nil { + return nil, err + } + return o, err +} + +func NewDestinationRuleLifecycleAdapter(name string, clusterScoped bool, client DestinationRuleInterface, l DestinationRuleLifecycle) DestinationRuleHandlerFunc { + adapter := &destinationRuleLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *v1alpha3.DestinationRule) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_k8s_client.go b/apis/networking.istio.io/v1alpha3/zz_generated_k8s_client.go new file mode 100644 index 00000000..6d16484e --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_k8s_client.go @@ -0,0 +1,139 @@ +package v1alpha3 + +import ( + "context" + "sync" + + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/objectclient/dynamic" + "github.com/rancher/norman/restwatch" + "k8s.io/client-go/rest" +) + +type ( + contextKeyType struct{} + contextClientsKeyType struct{} +) + +type Interface interface { + RESTClient() rest.Interface + controller.Starter + + VirtualServicesGetter + DestinationRulesGetter +} + +type Clients struct { + Interface Interface + + VirtualService VirtualServiceClient + DestinationRule DestinationRuleClient +} + +type Client struct { + sync.Mutex + restClient rest.Interface + starters []controller.Starter + + virtualServiceControllers map[string]VirtualServiceController + destinationRuleControllers map[string]DestinationRuleController +} + +func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) { + c, err := NewForConfig(config) + if err != nil { + return ctx, nil, err + } + + cs := NewClientsFromInterface(c) + + ctx = context.WithValue(ctx, contextKeyType{}, c) + ctx = context.WithValue(ctx, contextClientsKeyType{}, cs) + return ctx, c, nil +} + +func ClientsFrom(ctx context.Context) *Clients { + return ctx.Value(contextClientsKeyType{}).(*Clients) +} + +func From(ctx context.Context) Interface { + return ctx.Value(contextKeyType{}).(Interface) +} + +func NewClients(config rest.Config) (*Clients, error) { + iface, err := NewForConfig(config) + if err != nil { + return nil, err + } + return NewClientsFromInterface(iface), nil +} + +func NewClientsFromInterface(iface Interface) *Clients { + return &Clients{ + Interface: iface, + + VirtualService: &virtualServiceClient2{ + iface: iface.VirtualServices(""), + }, + DestinationRule: &destinationRuleClient2{ + iface: iface.DestinationRules(""), + }, + } +} + +func NewForConfig(config rest.Config) (Interface, error) { + if config.NegotiatedSerializer == nil { + config.NegotiatedSerializer = dynamic.NegotiatedSerializer + } + + restClient, err := restwatch.UnversionedRESTClientFor(&config) + if err != nil { + return nil, err + } + + return &Client{ + restClient: restClient, + + virtualServiceControllers: map[string]VirtualServiceController{}, + destinationRuleControllers: map[string]DestinationRuleController{}, + }, nil +} + +func (c *Client) RESTClient() rest.Interface { + return c.restClient +} + +func (c *Client) Sync(ctx context.Context) error { + return controller.Sync(ctx, c.starters...) +} + +func (c *Client) Start(ctx context.Context, threadiness int) error { + return controller.Start(ctx, threadiness, c.starters...) +} + +type VirtualServicesGetter interface { + VirtualServices(namespace string) VirtualServiceInterface +} + +func (c *Client) VirtualServices(namespace string) VirtualServiceInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &VirtualServiceResource, VirtualServiceGroupVersionKind, virtualServiceFactory{}) + return &virtualServiceClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} + +type DestinationRulesGetter interface { + DestinationRules(namespace string) DestinationRuleInterface +} + +func (c *Client) DestinationRules(namespace string) DestinationRuleInterface { + objectClient := objectclient.NewObjectClient(namespace, c.restClient, &DestinationRuleResource, DestinationRuleGroupVersionKind, destinationRuleFactory{}) + return &destinationRuleClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_scheme.go b/apis/networking.istio.io/v1alpha3/zz_generated_scheme.go new file mode 100644 index 00000000..acf8eb74 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_scheme.go @@ -0,0 +1,42 @@ +package v1alpha3 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + GroupName = "networking.istio.io" + Version = "v1alpha3" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version} + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + // TODO this gets cleaned up when the types are fixed + scheme.AddKnownTypes(SchemeGroupVersion, + + &VirtualServiceList{}, + &DestinationRuleList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_controller.go b/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_controller.go new file mode 100644 index 00000000..de677292 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_controller.go @@ -0,0 +1,506 @@ +package v1alpha3 + +import ( + "context" + + "github.com/knative/pkg/apis/istio/v1alpha3" + "github.com/rancher/norman/controller" + "github.com/rancher/norman/objectclient" + "github.com/rancher/norman/resource" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "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/types" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + VirtualServiceGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "VirtualService", + } + VirtualServiceResource = metav1.APIResource{ + Name: "virtualservices", + SingularName: "virtualservice", + Namespaced: true, + + Kind: VirtualServiceGroupVersionKind.Kind, + } + + VirtualServiceGroupVersionResource = schema.GroupVersionResource{ + Group: GroupName, + Version: Version, + Resource: "virtualservices", + } +) + +func init() { + resource.Put(VirtualServiceGroupVersionResource) +} + +func NewVirtualService(namespace, name string, obj v1alpha3.VirtualService) *v1alpha3.VirtualService { + obj.APIVersion, obj.Kind = VirtualServiceGroupVersionKind.ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} + +type VirtualServiceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []v1alpha3.VirtualService `json:"items"` +} + +type VirtualServiceHandlerFunc func(key string, obj *v1alpha3.VirtualService) (runtime.Object, error) + +type VirtualServiceChangeHandlerFunc func(obj *v1alpha3.VirtualService) (runtime.Object, error) + +type VirtualServiceLister interface { + List(namespace string, selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) + Get(namespace, name string) (*v1alpha3.VirtualService, error) +} + +type VirtualServiceController interface { + Generic() controller.GenericController + Informer() cache.SharedIndexInformer + Lister() VirtualServiceLister + AddHandler(ctx context.Context, name string, handler VirtualServiceHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync VirtualServiceHandlerFunc) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler VirtualServiceHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler VirtualServiceHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type VirtualServiceInterface interface { + ObjectClient() *objectclient.ObjectClient + Create(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) + Get(name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) + Update(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*VirtualServiceList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() VirtualServiceController + AddHandler(ctx context.Context, name string, sync VirtualServiceHandlerFunc) + AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync VirtualServiceHandlerFunc) + AddLifecycle(ctx context.Context, name string, lifecycle VirtualServiceLifecycle) + AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle VirtualServiceLifecycle) + AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync VirtualServiceHandlerFunc) + AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync VirtualServiceHandlerFunc) + AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle VirtualServiceLifecycle) + AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle VirtualServiceLifecycle) +} + +type virtualServiceLister struct { + controller *virtualServiceController +} + +func (l *virtualServiceLister) List(namespace string, selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*v1alpha3.VirtualService)) + }) + return +} + +func (l *virtualServiceLister) Get(namespace, name string) (*v1alpha3.VirtualService, error) { + var key string + if namespace != "" { + key = namespace + "/" + name + } else { + key = name + } + obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(schema.GroupResource{ + Group: VirtualServiceGroupVersionKind.Group, + Resource: "virtualService", + }, key) + } + return obj.(*v1alpha3.VirtualService), nil +} + +type virtualServiceController struct { + controller.GenericController +} + +func (c *virtualServiceController) Generic() controller.GenericController { + return c.GenericController +} + +func (c *virtualServiceController) Lister() VirtualServiceLister { + return &virtualServiceLister{ + controller: c, + } +} + +func (c *virtualServiceController) AddHandler(ctx context.Context, name string, handler VirtualServiceHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.VirtualService); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *virtualServiceController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler VirtualServiceHandlerFunc) { + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.VirtualService); ok { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *virtualServiceController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler VirtualServiceHandlerFunc) { + resource.PutClusterScoped(VirtualServiceGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.VirtualService); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +func (c *virtualServiceController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler VirtualServiceHandlerFunc) { + resource.PutClusterScoped(VirtualServiceGroupVersionResource) + c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) { + if !enabled() { + return nil, nil + } else if obj == nil { + return handler(key, nil) + } else if v, ok := obj.(*v1alpha3.VirtualService); ok && controller.ObjectInCluster(cluster, obj) { + return handler(key, v) + } else { + return nil, nil + } + }) +} + +type virtualServiceFactory struct { +} + +func (c virtualServiceFactory) Object() runtime.Object { + return &v1alpha3.VirtualService{} +} + +func (c virtualServiceFactory) List() runtime.Object { + return &VirtualServiceList{} +} + +func (s *virtualServiceClient) Controller() VirtualServiceController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.virtualServiceControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(VirtualServiceGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &virtualServiceController{ + GenericController: genericController, + } + + s.client.virtualServiceControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type virtualServiceClient struct { + client *Client + ns string + objectClient *objectclient.ObjectClient + controller VirtualServiceController +} + +func (s *virtualServiceClient) ObjectClient() *objectclient.ObjectClient { + return s.objectClient +} + +func (s *virtualServiceClient) Create(o *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + obj, err := s.objectClient.Create(o) + return obj.(*v1alpha3.VirtualService), err +} + +func (s *virtualServiceClient) Get(name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*v1alpha3.VirtualService), err +} + +func (s *virtualServiceClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*v1alpha3.VirtualService), err +} + +func (s *virtualServiceClient) Update(o *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*v1alpha3.VirtualService), err +} + +func (s *virtualServiceClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *virtualServiceClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *virtualServiceClient) List(opts metav1.ListOptions) (*VirtualServiceList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*VirtualServiceList), err +} + +func (s *virtualServiceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *virtualServiceClient) Patch(o *v1alpha3.VirtualService, patchType types.PatchType, data []byte, subresources ...string) (*v1alpha3.VirtualService, error) { + obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...) + return obj.(*v1alpha3.VirtualService), err +} + +func (s *virtualServiceClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *virtualServiceClient) AddHandler(ctx context.Context, name string, sync VirtualServiceHandlerFunc) { + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *virtualServiceClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync VirtualServiceHandlerFunc) { + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *virtualServiceClient) AddLifecycle(ctx context.Context, name string, lifecycle VirtualServiceLifecycle) { + sync := NewVirtualServiceLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddHandler(ctx, name, sync) +} + +func (s *virtualServiceClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle VirtualServiceLifecycle) { + sync := NewVirtualServiceLifecycleAdapter(name, false, s, lifecycle) + s.Controller().AddFeatureHandler(ctx, enabled, name, sync) +} + +func (s *virtualServiceClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync VirtualServiceHandlerFunc) { + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *virtualServiceClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync VirtualServiceHandlerFunc) { + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +func (s *virtualServiceClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle VirtualServiceLifecycle) { + sync := NewVirtualServiceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync) +} + +func (s *virtualServiceClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle VirtualServiceLifecycle) { + sync := NewVirtualServiceLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync) +} + +type VirtualServiceIndexer func(obj *v1alpha3.VirtualService) ([]string, error) + +type VirtualServiceClientCache interface { + Get(namespace, name string) (*v1alpha3.VirtualService, error) + List(namespace string, selector labels.Selector) ([]*v1alpha3.VirtualService, error) + + Index(name string, indexer VirtualServiceIndexer) + GetIndexed(name, key string) ([]*v1alpha3.VirtualService, error) +} + +type VirtualServiceClient interface { + Create(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + Get(namespace, name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) + Update(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + Delete(namespace, name string, options *metav1.DeleteOptions) error + List(namespace string, opts metav1.ListOptions) (*VirtualServiceList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + + Cache() VirtualServiceClientCache + + OnCreate(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) + OnChange(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) + OnRemove(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) + Enqueue(namespace, name string) + + Generic() controller.GenericController + ObjectClient() *objectclient.ObjectClient + Interface() VirtualServiceInterface +} + +type virtualServiceClientCache struct { + client *virtualServiceClient2 +} + +type virtualServiceClient2 struct { + iface VirtualServiceInterface + controller VirtualServiceController +} + +func (n *virtualServiceClient2) Interface() VirtualServiceInterface { + return n.iface +} + +func (n *virtualServiceClient2) Generic() controller.GenericController { + return n.iface.Controller().Generic() +} + +func (n *virtualServiceClient2) ObjectClient() *objectclient.ObjectClient { + return n.Interface().ObjectClient() +} + +func (n *virtualServiceClient2) Enqueue(namespace, name string) { + n.iface.Controller().Enqueue(namespace, name) +} + +func (n *virtualServiceClient2) Create(obj *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + return n.iface.Create(obj) +} + +func (n *virtualServiceClient2) Get(namespace, name string, opts metav1.GetOptions) (*v1alpha3.VirtualService, error) { + return n.iface.GetNamespaced(namespace, name, opts) +} + +func (n *virtualServiceClient2) Update(obj *v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) { + return n.iface.Update(obj) +} + +func (n *virtualServiceClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return n.iface.DeleteNamespaced(namespace, name, options) +} + +func (n *virtualServiceClient2) List(namespace string, opts metav1.ListOptions) (*VirtualServiceList, error) { + return n.iface.List(opts) +} + +func (n *virtualServiceClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return n.iface.Watch(opts) +} + +func (n *virtualServiceClientCache) Get(namespace, name string) (*v1alpha3.VirtualService, error) { + return n.client.controller.Lister().Get(namespace, name) +} + +func (n *virtualServiceClientCache) List(namespace string, selector labels.Selector) ([]*v1alpha3.VirtualService, error) { + return n.client.controller.Lister().List(namespace, selector) +} + +func (n *virtualServiceClient2) Cache() VirtualServiceClientCache { + n.loadController() + return &virtualServiceClientCache{ + client: n, + } +} + +func (n *virtualServiceClient2) OnCreate(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-create", &virtualServiceLifecycleDelegate{create: sync}) +} + +func (n *virtualServiceClient2) OnChange(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name+"-change", &virtualServiceLifecycleDelegate{update: sync}) +} + +func (n *virtualServiceClient2) OnRemove(ctx context.Context, name string, sync VirtualServiceChangeHandlerFunc) { + n.loadController() + n.iface.AddLifecycle(ctx, name, &virtualServiceLifecycleDelegate{remove: sync}) +} + +func (n *virtualServiceClientCache) Index(name string, indexer VirtualServiceIndexer) { + err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{ + name: func(obj interface{}) ([]string, error) { + if v, ok := obj.(*v1alpha3.VirtualService); ok { + return indexer(v) + } + return nil, nil + }, + }) + + if err != nil { + panic(err) + } +} + +func (n *virtualServiceClientCache) GetIndexed(name, key string) ([]*v1alpha3.VirtualService, error) { + var result []*v1alpha3.VirtualService + objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key) + if err != nil { + return nil, err + } + for _, obj := range objs { + if v, ok := obj.(*v1alpha3.VirtualService); ok { + result = append(result, v) + } + } + + return result, nil +} + +func (n *virtualServiceClient2) loadController() { + if n.controller == nil { + n.controller = n.iface.Controller() + } +} + +type virtualServiceLifecycleDelegate struct { + create VirtualServiceChangeHandlerFunc + update VirtualServiceChangeHandlerFunc + remove VirtualServiceChangeHandlerFunc +} + +func (n *virtualServiceLifecycleDelegate) HasCreate() bool { + return n.create != nil +} + +func (n *virtualServiceLifecycleDelegate) Create(obj *v1alpha3.VirtualService) (runtime.Object, error) { + if n.create == nil { + return obj, nil + } + return n.create(obj) +} + +func (n *virtualServiceLifecycleDelegate) HasFinalize() bool { + return n.remove != nil +} + +func (n *virtualServiceLifecycleDelegate) Remove(obj *v1alpha3.VirtualService) (runtime.Object, error) { + if n.remove == nil { + return obj, nil + } + return n.remove(obj) +} + +func (n *virtualServiceLifecycleDelegate) Updated(obj *v1alpha3.VirtualService) (runtime.Object, error) { + if n.update == nil { + return obj, nil + } + return n.update(obj) +} diff --git a/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_lifecycle_adapter.go b/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_lifecycle_adapter.go new file mode 100644 index 00000000..bbd06a30 --- /dev/null +++ b/apis/networking.istio.io/v1alpha3/zz_generated_virtual_service_lifecycle_adapter.go @@ -0,0 +1,63 @@ +package v1alpha3 + +import ( + "github.com/knative/pkg/apis/istio/v1alpha3" + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type VirtualServiceLifecycle interface { + Create(obj *v1alpha3.VirtualService) (runtime.Object, error) + Remove(obj *v1alpha3.VirtualService) (runtime.Object, error) + Updated(obj *v1alpha3.VirtualService) (runtime.Object, error) +} + +type virtualServiceLifecycleAdapter struct { + lifecycle VirtualServiceLifecycle +} + +func (w *virtualServiceLifecycleAdapter) HasCreate() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasCreate() +} + +func (w *virtualServiceLifecycleAdapter) HasFinalize() bool { + o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition) + return !ok || o.HasFinalize() +} + +func (w *virtualServiceLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*v1alpha3.VirtualService)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *virtualServiceLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*v1alpha3.VirtualService)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *virtualServiceLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*v1alpha3.VirtualService)) + if o == nil { + return nil, err + } + return o, err +} + +func NewVirtualServiceLifecycleAdapter(name string, clusterScoped bool, client VirtualServiceInterface, l VirtualServiceLifecycle) VirtualServiceHandlerFunc { + adapter := &virtualServiceLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *v1alpha3.VirtualService) (runtime.Object, error) { + newObj, err := syncFn(key, obj) + if o, ok := newObj.(runtime.Object); ok { + return o, err + } + return nil, err + } +} diff --git a/client/project/v3/zz_generated_client.go b/client/project/v3/zz_generated_client.go index 0fbd8fd0..f6a2a78c 100644 --- a/client/project/v3/zz_generated_client.go +++ b/client/project/v3/zz_generated_client.go @@ -47,6 +47,8 @@ type Client struct { PrometheusRule PrometheusRuleOperations Alertmanager AlertmanagerOperations HorizontalPodAutoscaler HorizontalPodAutoscalerOperations + VirtualService VirtualServiceOperations + DestinationRule DestinationRuleOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -99,6 +101,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.PrometheusRule = newPrometheusRuleClient(client) client.Alertmanager = newAlertmanagerClient(client) client.HorizontalPodAutoscaler = newHorizontalPodAutoscalerClient(client) + client.VirtualService = newVirtualServiceClient(client) + client.DestinationRule = newDestinationRuleClient(client) return client, nil } diff --git a/client/project/v3/zz_generated_connection_pool_settings.go b/client/project/v3/zz_generated_connection_pool_settings.go new file mode 100644 index 00000000..2218a7a3 --- /dev/null +++ b/client/project/v3/zz_generated_connection_pool_settings.go @@ -0,0 +1,12 @@ +package client + +const ( + ConnectionPoolSettingsType = "connectionPoolSettings" + ConnectionPoolSettingsFieldHTTP = "http" + ConnectionPoolSettingsFieldTCP = "tcp" +) + +type ConnectionPoolSettings struct { + HTTP *HTTPSettings `json:"http,omitempty" yaml:"http,omitempty"` + TCP *TCPSettings `json:"tcp,omitempty" yaml:"tcp,omitempty"` +} diff --git a/client/project/v3/zz_generated_consistent_hash_lb.go b/client/project/v3/zz_generated_consistent_hash_lb.go new file mode 100644 index 00000000..f248a849 --- /dev/null +++ b/client/project/v3/zz_generated_consistent_hash_lb.go @@ -0,0 +1,16 @@ +package client + +const ( + ConsistentHashLBType = "consistentHashLB" + ConsistentHashLBFieldHTTPCookie = "httpCookie" + ConsistentHashLBFieldHTTPHeaderName = "httpHeaderName" + ConsistentHashLBFieldMinimumRingSize = "minimumRingSize" + ConsistentHashLBFieldUseSourceIP = "useSourceIp" +) + +type ConsistentHashLB struct { + HTTPCookie *HTTPCookie `json:"httpCookie,omitempty" yaml:"httpCookie,omitempty"` + HTTPHeaderName string `json:"httpHeaderName,omitempty" yaml:"httpHeaderName,omitempty"` + MinimumRingSize int64 `json:"minimumRingSize,omitempty" yaml:"minimumRingSize,omitempty"` + UseSourceIP bool `json:"useSourceIp,omitempty" yaml:"useSourceIp,omitempty"` +} diff --git a/client/project/v3/zz_generated_cors_policy.go b/client/project/v3/zz_generated_cors_policy.go new file mode 100644 index 00000000..6c1b44e9 --- /dev/null +++ b/client/project/v3/zz_generated_cors_policy.go @@ -0,0 +1,20 @@ +package client + +const ( + CorsPolicyType = "corsPolicy" + CorsPolicyFieldAllowCredentials = "allowCredentials" + CorsPolicyFieldAllowHeaders = "allowHeaders" + CorsPolicyFieldAllowMethods = "allowMethods" + CorsPolicyFieldAllowOrigin = "allowOrigin" + CorsPolicyFieldExposeHeaders = "exposeHeaders" + CorsPolicyFieldMaxAge = "maxAge" +) + +type CorsPolicy struct { + AllowCredentials bool `json:"allowCredentials,omitempty" yaml:"allowCredentials,omitempty"` + AllowHeaders []string `json:"allowHeaders,omitempty" yaml:"allowHeaders,omitempty"` + AllowMethods []string `json:"allowMethods,omitempty" yaml:"allowMethods,omitempty"` + AllowOrigin []string `json:"allowOrigin,omitempty" yaml:"allowOrigin,omitempty"` + ExposeHeaders []string `json:"exposeHeaders,omitempty" yaml:"exposeHeaders,omitempty"` + MaxAge string `json:"maxAge,omitempty" yaml:"maxAge,omitempty"` +} diff --git a/client/project/v3/zz_generated_destination.go b/client/project/v3/zz_generated_destination.go new file mode 100644 index 00000000..51d1b083 --- /dev/null +++ b/client/project/v3/zz_generated_destination.go @@ -0,0 +1,14 @@ +package client + +const ( + DestinationType = "destination" + DestinationFieldHost = "host" + DestinationFieldPort = "port" + DestinationFieldSubset = "subset" +) + +type Destination struct { + Host string `json:"host,omitempty" yaml:"host,omitempty"` + Port *PortSelector `json:"port,omitempty" yaml:"port,omitempty"` + Subset string `json:"subset,omitempty" yaml:"subset,omitempty"` +} diff --git a/client/project/v3/zz_generated_destination_rule.go b/client/project/v3/zz_generated_destination_rule.go new file mode 100644 index 00000000..ed478d53 --- /dev/null +++ b/client/project/v3/zz_generated_destination_rule.go @@ -0,0 +1,117 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + DestinationRuleType = "destinationRule" + DestinationRuleFieldAnnotations = "annotations" + DestinationRuleFieldCreated = "created" + DestinationRuleFieldCreatorID = "creatorId" + DestinationRuleFieldHost = "host" + DestinationRuleFieldLabels = "labels" + DestinationRuleFieldName = "name" + DestinationRuleFieldNamespaceId = "namespaceId" + DestinationRuleFieldOwnerReferences = "ownerReferences" + DestinationRuleFieldProjectID = "projectId" + DestinationRuleFieldRemoved = "removed" + DestinationRuleFieldState = "state" + DestinationRuleFieldStatus = "status" + DestinationRuleFieldSubsets = "subsets" + DestinationRuleFieldTrafficPolicy = "trafficPolicy" + DestinationRuleFieldTransitioning = "transitioning" + DestinationRuleFieldTransitioningMessage = "transitioningMessage" + DestinationRuleFieldUUID = "uuid" +) + +type DestinationRule struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Host string `json:"host,omitempty" yaml:"host,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status interface{} `json:"status,omitempty" yaml:"status,omitempty"` + Subsets []Subset `json:"subsets,omitempty" yaml:"subsets,omitempty"` + TrafficPolicy *TrafficPolicy `json:"trafficPolicy,omitempty" yaml:"trafficPolicy,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type DestinationRuleCollection struct { + types.Collection + Data []DestinationRule `json:"data,omitempty"` + client *DestinationRuleClient +} + +type DestinationRuleClient struct { + apiClient *Client +} + +type DestinationRuleOperations interface { + List(opts *types.ListOpts) (*DestinationRuleCollection, error) + Create(opts *DestinationRule) (*DestinationRule, error) + Update(existing *DestinationRule, updates interface{}) (*DestinationRule, error) + Replace(existing *DestinationRule) (*DestinationRule, error) + ByID(id string) (*DestinationRule, error) + Delete(container *DestinationRule) error +} + +func newDestinationRuleClient(apiClient *Client) *DestinationRuleClient { + return &DestinationRuleClient{ + apiClient: apiClient, + } +} + +func (c *DestinationRuleClient) Create(container *DestinationRule) (*DestinationRule, error) { + resp := &DestinationRule{} + err := c.apiClient.Ops.DoCreate(DestinationRuleType, container, resp) + return resp, err +} + +func (c *DestinationRuleClient) Update(existing *DestinationRule, updates interface{}) (*DestinationRule, error) { + resp := &DestinationRule{} + err := c.apiClient.Ops.DoUpdate(DestinationRuleType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *DestinationRuleClient) Replace(obj *DestinationRule) (*DestinationRule, error) { + resp := &DestinationRule{} + err := c.apiClient.Ops.DoReplace(DestinationRuleType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *DestinationRuleClient) List(opts *types.ListOpts) (*DestinationRuleCollection, error) { + resp := &DestinationRuleCollection{} + err := c.apiClient.Ops.DoList(DestinationRuleType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *DestinationRuleCollection) Next() (*DestinationRuleCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &DestinationRuleCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *DestinationRuleClient) ByID(id string) (*DestinationRule, error) { + resp := &DestinationRule{} + err := c.apiClient.Ops.DoByID(DestinationRuleType, id, resp) + return resp, err +} + +func (c *DestinationRuleClient) Delete(container *DestinationRule) error { + return c.apiClient.Ops.DoResourceDelete(DestinationRuleType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_destination_rule_spec.go b/client/project/v3/zz_generated_destination_rule_spec.go new file mode 100644 index 00000000..5127c64d --- /dev/null +++ b/client/project/v3/zz_generated_destination_rule_spec.go @@ -0,0 +1,14 @@ +package client + +const ( + DestinationRuleSpecType = "destinationRuleSpec" + DestinationRuleSpecFieldHost = "host" + DestinationRuleSpecFieldSubsets = "subsets" + DestinationRuleSpecFieldTrafficPolicy = "trafficPolicy" +) + +type DestinationRuleSpec struct { + Host string `json:"host,omitempty" yaml:"host,omitempty"` + Subsets []Subset `json:"subsets,omitempty" yaml:"subsets,omitempty"` + TrafficPolicy *TrafficPolicy `json:"trafficPolicy,omitempty" yaml:"trafficPolicy,omitempty"` +} diff --git a/client/project/v3/zz_generated_header_operations.go b/client/project/v3/zz_generated_header_operations.go new file mode 100644 index 00000000..a6d7e9b1 --- /dev/null +++ b/client/project/v3/zz_generated_header_operations.go @@ -0,0 +1,14 @@ +package client + +const ( + HeaderOperationsType = "headerOperations" + HeaderOperationsFieldAdd = "add" + HeaderOperationsFieldRemove = "remove" + HeaderOperationsFieldSet = "set" +) + +type HeaderOperations struct { + Add map[string]string `json:"add,omitempty" yaml:"add,omitempty"` + Remove []string `json:"remove,omitempty" yaml:"remove,omitempty"` + Set map[string]string `json:"set,omitempty" yaml:"set,omitempty"` +} diff --git a/client/project/v3/zz_generated_headers.go b/client/project/v3/zz_generated_headers.go new file mode 100644 index 00000000..ab92e1ce --- /dev/null +++ b/client/project/v3/zz_generated_headers.go @@ -0,0 +1,12 @@ +package client + +const ( + HeadersType = "headers" + HeadersFieldRequest = "request" + HeadersFieldResponse = "response" +) + +type Headers struct { + Request *HeaderOperations `json:"request,omitempty" yaml:"request,omitempty"` + Response *HeaderOperations `json:"response,omitempty" yaml:"response,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_cookie.go b/client/project/v3/zz_generated_http_cookie.go new file mode 100644 index 00000000..4c5d1b99 --- /dev/null +++ b/client/project/v3/zz_generated_http_cookie.go @@ -0,0 +1,14 @@ +package client + +const ( + HTTPCookieType = "httpCookie" + HTTPCookieFieldName = "name" + HTTPCookieFieldPath = "path" + HTTPCookieFieldTTL = "ttl" +) + +type HTTPCookie struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` + TTL string `json:"ttl,omitempty" yaml:"ttl,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_fault_injection.go b/client/project/v3/zz_generated_http_fault_injection.go new file mode 100644 index 00000000..fe98c075 --- /dev/null +++ b/client/project/v3/zz_generated_http_fault_injection.go @@ -0,0 +1,12 @@ +package client + +const ( + HTTPFaultInjectionType = "httpFaultInjection" + HTTPFaultInjectionFieldAbort = "abort" + HTTPFaultInjectionFieldDelay = "delay" +) + +type HTTPFaultInjection struct { + Abort *InjectAbort `json:"abort,omitempty" yaml:"abort,omitempty"` + Delay *InjectDelay `json:"delay,omitempty" yaml:"delay,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_match_request.go b/client/project/v3/zz_generated_http_match_request.go new file mode 100644 index 00000000..f7eac8f4 --- /dev/null +++ b/client/project/v3/zz_generated_http_match_request.go @@ -0,0 +1,24 @@ +package client + +const ( + HTTPMatchRequestType = "httpMatchRequest" + HTTPMatchRequestFieldAuthority = "authority" + HTTPMatchRequestFieldGateways = "gateways" + HTTPMatchRequestFieldHeaders = "headers" + HTTPMatchRequestFieldMethod = "method" + HTTPMatchRequestFieldPort = "port" + HTTPMatchRequestFieldScheme = "scheme" + HTTPMatchRequestFieldSourceLabels = "sourceLabels" + HTTPMatchRequestFieldURI = "uri" +) + +type HTTPMatchRequest struct { + Authority *StringMatch `json:"authority,omitempty" yaml:"authority,omitempty"` + Gateways []string `json:"gateways,omitempty" yaml:"gateways,omitempty"` + Headers map[string]StringMatch `json:"headers,omitempty" yaml:"headers,omitempty"` + Method *StringMatch `json:"method,omitempty" yaml:"method,omitempty"` + Port *int64 `json:"port,omitempty" yaml:"port,omitempty"` + Scheme *StringMatch `json:"scheme,omitempty" yaml:"scheme,omitempty"` + SourceLabels map[string]string `json:"sourceLabels,omitempty" yaml:"sourceLabels,omitempty"` + URI *StringMatch `json:"uri,omitempty" yaml:"uri,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_redirect.go b/client/project/v3/zz_generated_http_redirect.go new file mode 100644 index 00000000..29efd0cd --- /dev/null +++ b/client/project/v3/zz_generated_http_redirect.go @@ -0,0 +1,12 @@ +package client + +const ( + HTTPRedirectType = "httpRedirect" + HTTPRedirectFieldAuthority = "authority" + HTTPRedirectFieldURI = "uri" +) + +type HTTPRedirect struct { + Authority string `json:"authority,omitempty" yaml:"authority,omitempty"` + URI string `json:"uri,omitempty" yaml:"uri,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_retry.go b/client/project/v3/zz_generated_http_retry.go new file mode 100644 index 00000000..654c94a4 --- /dev/null +++ b/client/project/v3/zz_generated_http_retry.go @@ -0,0 +1,12 @@ +package client + +const ( + HTTPRetryType = "httpRetry" + HTTPRetryFieldAttempts = "attempts" + HTTPRetryFieldPerTryTimeout = "perTryTimeout" +) + +type HTTPRetry struct { + Attempts int64 `json:"attempts,omitempty" yaml:"attempts,omitempty"` + PerTryTimeout string `json:"perTryTimeout,omitempty" yaml:"perTryTimeout,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_rewrite.go b/client/project/v3/zz_generated_http_rewrite.go new file mode 100644 index 00000000..8724c049 --- /dev/null +++ b/client/project/v3/zz_generated_http_rewrite.go @@ -0,0 +1,12 @@ +package client + +const ( + HTTPRewriteType = "httpRewrite" + HTTPRewriteFieldAuthority = "authority" + HTTPRewriteFieldURI = "uri" +) + +type HTTPRewrite struct { + Authority string `json:"authority,omitempty" yaml:"authority,omitempty"` + URI string `json:"uri,omitempty" yaml:"uri,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_route.go b/client/project/v3/zz_generated_http_route.go new file mode 100644 index 00000000..1fa40bff --- /dev/null +++ b/client/project/v3/zz_generated_http_route.go @@ -0,0 +1,34 @@ +package client + +const ( + HTTPRouteType = "httpRoute" + HTTPRouteFieldCorsPolicy = "corsPolicy" + HTTPRouteFieldDeprecatedAppendHeaders = "appendHeaders" + HTTPRouteFieldFault = "fault" + HTTPRouteFieldHeaders = "headers" + HTTPRouteFieldMatch = "match" + HTTPRouteFieldMirror = "mirror" + HTTPRouteFieldRedirect = "redirect" + HTTPRouteFieldRemoveResponseHeaders = "removeResponseHeaders" + HTTPRouteFieldRetries = "retries" + HTTPRouteFieldRewrite = "rewrite" + HTTPRouteFieldRoute = "route" + HTTPRouteFieldTimeout = "timeout" + HTTPRouteFieldWebsocketUpgrade = "websocketUpgrade" +) + +type HTTPRoute struct { + CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty" yaml:"corsPolicy,omitempty"` + DeprecatedAppendHeaders map[string]string `json:"appendHeaders,omitempty" yaml:"appendHeaders,omitempty"` + Fault *HTTPFaultInjection `json:"fault,omitempty" yaml:"fault,omitempty"` + Headers *Headers `json:"headers,omitempty" yaml:"headers,omitempty"` + Match []HTTPMatchRequest `json:"match,omitempty" yaml:"match,omitempty"` + Mirror *Destination `json:"mirror,omitempty" yaml:"mirror,omitempty"` + Redirect *HTTPRedirect `json:"redirect,omitempty" yaml:"redirect,omitempty"` + RemoveResponseHeaders map[string]string `json:"removeResponseHeaders,omitempty" yaml:"removeResponseHeaders,omitempty"` + Retries *HTTPRetry `json:"retries,omitempty" yaml:"retries,omitempty"` + Rewrite *HTTPRewrite `json:"rewrite,omitempty" yaml:"rewrite,omitempty"` + Route []HTTPRouteDestination `json:"route,omitempty" yaml:"route,omitempty"` + Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"` + WebsocketUpgrade *bool `json:"websocketUpgrade,omitempty" yaml:"websocketUpgrade,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_route_destination.go b/client/project/v3/zz_generated_http_route_destination.go new file mode 100644 index 00000000..05692a30 --- /dev/null +++ b/client/project/v3/zz_generated_http_route_destination.go @@ -0,0 +1,14 @@ +package client + +const ( + HTTPRouteDestinationType = "httpRouteDestination" + HTTPRouteDestinationFieldDestination = "destination" + HTTPRouteDestinationFieldHeaders = "headers" + HTTPRouteDestinationFieldWeight = "weight" +) + +type HTTPRouteDestination struct { + Destination *Destination `json:"destination,omitempty" yaml:"destination,omitempty"` + Headers *Headers `json:"headers,omitempty" yaml:"headers,omitempty"` + Weight int64 `json:"weight,omitempty" yaml:"weight,omitempty"` +} diff --git a/client/project/v3/zz_generated_http_settings.go b/client/project/v3/zz_generated_http_settings.go new file mode 100644 index 00000000..dc04c2b6 --- /dev/null +++ b/client/project/v3/zz_generated_http_settings.go @@ -0,0 +1,16 @@ +package client + +const ( + HTTPSettingsType = "httpSettings" + HTTPSettingsFieldHTTP1MaxPendingRequests = "http1MaxPendingRequests" + HTTPSettingsFieldHTTP2MaxRequests = "http2MaxRequests" + HTTPSettingsFieldMaxRequestsPerConnection = "maxRequestsPerConnection" + HTTPSettingsFieldMaxRetries = "maxRetries" +) + +type HTTPSettings struct { + HTTP1MaxPendingRequests int64 `json:"http1MaxPendingRequests,omitempty" yaml:"http1MaxPendingRequests,omitempty"` + HTTP2MaxRequests int64 `json:"http2MaxRequests,omitempty" yaml:"http2MaxRequests,omitempty"` + MaxRequestsPerConnection int64 `json:"maxRequestsPerConnection,omitempty" yaml:"maxRequestsPerConnection,omitempty"` + MaxRetries int64 `json:"maxRetries,omitempty" yaml:"maxRetries,omitempty"` +} diff --git a/client/project/v3/zz_generated_inject_abort.go b/client/project/v3/zz_generated_inject_abort.go new file mode 100644 index 00000000..1642770b --- /dev/null +++ b/client/project/v3/zz_generated_inject_abort.go @@ -0,0 +1,12 @@ +package client + +const ( + InjectAbortType = "injectAbort" + InjectAbortFieldHTTPStatus = "httpStatus" + InjectAbortFieldPercent = "percent" +) + +type InjectAbort struct { + HTTPStatus int64 `json:"httpStatus,omitempty" yaml:"httpStatus,omitempty"` + Percent int64 `json:"percent,omitempty" yaml:"percent,omitempty"` +} diff --git a/client/project/v3/zz_generated_inject_delay.go b/client/project/v3/zz_generated_inject_delay.go new file mode 100644 index 00000000..fab6cb64 --- /dev/null +++ b/client/project/v3/zz_generated_inject_delay.go @@ -0,0 +1,14 @@ +package client + +const ( + InjectDelayType = "injectDelay" + InjectDelayFieldExponentialDelay = "exponentialDelay" + InjectDelayFieldFixedDelay = "fixedDelay" + InjectDelayFieldPercent = "percent" +) + +type InjectDelay struct { + ExponentialDelay string `json:"exponentialDelay,omitempty" yaml:"exponentialDelay,omitempty"` + FixedDelay string `json:"fixedDelay,omitempty" yaml:"fixedDelay,omitempty"` + Percent int64 `json:"percent,omitempty" yaml:"percent,omitempty"` +} diff --git a/client/project/v3/zz_generated_l4match_attributes.go b/client/project/v3/zz_generated_l4match_attributes.go new file mode 100644 index 00000000..5d6c2952 --- /dev/null +++ b/client/project/v3/zz_generated_l4match_attributes.go @@ -0,0 +1,16 @@ +package client + +const ( + L4MatchAttributesType = "l4MatchAttributes" + L4MatchAttributesFieldDestinationSubnets = "destinationSubnets" + L4MatchAttributesFieldGateways = "gateways" + L4MatchAttributesFieldPort = "port" + L4MatchAttributesFieldSourceLabels = "sourceLabels" +) + +type L4MatchAttributes struct { + DestinationSubnets []string `json:"destinationSubnets,omitempty" yaml:"destinationSubnets,omitempty"` + Gateways []string `json:"gateways,omitempty" yaml:"gateways,omitempty"` + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + SourceLabels map[string]string `json:"sourceLabels,omitempty" yaml:"sourceLabels,omitempty"` +} diff --git a/client/project/v3/zz_generated_load_balancer_settings.go b/client/project/v3/zz_generated_load_balancer_settings.go new file mode 100644 index 00000000..8bbb896f --- /dev/null +++ b/client/project/v3/zz_generated_load_balancer_settings.go @@ -0,0 +1,12 @@ +package client + +const ( + LoadBalancerSettingsType = "loadBalancerSettings" + LoadBalancerSettingsFieldConsistentHash = "consistentHash" + LoadBalancerSettingsFieldSimple = "simple" +) + +type LoadBalancerSettings struct { + ConsistentHash *ConsistentHashLB `json:"consistentHash,omitempty" yaml:"consistentHash,omitempty"` + Simple string `json:"simple,omitempty" yaml:"simple,omitempty"` +} diff --git a/client/project/v3/zz_generated_outlier_detection.go b/client/project/v3/zz_generated_outlier_detection.go new file mode 100644 index 00000000..856a22f5 --- /dev/null +++ b/client/project/v3/zz_generated_outlier_detection.go @@ -0,0 +1,16 @@ +package client + +const ( + OutlierDetectionType = "outlierDetection" + OutlierDetectionFieldBaseEjectionTime = "baseEjectionTime" + OutlierDetectionFieldConsecutiveErrors = "consecutiveErrors" + OutlierDetectionFieldInterval = "interval" + OutlierDetectionFieldMaxEjectionPercent = "maxEjectionPercent" +) + +type OutlierDetection struct { + BaseEjectionTime string `json:"baseEjectionTime,omitempty" yaml:"baseEjectionTime,omitempty"` + ConsecutiveErrors int64 `json:"consecutiveErrors,omitempty" yaml:"consecutiveErrors,omitempty"` + Interval string `json:"interval,omitempty" yaml:"interval,omitempty"` + MaxEjectionPercent int64 `json:"maxEjectionPercent,omitempty" yaml:"maxEjectionPercent,omitempty"` +} diff --git a/client/project/v3/zz_generated_port_selector.go b/client/project/v3/zz_generated_port_selector.go new file mode 100644 index 00000000..9b9614c7 --- /dev/null +++ b/client/project/v3/zz_generated_port_selector.go @@ -0,0 +1,12 @@ +package client + +const ( + PortSelectorType = "portSelector" + PortSelectorFieldName = "name" + PortSelectorFieldNumber = "number" +) + +type PortSelector struct { + Name string `json:"name,omitempty" yaml:"name,omitempty"` + Number int64 `json:"number,omitempty" yaml:"number,omitempty"` +} diff --git a/client/project/v3/zz_generated_port_traffic_policy.go b/client/project/v3/zz_generated_port_traffic_policy.go new file mode 100644 index 00000000..84ebc46c --- /dev/null +++ b/client/project/v3/zz_generated_port_traffic_policy.go @@ -0,0 +1,18 @@ +package client + +const ( + PortTrafficPolicyType = "portTrafficPolicy" + PortTrafficPolicyFieldConnectionPool = "connectionPool" + PortTrafficPolicyFieldLoadBalancer = "loadBalancer" + PortTrafficPolicyFieldOutlierDetection = "outlierDetection" + PortTrafficPolicyFieldPort = "port" + PortTrafficPolicyFieldTLS = "tls" +) + +type PortTrafficPolicy struct { + ConnectionPool *ConnectionPoolSettings `json:"connectionPool,omitempty" yaml:"connectionPool,omitempty"` + LoadBalancer *LoadBalancerSettings `json:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"` + OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty" yaml:"outlierDetection,omitempty"` + Port *PortSelector `json:"port,omitempty" yaml:"port,omitempty"` + TLS *TLSSettings `json:"tls,omitempty" yaml:"tls,omitempty"` +} diff --git a/client/project/v3/zz_generated_string_match.go b/client/project/v3/zz_generated_string_match.go new file mode 100644 index 00000000..3195aaf0 --- /dev/null +++ b/client/project/v3/zz_generated_string_match.go @@ -0,0 +1,16 @@ +package client + +const ( + StringMatchType = "stringMatch" + StringMatchFieldExact = "exact" + StringMatchFieldPrefix = "prefix" + StringMatchFieldRegex = "regex" + StringMatchFieldSuffix = "suffix" +) + +type StringMatch struct { + Exact string `json:"exact,omitempty" yaml:"exact,omitempty"` + Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"` + Regex string `json:"regex,omitempty" yaml:"regex,omitempty"` + Suffix string `json:"suffix,omitempty" yaml:"suffix,omitempty"` +} diff --git a/client/project/v3/zz_generated_subset.go b/client/project/v3/zz_generated_subset.go new file mode 100644 index 00000000..e4c98327 --- /dev/null +++ b/client/project/v3/zz_generated_subset.go @@ -0,0 +1,14 @@ +package client + +const ( + SubsetType = "subset" + SubsetFieldLabels = "labels" + SubsetFieldName = "name" + SubsetFieldTrafficPolicy = "trafficPolicy" +) + +type Subset struct { + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + TrafficPolicy *TrafficPolicy `json:"trafficPolicy,omitempty" yaml:"trafficPolicy,omitempty"` +} diff --git a/client/project/v3/zz_generated_tcp_route.go b/client/project/v3/zz_generated_tcp_route.go new file mode 100644 index 00000000..756c9360 --- /dev/null +++ b/client/project/v3/zz_generated_tcp_route.go @@ -0,0 +1,12 @@ +package client + +const ( + TCPRouteType = "tcpRoute" + TCPRouteFieldMatch = "match" + TCPRouteFieldRoute = "route" +) + +type TCPRoute struct { + Match []L4MatchAttributes `json:"match,omitempty" yaml:"match,omitempty"` + Route []HTTPRouteDestination `json:"route,omitempty" yaml:"route,omitempty"` +} diff --git a/client/project/v3/zz_generated_tcp_settings.go b/client/project/v3/zz_generated_tcp_settings.go new file mode 100644 index 00000000..6eebee8e --- /dev/null +++ b/client/project/v3/zz_generated_tcp_settings.go @@ -0,0 +1,12 @@ +package client + +const ( + TCPSettingsType = "tcpSettings" + TCPSettingsFieldConnectTimeout = "connectTimeout" + TCPSettingsFieldMaxConnections = "maxConnections" +) + +type TCPSettings struct { + ConnectTimeout string `json:"connectTimeout,omitempty" yaml:"connectTimeout,omitempty"` + MaxConnections int64 `json:"maxConnections,omitempty" yaml:"maxConnections,omitempty"` +} diff --git a/client/project/v3/zz_generated_tls_match_attributes.go b/client/project/v3/zz_generated_tls_match_attributes.go new file mode 100644 index 00000000..d858551a --- /dev/null +++ b/client/project/v3/zz_generated_tls_match_attributes.go @@ -0,0 +1,18 @@ +package client + +const ( + TLSMatchAttributesType = "tlsMatchAttributes" + TLSMatchAttributesFieldDestinationSubnets = "destinationSubnets" + TLSMatchAttributesFieldGateways = "gateways" + TLSMatchAttributesFieldPort = "port" + TLSMatchAttributesFieldSniHosts = "sniHosts" + TLSMatchAttributesFieldSourceLabels = "sourceLabels" +) + +type TLSMatchAttributes struct { + DestinationSubnets []string `json:"destinationSubnets,omitempty" yaml:"destinationSubnets,omitempty"` + Gateways []string `json:"gateways,omitempty" yaml:"gateways,omitempty"` + Port int64 `json:"port,omitempty" yaml:"port,omitempty"` + SniHosts []string `json:"sniHosts,omitempty" yaml:"sniHosts,omitempty"` + SourceLabels map[string]string `json:"sourceLabels,omitempty" yaml:"sourceLabels,omitempty"` +} diff --git a/client/project/v3/zz_generated_tls_route.go b/client/project/v3/zz_generated_tls_route.go new file mode 100644 index 00000000..9bf11e5f --- /dev/null +++ b/client/project/v3/zz_generated_tls_route.go @@ -0,0 +1,12 @@ +package client + +const ( + TLSRouteType = "tlsRoute" + TLSRouteFieldMatch = "match" + TLSRouteFieldRoute = "route" +) + +type TLSRoute struct { + Match []TLSMatchAttributes `json:"match,omitempty" yaml:"match,omitempty"` + Route []HTTPRouteDestination `json:"route,omitempty" yaml:"route,omitempty"` +} diff --git a/client/project/v3/zz_generated_tls_settings.go b/client/project/v3/zz_generated_tls_settings.go new file mode 100644 index 00000000..b887ec24 --- /dev/null +++ b/client/project/v3/zz_generated_tls_settings.go @@ -0,0 +1,20 @@ +package client + +const ( + TLSSettingsType = "tlsSettings" + TLSSettingsFieldCaCertificates = "caCertificates" + TLSSettingsFieldClientCertificate = "clientCertificate" + TLSSettingsFieldMode = "mode" + TLSSettingsFieldPrivateKey = "privateKey" + TLSSettingsFieldSni = "sni" + TLSSettingsFieldSubjectAltNames = "subjectAltNames" +) + +type TLSSettings struct { + CaCertificates string `json:"caCertificates,omitempty" yaml:"caCertificates,omitempty"` + ClientCertificate string `json:"clientCertificate,omitempty" yaml:"clientCertificate,omitempty"` + Mode string `json:"mode,omitempty" yaml:"mode,omitempty"` + PrivateKey string `json:"privateKey,omitempty" yaml:"privateKey,omitempty"` + Sni string `json:"sni,omitempty" yaml:"sni,omitempty"` + SubjectAltNames []string `json:"subjectAltNames,omitempty" yaml:"subjectAltNames,omitempty"` +} diff --git a/client/project/v3/zz_generated_traffic_policy.go b/client/project/v3/zz_generated_traffic_policy.go new file mode 100644 index 00000000..c9261ef5 --- /dev/null +++ b/client/project/v3/zz_generated_traffic_policy.go @@ -0,0 +1,18 @@ +package client + +const ( + TrafficPolicyType = "trafficPolicy" + TrafficPolicyFieldConnectionPool = "connectionPool" + TrafficPolicyFieldLoadBalancer = "loadBalancer" + TrafficPolicyFieldOutlierDetection = "outlierDetection" + TrafficPolicyFieldPortLevelSettings = "portLevelSettings" + TrafficPolicyFieldTLS = "tls" +) + +type TrafficPolicy struct { + ConnectionPool *ConnectionPoolSettings `json:"connectionPool,omitempty" yaml:"connectionPool,omitempty"` + LoadBalancer *LoadBalancerSettings `json:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"` + OutlierDetection *OutlierDetection `json:"outlierDetection,omitempty" yaml:"outlierDetection,omitempty"` + PortLevelSettings []PortTrafficPolicy `json:"portLevelSettings,omitempty" yaml:"portLevelSettings,omitempty"` + TLS *TLSSettings `json:"tls,omitempty" yaml:"tls,omitempty"` +} diff --git a/client/project/v3/zz_generated_virtual_service.go b/client/project/v3/zz_generated_virtual_service.go new file mode 100644 index 00000000..6a535bc9 --- /dev/null +++ b/client/project/v3/zz_generated_virtual_service.go @@ -0,0 +1,121 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + VirtualServiceType = "virtualService" + VirtualServiceFieldAnnotations = "annotations" + VirtualServiceFieldCreated = "created" + VirtualServiceFieldCreatorID = "creatorId" + VirtualServiceFieldGateways = "gateways" + VirtualServiceFieldHTTP = "http" + VirtualServiceFieldHosts = "hosts" + VirtualServiceFieldLabels = "labels" + VirtualServiceFieldName = "name" + VirtualServiceFieldNamespaceId = "namespaceId" + VirtualServiceFieldOwnerReferences = "ownerReferences" + VirtualServiceFieldProjectID = "projectId" + VirtualServiceFieldRemoved = "removed" + VirtualServiceFieldState = "state" + VirtualServiceFieldStatus = "status" + VirtualServiceFieldTCP = "tcp" + VirtualServiceFieldTLS = "tls" + VirtualServiceFieldTransitioning = "transitioning" + VirtualServiceFieldTransitioningMessage = "transitioningMessage" + VirtualServiceFieldUUID = "uuid" +) + +type VirtualService struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + Created string `json:"created,omitempty" yaml:"created,omitempty"` + CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"` + Gateways []string `json:"gateways,omitempty" yaml:"gateways,omitempty"` + HTTP []HTTPRoute `json:"http,omitempty" yaml:"http,omitempty"` + Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status interface{} `json:"status,omitempty" yaml:"status,omitempty"` + TCP []TCPRoute `json:"tcp,omitempty" yaml:"tcp,omitempty"` + TLS []TLSRoute `json:"tls,omitempty" yaml:"tls,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} + +type VirtualServiceCollection struct { + types.Collection + Data []VirtualService `json:"data,omitempty"` + client *VirtualServiceClient +} + +type VirtualServiceClient struct { + apiClient *Client +} + +type VirtualServiceOperations interface { + List(opts *types.ListOpts) (*VirtualServiceCollection, error) + Create(opts *VirtualService) (*VirtualService, error) + Update(existing *VirtualService, updates interface{}) (*VirtualService, error) + Replace(existing *VirtualService) (*VirtualService, error) + ByID(id string) (*VirtualService, error) + Delete(container *VirtualService) error +} + +func newVirtualServiceClient(apiClient *Client) *VirtualServiceClient { + return &VirtualServiceClient{ + apiClient: apiClient, + } +} + +func (c *VirtualServiceClient) Create(container *VirtualService) (*VirtualService, error) { + resp := &VirtualService{} + err := c.apiClient.Ops.DoCreate(VirtualServiceType, container, resp) + return resp, err +} + +func (c *VirtualServiceClient) Update(existing *VirtualService, updates interface{}) (*VirtualService, error) { + resp := &VirtualService{} + err := c.apiClient.Ops.DoUpdate(VirtualServiceType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *VirtualServiceClient) Replace(obj *VirtualService) (*VirtualService, error) { + resp := &VirtualService{} + err := c.apiClient.Ops.DoReplace(VirtualServiceType, &obj.Resource, obj, resp) + return resp, err +} + +func (c *VirtualServiceClient) List(opts *types.ListOpts) (*VirtualServiceCollection, error) { + resp := &VirtualServiceCollection{} + err := c.apiClient.Ops.DoList(VirtualServiceType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *VirtualServiceCollection) Next() (*VirtualServiceCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &VirtualServiceCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *VirtualServiceClient) ByID(id string) (*VirtualService, error) { + resp := &VirtualService{} + err := c.apiClient.Ops.DoByID(VirtualServiceType, id, resp) + return resp, err +} + +func (c *VirtualServiceClient) Delete(container *VirtualService) error { + return c.apiClient.Ops.DoResourceDelete(VirtualServiceType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_virtual_service_spec.go b/client/project/v3/zz_generated_virtual_service_spec.go new file mode 100644 index 00000000..24631b96 --- /dev/null +++ b/client/project/v3/zz_generated_virtual_service_spec.go @@ -0,0 +1,18 @@ +package client + +const ( + VirtualServiceSpecType = "virtualServiceSpec" + VirtualServiceSpecFieldGateways = "gateways" + VirtualServiceSpecFieldHTTP = "http" + VirtualServiceSpecFieldHosts = "hosts" + VirtualServiceSpecFieldTCP = "tcp" + VirtualServiceSpecFieldTLS = "tls" +) + +type VirtualServiceSpec struct { + Gateways []string `json:"gateways,omitempty" yaml:"gateways,omitempty"` + HTTP []HTTPRoute `json:"http,omitempty" yaml:"http,omitempty"` + Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"` + TCP []TCPRoute `json:"tcp,omitempty" yaml:"tcp,omitempty"` + TLS []TLSRoute `json:"tls,omitempty" yaml:"tls,omitempty"` +} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index fe8273fe..cfe1e3f9 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -115,4 +115,6 @@ type Config struct { PrometheusRules map[string]projectClient.PrometheusRule `json:"prometheusRules,omitempty" yaml:"prometheusRules,omitempty"` Alertmanagers map[string]projectClient.Alertmanager `json:"alertmanagers,omitempty" yaml:"alertmanagers,omitempty"` HorizontalPodAutoscalers map[string]projectClient.HorizontalPodAutoscaler `json:"horizontalPodAutoscalers,omitempty" yaml:"horizontalPodAutoscalers,omitempty"` + VirtualServices map[string]projectClient.VirtualService `json:"virtualServices,omitempty" yaml:"virtualServices,omitempty"` + DestinationRules map[string]projectClient.DestinationRule `json:"destinationRules,omitempty" yaml:"destinationRules,omitempty"` }