From 58e590f836879d1a07d37dc52d4f68df8f692149 Mon Sep 17 00:00:00 2001 From: renhongdi Date: Mon, 22 Apr 2024 20:40:40 +0800 Subject: [PATCH] feat: CRD has been GAed after 1.16, upgrade client-go --- .travis.yml | 5 +- charts/gravity-operator/templates/crd.yaml | 4 +- cmd/gatekeeper/main.go | 4 +- cmd/operator/main.go | 31 +- go.mod | 152 ++++++-- go.sum | 339 ++++++++++++------ .../versioned/scheme/doc.go => hack/tools.go | 11 +- hack/update-codegen.sh | 27 +- hack/verify-codegen.sh | 14 +- pkg/apis/cluster/v1alpha1/doc.go | 2 +- .../cluster/v1alpha1/zz_generated.deepcopy.go | 3 +- pkg/apis/pipeline/v1alpha1/doc.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 3 +- pkg/apiserver/api_server.go | 36 +- .../cluster/clientset/versioned/clientset.go | 98 ----- pkg/client/cluster/clientset/versioned/doc.go | 20 -- .../versioned/fake/clientset_generated.go | 82 ----- .../typed/cluster/v1alpha1/cluster_client.go | 90 ----- .../informers/externalversions/factory.go | 180 ---------- .../pipeline/clientset/versioned/clientset.go | 98 ----- .../pipeline/clientset/versioned/doc.go | 20 -- .../pipeline/clientset/versioned/fake/doc.go | 20 -- .../clientset/versioned/fake/register.go | 54 --- .../clientset/versioned/scheme/register.go | 54 --- .../pipeline/v1alpha1/pipeline_client.go | 90 ----- .../informers/externalversions/generic.go | 62 ---- .../internalinterfaces/factory_interfaces.go | 38 -- pkg/controller/cluster_controller.go | 26 +- pkg/controller/pipeline_manager.go | 39 +- pkg/gatekeeper/chaos.go | 5 +- pkg/gatekeeper/repository.go | 13 +- .../clientset/versioned/clientset.go | 133 +++++++ .../versioned/fake/clientset_generated.go | 32 +- .../clientset/versioned/fake/doc.go | 0 .../clientset/versioned/fake/register.go | 32 +- .../clientset/versioned/scheme/doc.go | 0 .../clientset/versioned/scheme/register.go | 32 +- .../typed/cluster/v1alpha1/cluster.go | 89 +++-- .../typed/cluster/v1alpha1/cluster_client.go | 107 ++++++ .../versioned/typed/cluster/v1alpha1/doc.go | 0 .../typed/cluster/v1alpha1/fake/doc.go | 0 .../cluster/v1alpha1/fake/fake_cluster.go | 33 +- .../v1alpha1/fake/fake_cluster_client.go | 8 +- .../cluster/v1alpha1/generated_expansion.go | 0 .../versioned/typed/pipeline/v1alpha1/doc.go | 0 .../typed/pipeline/v1alpha1/fake/doc.go | 0 .../pipeline/v1alpha1/fake/fake_pipeline.go | 33 +- .../v1alpha1/fake/fake_pipeline_client.go | 8 +- .../pipeline/v1alpha1/generated_expansion.go | 0 .../typed/pipeline/v1alpha1/pipeline.go | 89 +++-- .../pipeline/v1alpha1/pipeline_client.go | 107 ++++++ .../externalversions/cluster/interface.go | 6 +- .../cluster/v1alpha1/cluster.go | 11 +- .../cluster/v1alpha1/interface.go | 2 +- .../informers/externalversions/factory.go | 107 +++++- .../informers/externalversions/generic.go | 9 +- .../internalinterfaces/factory_interfaces.go | 4 +- .../externalversions/pipeline/interface.go | 6 +- .../pipeline/v1alpha1/interface.go | 2 +- .../pipeline/v1alpha1/pipeline.go | 11 +- .../listers/cluster/v1alpha1/cluster.go | 5 + .../cluster/v1alpha1/expansion_generated.go | 0 .../pipeline/v1alpha1/expansion_generated.go | 0 .../listers/pipeline/v1alpha1/pipeline.go | 5 + 64 files changed, 1174 insertions(+), 1319 deletions(-) rename pkg/client/pipeline/clientset/versioned/scheme/doc.go => hack/tools.go (70%) delete mode 100644 pkg/client/cluster/clientset/versioned/clientset.go delete mode 100644 pkg/client/cluster/clientset/versioned/doc.go delete mode 100644 pkg/client/cluster/clientset/versioned/fake/clientset_generated.go delete mode 100644 pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go delete mode 100644 pkg/client/cluster/informers/externalversions/factory.go delete mode 100644 pkg/client/pipeline/clientset/versioned/clientset.go delete mode 100644 pkg/client/pipeline/clientset/versioned/doc.go delete mode 100644 pkg/client/pipeline/clientset/versioned/fake/doc.go delete mode 100644 pkg/client/pipeline/clientset/versioned/fake/register.go delete mode 100644 pkg/client/pipeline/clientset/versioned/scheme/register.go delete mode 100644 pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go delete mode 100644 pkg/client/pipeline/informers/externalversions/generic.go delete mode 100644 pkg/client/pipeline/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 pkg/generated/clientset/versioned/clientset.go rename pkg/{client/pipeline => generated}/clientset/versioned/fake/clientset_generated.go (65%) rename pkg/{client/cluster => generated}/clientset/versioned/fake/doc.go (100%) rename pkg/{client/cluster => generated}/clientset/versioned/fake/register.go (63%) rename pkg/{client/cluster => generated}/clientset/versioned/scheme/doc.go (100%) rename pkg/{client/cluster => generated}/clientset/versioned/scheme/register.go (64%) rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/cluster.go (55%) create mode 100644 pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/doc.go (100%) rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go (100%) rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go (70%) rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go (77%) rename pkg/{client/cluster => generated}/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go (100%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/doc.go (100%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/fake/doc.go (100%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go (70%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go (75%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/generated_expansion.go (100%) rename pkg/{client/pipeline => generated}/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go (55%) create mode 100644 pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go rename pkg/{client/cluster => generated}/informers/externalversions/cluster/interface.go (85%) rename pkg/{client/cluster => generated}/informers/externalversions/cluster/v1alpha1/cluster.go (87%) rename pkg/{client/cluster => generated}/informers/externalversions/cluster/v1alpha1/interface.go (92%) rename pkg/{client/pipeline => generated}/informers/externalversions/factory.go (61%) rename pkg/{client/cluster => generated}/informers/externalversions/generic.go (81%) rename pkg/{client/cluster => generated}/informers/externalversions/internalinterfaces/factory_interfaces.go (82%) rename pkg/{client/pipeline => generated}/informers/externalversions/pipeline/interface.go (85%) rename pkg/{client/pipeline => generated}/informers/externalversions/pipeline/v1alpha1/interface.go (92%) rename pkg/{client/pipeline => generated}/informers/externalversions/pipeline/v1alpha1/pipeline.go (87%) rename pkg/{client/cluster => generated}/listers/cluster/v1alpha1/cluster.go (91%) rename pkg/{client/cluster => generated}/listers/cluster/v1alpha1/expansion_generated.go (100%) rename pkg/{client/pipeline => generated}/listers/pipeline/v1alpha1/expansion_generated.go (100%) rename pkg/{client/pipeline => generated}/listers/pipeline/v1alpha1/pipeline.go (91%) diff --git a/.travis.yml b/.travis.yml index f44f869..3dfd2b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ language: go go: - - "1.11.4" - -env: - - GO111MODULE=on + - "1.22.2" jobs: include: diff --git a/charts/gravity-operator/templates/crd.yaml b/charts/gravity-operator/templates/crd.yaml index 5f68312..851b7d7 100644 --- a/charts/gravity-operator/templates/crd.yaml +++ b/charts/gravity-operator/templates/crd.yaml @@ -1,4 +1,4 @@ -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: clusters.gravity.mobike.io @@ -33,7 +33,7 @@ spec: JSONPath: .status.unavailablePipelines --- -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: pipelines.gravity.mobike.io diff --git a/cmd/gatekeeper/main.go b/cmd/gatekeeper/main.go index 6fd32df..cbdfcda 100644 --- a/cmd/gatekeeper/main.go +++ b/cmd/gatekeeper/main.go @@ -12,8 +12,8 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" - clusterclient "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" "github.com/moiot/gravity-operator/pkg/gatekeeper" + clusterclient "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" "github.com/moiot/gravity-operator/pkg/signals" ) @@ -65,7 +65,7 @@ func main() { } defer targetDB.Close() - repo := gatekeeper.NewRepository(casePath, operatorAddr, sourceDB, targetDB, clusterClient.GravityV1alpha1().Clusters(namespace)) + repo := gatekeeper.NewRepository(casePath, operatorAddr, sourceDB, targetDB, clusterClient.ClusterV1alpha1().Clusters(namespace)) api := gatekeeper.NewApiServer(repo) api.Start() diff --git a/cmd/operator/main.go b/cmd/operator/main.go index 684cce0..704e411 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -12,11 +12,9 @@ import ( "k8s.io/client-go/tools/clientcmd" "github.com/moiot/gravity-operator/pkg/apiserver" - clusterclient "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" - clusterinformer "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions" - pipeclient "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - pipeinformer "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions" "github.com/moiot/gravity-operator/pkg/controller" + clientset "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + informer "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions" "github.com/moiot/gravity-operator/pkg/signals" ) @@ -46,33 +44,26 @@ func main() { log.Fatalf("Error building kubernetes clientset: %s", err.Error()) } - clusterClient, err := clusterclient.NewForConfig(cfg) + client, err := clientset.NewForConfig(cfg) if err != nil { - log.Fatalf("Error building cluster client: %s", err.Error()) + log.Fatalf("Error building client: %s", err.Error()) } - pipelineClient, err := pipeclient.NewForConfig(cfg) - if err != nil { - log.Fatalf("Error building pipeline client: %s", err.Error()) - } - - clusterInformerFactory := clusterinformer.NewSharedInformerFactoryWithOptions(clusterClient, time.Second*30, clusterinformer.WithNamespace(namespace)) - pipelinesInformerFactory := pipeinformer.NewSharedInformerFactoryWithOptions(pipelineClient, time.Second*30, pipeinformer.WithNamespace(namespace)) + informerFactory := informer.NewSharedInformerFactoryWithOptions(client, time.Second*30, informer.WithNamespace(namespace)) kubeInformerFactory := kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, time.Second*30, kubeinformers.WithNamespace(namespace)) clusterController := controller.NewClusterController( namespace, kubeInformerFactory, kubeClient, - clusterClient, - clusterInformerFactory.Gravity().V1alpha1().Clusters(), - pipelineClient, - pipelinesInformerFactory.Gravity().V1alpha1().Pipelines(), + client, + informerFactory.Cluster().V1alpha1().Clusters(), + client, + informerFactory.Pipeline().V1alpha1().Pipelines(), ) go kubeInformerFactory.Start(stopCh) - go clusterInformerFactory.Start(stopCh) - go pipelinesInformerFactory.Start(stopCh) + go informerFactory.Start(stopCh) log.Infof("running controllers") @@ -80,7 +71,7 @@ func main() { log.Fatalf("Error running clusterController: %v", err.Error()) } - apiServer := apiserver.NewApiServer(namespace, kubeClient, pipelineClient, clusterController, port) + apiServer := apiserver.NewApiServer(namespace, kubeClient, client, clusterController, port) apiServer.Start() <-stopCh diff --git a/go.mod b/go.mod index b9c4fa2..85f1762 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,146 @@ module github.com/moiot/gravity-operator +go 1.22.2 + +require ( + github.com/gin-gonic/gin v1.9.1 + github.com/go-sql-driver/mysql v1.4.1 + github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 + github.com/moiot/gravity v0.9.62 + github.com/prometheus/client_golang v1.19.0 + github.com/sirupsen/logrus v1.2.0 + gopkg.in/yaml.v2 v2.4.0 + k8s.io/api v0.30.0 + k8s.io/apimachinery v0.30.0 + k8s.io/client-go v0.30.0 +) + require ( + github.com/BurntSushi/toml v0.3.1 // indirect github.com/DataDog/zstd v1.3.5 // indirect + github.com/OneOfOne/xxhash v1.2.5 // indirect github.com/Shopify/sarama v1.20.1 // indirect - github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect - github.com/gin-gonic/gin v1.3.0 - github.com/go-sql-driver/mysql v1.4.1 + github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f // indirect + github.com/aws/aws-sdk-go v1.16.11 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/bytedance/sonic v1.11.5 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cloudwego/base64x v0.1.3 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/coreos/etcd v3.3.10+incompatible // indirect + github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/eapache/go-resiliency v1.1.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-ole/go-ole v1.2.2 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.19.0 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gofrs/uuid v3.2.0+incompatible // indirect - github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect - github.com/googleapis/gnostic v0.2.0 // indirect - github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.6.3 // indirect + github.com/hashicorp/go-cleanhttp v0.5.0 // indirect github.com/hashicorp/go-getter v0.0.0-20190112230949-c68364a1fae1 // indirect + github.com/hashicorp/go-hclog v0.7.0 // indirect github.com/hashicorp/go-plugin v1.0.0 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.0.0 // indirect + github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/jinzhu/gorm v1.9.2 // indirect github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect - github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/moiot/gravity v0.9.62 - github.com/peterbourgon/diskv v2.0.1+incompatible // indirect - github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 + github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/go-homedir v1.0.0 // indirect + github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/mitchellh/hashstructure v1.0.0 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oklog/run v1.0.0 // indirect + github.com/olivere/elastic v6.2.17+incompatible // indirect + github.com/pelletier/go-toml/v2 v2.2.1 // indirect + github.com/pierrec/lz4 v2.0.5+incompatible // indirect + github.com/pingcap/errors v0.11.0 // indirect + github.com/pingcap/parser v0.0.0-20190118120648-5958b6fcdb2d // indirect + github.com/pingcap/tidb v0.0.0-20190118125846-54b6de0880f0 // indirect + github.com/pingcap/tipb v0.0.0-20181126132056-a7fd2aaa9719 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a // indirect + github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 // indirect + github.com/satori/go.uuid v1.2.0 // indirect github.com/serialx/hashring v0.0.0-20180504054112-49a4782e9908 // indirect - github.com/sirupsen/logrus v1.2.0 - github.com/spf13/pflag v1.0.3 // indirect - github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2 // indirect - gopkg.in/go-playground/assert.v1 v1.2.1 // indirect - gopkg.in/go-playground/validator.v8 v8.18.2 // indirect + github.com/shirou/gopsutil v2.18.12+incompatible // indirect + github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect + github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 // indirect + github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 // indirect + github.com/siddontang/go-mysql v0.0.0-20190312052122-c6ab05a85eb8 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.9.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + github.com/ulikunitz/xz v0.5.5 // indirect + github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect + github.com/xdg/stringprep v1.0.0 // indirect + go.mongodb.org/mongo-driver v1.0.1 // indirect + golang.org/x/arch v0.7.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.20.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 // indirect + google.golang.org/grpc v1.19.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/yaml.v2 v2.2.2 - k8s.io/api v0.0.0-20181216230433-16e3e9a3868f - k8s.io/apimachinery v0.0.0-20181203235515-3d8ee2261517 - k8s.io/client-go v8.0.0+incompatible - k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be // indirect + gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/code-generator v0.30.0 // indirect + k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 // indirect + k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index e44a103..db4d79c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU= @@ -19,19 +18,29 @@ github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f/go.mod h1:3eOhrU github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.16.11 h1:g/c7gJeVyHoXCxM2fddS85bPGVkBF8s2q8t3fyElegc= github.com/aws/aws-sdk-go v1.16.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/blacktear23/go-proxyprotocol v0.0.0-20171102103907-62e368e1c470/go.mod h1:VKt7CNAQxpFpSDz3sXyj9hY/GbVsQCr0sB3w59nE7lU= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/bytedance/sonic v1.11.5 h1:G00FYjjqll5iQ1PYXynbg/hyzqBqavH8Mo9/oTopd9k= +github.com/bytedance/sonic v1.11.5/go.mod h1:X2PC2giUdj/Cv2lliWFLk6c/DUQok5rViJSemeB0wDw= +github.com/bytedance/sonic/loader v0.1.0/go.mod h1:UmRT+IRTGKz/DAkzcEGzyVqQFJ7H9BqwBO3pm9H/+HY= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v2.0.6+incompatible/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudwego/base64x v0.1.3 h1:b5J/l8xolB7dyDTTmhJP2oTs5LdrjyrUFuNxdfq5hAg= +github.com/cloudwego/base64x v0.1.3/go.mod h1:1+1K5BUHIQzyapgpF7LwvOGAEDicKtt1umPV+aN8pi8= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.0 h1:HIgH5xUWXT914HCI671AxuTTqjj64UOFr7pHn48LUTI= @@ -44,7 +53,7 @@ github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142 h1:3jFq2xL4ZajGK github.com/coreos/go-systemd v0.0.0-20181031085051-9002847aa142/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cznic/mathutil v0.0.0-20181021201202-eba54fb065b7 h1:y+DH9ARrWiiNBV+6waYP2IPcsRbxdU1qsnycPfShF4c= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cznic/mathutil v0.0.0-20181021201202-eba54fb065b7/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= @@ -57,7 +66,6 @@ github.com/denisenkom/go-mssqldb v0.0.0-20190412130859-3b1d194e553a h1:yJ2kD1BvM github.com/denisenkom/go-mssqldb v0.0.0-20190412130859-3b1d194e553a/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -65,73 +73,112 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a h1:QNEenQIsGDEEfFNSnN+h6hE1OwnHqTg7Dl9gEk1Cko4= github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 h1:AzN37oI0cOS+cougNAV9szl6CVoj2RYwzS3DpUQNtlY= -github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-gonic/gin v1.3.0 h1:kCmZyPklC0gVdL728E6Aj20uYBJV93nj/TkwBTKhFbs= -github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.2 h1:QNWhweRd9D5Py2rRVboZ2L4SEoW/dyraWJCc8bgS8kE= github.com/go-ole/go-ole v1.2.2/go.mod h1:pnvuG7BrDMZ8ifMurTQmxwhQM/odqm9sSqNe5BUI7v4= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn0+wvQ3bZ8b/AU4= +github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v0.0.0-20180717141946-636bf0302bc9/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff h1:kOkM9whyQYodu09SJ6W3NCsHG7crFaJILQ22Gozp3lg= github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v0.0.0-20180814211427-aa810b61a9c7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f h1:ShTPMJQes6tubcjzGMODIVG5hlrCeImaBnZzKF2N8SM= -github.com/gregjones/httpcache v0.0.0-20181110185634-c63ab54fda8f/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= @@ -144,7 +191,6 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-getter v0.0.0-20181213035916-be39683deade/go.mod h1:BjYbO/QwTRCU20p2qOfbWtU2TTSuTqPNx1RnlndKOxE= github.com/hashicorp/go-getter v0.0.0-20190112230949-c68364a1fae1 h1:3++H6bZb2fb6zChGJXLDK3ltEFRG479GhHbgkqYc0Oc= github.com/hashicorp/go-getter v0.0.0-20190112230949-c68364a1fae1/go.mod h1:eLvWiwRFYGj6M4qeM/PP6Fd0ANDRRxv+xrAiBROanoQ= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd h1:rNuUHR+CvK1IS89MMtcF0EpcVMZtjKfPRp4MEmt/aTs= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.7.0 h1:TwD6x3r9IdHnoVSBmfvEgKKLRu08augeYi8fwWcbmiE= github.com/hashicorp/go-hclog v0.7.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= @@ -155,9 +201,7 @@ github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhE github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8= github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -173,14 +217,16 @@ github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a h1:eeaG9XMUvRBYX github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.0.0 h1:6WV8LvwPpDhKjo5U9O6b4+xdG/jTXNPwlDme/MTo8Ns= github.com/jinzhu/now v1.0.0/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/juju/errors v0.0.0-20170703010042-c7d06af17c68/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok= @@ -190,27 +236,39 @@ github.com/juju/loggo v0.0.0-20190212223446-d976af380377/go.mod h1:vgyd7OREkbtVE github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073 h1:WQM1NildKThwdP7qWrNAFGzp4ijNLw8RlgENkaI4MJs= github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg= github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -221,17 +279,18 @@ github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9 github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moiot/gravity v0.9.62 h1:6wmGG7u65y7qFZNb+Yw05DeUMoqd60w2kFTyamy+Vis= github.com/moiot/gravity v0.9.62/go.mod h1:8OXej7R9yYyiV0tqPmfX9fNJELRH/2d+eGo808uDnlQ= -github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808 h1:pmpDGKLw4n82EtrNiLqB+xSz/JQwFOaZuMALYUHwX5s= github.com/montanaflynn/stats v0.0.0-20180911141734-db72e6cae808/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI= github.com/myesui/uuid v1.0.0/go.mod h1:2CDfNgU0LR8mIdO8vdWd8i9gWWxLlcoIGGpSNgafq84= github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 h1:7KAv7KMGTTqSmYZtNdcNTgsos+vFzULLwyElndwn+5c= github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7/go.mod h1:iWMfgwqYW+e8n5lC/jjNEhwcjbRDpl5NT7n2h+4UNcI= @@ -244,22 +303,24 @@ github.com/olivere/elastic v6.2.17+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGe github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= +github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= +github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8 h1:USx2/E1bX46VG32FIw034Au6seQ2fY9NEILmNh/UlQg= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ= github.com/pingcap/errors v0.11.0 h1:DCJQB8jrHbQ1VVlMFIrbj2ApScNNotVmkSNplu2yUt4= github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3 h1:04yuCf5NMvLU8rB2m4Qs3rynH7EYpMno3lHkewIOdMo= github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3/go.mod h1:DazNTg0PTldtpsQiT9I5tVJwV1onHMKBBgXzmJUlMns= github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e h1:P73/4dPCL96rGrobssy1nVy2VaVpNCuLpCbr+FEaTA8= github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw= @@ -277,36 +338,40 @@ github.com/pingcap/tidb-tools v2.1.3-0.20190104033906-883b07a04a73+incompatible/ github.com/pingcap/tipb v0.0.0-20181012112600-11e33c750323/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI= github.com/pingcap/tipb v0.0.0-20181126132056-a7fd2aaa9719 h1:MEHhwNcWuuoJJvYxMaWIXFp+BvK/WORPiiwmSOS0cA4= github.com/pingcap/tipb v0.0.0-20181126132056-a7fd2aaa9719/go.mod h1:RtkHW8WbcNxj8lsbzjaILci01CtYnYbIkQhjyZWrWVI= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.0.0-20181020173914-7e9e6cabbd39/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 h1:/NRJ5vAYoqz+7sG51ubIDHXeWO8DlTSrToPu6q11ziA= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/serialx/hashring v0.0.0-20170811022404-6a9381c5a83e/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/serialx/hashring v0.0.0-20180504054112-49a4782e9908 h1:RRpyb4kheanCQVyYfOhkZoD/cwClvn12RzHex2ZmHxw= github.com/serialx/hashring v0.0.0-20180504054112-49a4782e9908/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= -github.com/shirou/gopsutil v2.18.10+incompatible h1:cy84jW6EVRPa5g9HAHrlbxMSIjBhDSX0OFYyMYminYs= github.com/shirou/gopsutil v2.18.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= @@ -326,14 +391,22 @@ github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/struCoder/pidusage v0.1.2/go.mod h1:pWBlW3YuSwRl6h7R5KbvA4N8oOqe9LjaKW5CwT1SPjI= github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfKggNGDuadAa0LElHrByyrz4JPZ9fFx6Gs7nx7ZZU= github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65 h1:rQ229MBgvW68s1/g6f1/63TgYwYxfF4E+bi/KC19P8g= @@ -342,18 +415,18 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 h1:lYIiVD github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/twinj/uuid v1.0.0 h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk= github.com/twinj/uuid v1.0.0/go.mod h1:mMgcE1RHFUFqe5AfiwlINXisXfDGro23fWdPUfOMjRY= -github.com/uber-go/atomic v1.3.2 h1:Azu9lPBWRNKzYXSIwRfgRuDuS0YKsK4NFhiQv98gkxo= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/uber/jaeger-client-go v2.15.0+incompatible h1:NP3qsSqNxh8VYr956ur1N/1C1PjvOJnJykCzcD5QHbk= github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v1.5.0 h1:OHbgr8l656Ub3Fw5k9SWnBfIEwvoHQ+W2y+Aa9D1Uyo= github.com/uber/jaeger-lib v1.5.0/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go/codec v0.0.0-20181127175209-856da096dbdf/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2 h1:EICbibRW4JNKMcY+LsWmuwob+CRS1BmdRdjphAm9mH4= -github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/unrolled/render v0.0.0-20180914162206-b9786414de4d h1:ggUgChAeyge4NZ4QUw6lhHsVymzwSDJOZcE0s2X8S20= github.com/unrolled/render v0.0.0-20180914162206-b9786414de4d/go.mod h1:tu82oB5W2ykJRVioYsB+IQKcft7ryBr7w12qMBUPyXg= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= @@ -361,6 +434,8 @@ github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 h1:MPPkRncZLN9Kh4MEFmbnK4h3BD7AUmskWv2+EeZJCCs= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.mongodb.org/mongo-driver v1.0.1 h1:r2xNB8juGGrZVcIjX2TpY7HUfz+pNYq+GIuC9h6URZg= go.mongodb.org/mongo-driver v1.0.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -370,71 +445,109 @@ go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= +golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06 h1:0oC8rFnE+74kEmuHZ46F6KHsMr5Gx2gUQPuNz28iQZM= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190109145017-48ac38b7c8cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc h1:WiYx1rIFmx8c0mXAFtv5D/mHyKe1+jmuP7PViuwqwuQ= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52 h1:JG/0uqcGdTNgq7FdU+61l5Pdmb8putNZlXb65bJBROs= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f h1:FU37niK8AQ59mHcskRyQL7H0ErSeNh650vdcj8HqdSI= google.golang.org/genproto v0.0.0-20181004005441-af9cb2a35e7f/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275 h1:9oFlwfEGIvmxXTcY53ygNyxIQtWciRHjrnUvZJCYXYU= google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo= @@ -442,26 +555,24 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 h1:FVCohIoYO7IJoDDVpV2pdq7SgrMH6wHnuTyrdrxJNoY= gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= gopkg.in/VividCortex/ewma.v1 v1.1.1/go.mod h1:TekXuFipeiHWiAlO1+wSS23vTcyFau5u3rxXUSXj710= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v2 v2.0.6/go.mod h1:0CiZ1p8pvtxBlQpLXkHuUTpdJ1shm3OqCF1QugkjHL4= gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ= -gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/mattn/go-colorable.v0 v0.0.9/go.mod h1:BVJlBXzARQxdi3nZo6f6bnl5yR20/tOL6p+V0KejgSY= @@ -471,24 +582,52 @@ gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M= gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.0.0-20181216230433-16e3e9a3868f h1:132Mkru/EpzKBLLIvL1bWbLa8zIW2LMvN7Fzyt5b24c= -k8s.io/api v0.0.0-20181216230433-16e3e9a3868f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/apimachinery v0.0.0-20181203235515-3d8ee2261517 h1:p6GEgV1/cc7H0AT6XfjHwHNIypirOprIB09oKp2DQ/M= -k8s.io/apimachinery v0.0.0-20181203235515-3d8ee2261517/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/client-go v8.0.0+incompatible h1:tTI4hRmb1DRMl4fG6Vclfdi6nTM82oIrTT7HfitmxC4= -k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be h1:aWEq4nbj7HRJ0mtKYjNSk/7X28Tl6TI6FeG8gKF+r7Q= -k8s.io/kube-openapi v0.0.0-20181114233023-0317810137be/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= +k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= +k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= +k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ= +k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY= +k8s.io/code-generator v0.0.0-20180904193909-8c97d6ab64da h1:L6YB6ObZIbZlYikTQcCjzZGilwS3OVyQBA2esULs8VM= +k8s.io/code-generator v0.0.0-20180904193909-8c97d6ab64da/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8= +k8s.io/code-generator v0.30.0 h1:3VUVqHvWFSVSm9kqL/G6kD4ZwNdHF6J/jPyo3Jgjy3k= +k8s.io/code-generator v0.30.0/go.mod h1:mBMZhfRR4IunJUh2+7LVmdcWwpouCH5+LNPkZ3t/v7Q= +k8s.io/gengo v0.0.0-20240404160639-a0386bf69313 h1:wBIDZID8ju9pwOiLlV22YYKjFGtiNSWgHf5CnKLRUuM= +k8s.io/gengo v0.0.0-20240404160639-a0386bf69313/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313 h1:bKcdZJOPICVmIIuaM9+MXmapE94dn5AYv5ODs1jA43o= +k8s.io/gengo/v2 v2.0.0-20240404160639-a0386bf69313/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 h1:Q8Z7VlGhcJgBHJHYugJ/K/7iB8a2eSxCyxdVjJp+lLY= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20180531100431-4c381bd170b4 h1:VO9oZbbkvTwqLimlQt15QNdOOBArT2dw/bvzsMZBiqQ= sourcegraph.com/sourcegraph/appdash v0.0.0-20180531100431-4c381bd170b4/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/pkg/client/pipeline/clientset/versioned/scheme/doc.go b/hack/tools.go similarity index 70% rename from pkg/client/pipeline/clientset/versioned/scheme/doc.go rename to hack/tools.go index 7dc3756..73ab6ef 100644 --- a/pkg/client/pipeline/clientset/versioned/scheme/doc.go +++ b/hack/tools.go @@ -1,5 +1,8 @@ +//go:build tools +// +build tools + /* -Copyright The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +17,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by client-gen. DO NOT EDIT. +// This package imports things required by build scripts, to force `go mod` to see them as dependencies +package tools -// This package contains the scheme of the automatically generated clientset. -package scheme +import _ "k8s.io/code-generator" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index c0a43b4..85359c7 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -18,17 +18,20 @@ set -o errexit set -o nounset set -o pipefail -# SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. -# CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} -# echo $CODEGEN_PKG +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} -hack/generate-groups.sh "all" \ - github.com/moiot/gravity-operator/pkg/client/pipeline \ - github.com/moiot/gravity-operator/pkg/apis \ - pipeline:v1alpha1 && hack/generate-groups.sh "all" \ - github.com/moiot/gravity-operator/pkg/client/cluster \ - github.com/moiot/gravity-operator/pkg/apis \ - cluster:v1alpha1 +source "${CODEGEN_PKG}/kube_codegen.sh" -# To use your own boilerplate text use: -# --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt +THIS_PKG="github.com/moiot/gravity-operator" + +kube::codegen::gen_helpers \ + --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ + "${SCRIPT_ROOT}/pkg/apis" + +kube::codegen::gen_client \ + --with-watch \ + --output-dir "${SCRIPT_ROOT}/pkg/generated" \ + --output-pkg "${THIS_PKG}/pkg/generated" \ + --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ + "${SCRIPT_ROOT}/pkg/apis" \ No newline at end of file diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index d02a6fa..32b2111 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -18,14 +18,12 @@ set -o errexit set -o nounset set -o pipefail -SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. - +SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" DIFFROOT="${SCRIPT_ROOT}/pkg" -TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" -_tmp="${SCRIPT_ROOT}/_tmp" +TMP_DIFFROOT="$(mktemp -d -t "$(basename "$0").XXXXXX")/pkg" cleanup() { - rm -rf "${_tmp}" + rm -rf "${TMP_DIFFROOT}" } trap "cleanup" EXIT SIGINT @@ -38,11 +36,9 @@ cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" echo "diffing ${DIFFROOT} against freshly generated codegen" ret=0 diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" -if [[ $ret -eq 0 ]] -then +if [[ $ret -eq 0 ]]; then echo "${DIFFROOT} up to date." else echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" exit 1 -fi +fi \ No newline at end of file diff --git a/pkg/apis/cluster/v1alpha1/doc.go b/pkg/apis/cluster/v1alpha1/doc.go index 9fe2960..064187a 100644 --- a/pkg/apis/cluster/v1alpha1/doc.go +++ b/pkg/apis/cluster/v1alpha1/doc.go @@ -1,5 +1,5 @@ // +k8s:deepcopy-gen=package // Package v1alpha1 is the v1alpha1 version of the API. -// +groupName=gravity.mobike.io +// +groupName=cluster.gravity.mobike.io package v1alpha1 diff --git a/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go index 377a0ee..cc7051a 100644 --- a/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* @@ -75,7 +76,7 @@ func (in *ClusterCondition) DeepCopy() *ClusterCondition { func (in *ClusterList) DeepCopyInto(out *ClusterList) { *out = *in out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]Cluster, len(*in)) diff --git a/pkg/apis/pipeline/v1alpha1/doc.go b/pkg/apis/pipeline/v1alpha1/doc.go index 9fe2960..c10d826 100644 --- a/pkg/apis/pipeline/v1alpha1/doc.go +++ b/pkg/apis/pipeline/v1alpha1/doc.go @@ -1,5 +1,5 @@ // +k8s:deepcopy-gen=package // Package v1alpha1 is the v1alpha1 version of the API. -// +groupName=gravity.mobike.io +// +groupName=pipeline.gravity.mobike.io package v1alpha1 diff --git a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go index dbfb3ed..46ce18f 100644 --- a/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* @@ -74,7 +75,7 @@ func (in *PipelineCondition) DeepCopy() *PipelineCondition { func (in *PipelineList) DeepCopyInto(out *PipelineList) { *out = *in out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]Pipeline, len(*in)) diff --git a/pkg/apiserver/api_server.go b/pkg/apiserver/api_server.go index cc97dbe..d1417d7 100644 --- a/pkg/apiserver/api_server.go +++ b/pkg/apiserver/api_server.go @@ -21,8 +21,8 @@ import ( clusterapi "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" pipeapi "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - client "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" "github.com/moiot/gravity-operator/pkg/controller" + client "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" "github.com/moiot/gravity-operator/pkg/utils" "github.com/moiot/gravity/pkg/app" "github.com/moiot/gravity/pkg/config" @@ -167,7 +167,7 @@ func (s *ApiServer) createPipe(c *gin.Context) { pipeline.Spec.Image = rule.Image pipeline.Spec.Command = rule.Command - pipeline, err := s.pipeclientset.GravityV1alpha1().Pipelines(s.namespace).Create(pipeline) + pipeline, err := s.pipeclientset.PipelineV1alpha1().Pipelines(s.namespace).Create(context.Background(), pipeline, metav1.CreateOptions{}) if err != nil { if apierrors.IsAlreadyExists(err) { log.Errorf("[ApiServer.createPipe] error duplicate name %s. err: %s", request.Name, err) @@ -179,10 +179,10 @@ func (s *ApiServer) createPipe(c *gin.Context) { return } - config := request.newConfigMap(pipeline) - _, err = s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Create(config) + cm := request.newConfigMap(pipeline) + _, err = s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Create(context.Background(), cm, metav1.CreateOptions{}) if err != nil { - _ = s.pipeclientset.GravityV1alpha1().Pipelines(pipeline.Namespace).Delete(pipeline.Name, utils.ForegroundDeleteOptions) + _ = s.pipeclientset.PipelineV1alpha1().Pipelines(pipeline.Namespace).Delete(context.Background(), pipeline.Name, *utils.ForegroundDeleteOptions) log.Errorf("[ApiServer.createPipe] error create config. %v", err) c.JSON(http.StatusInternalServerError, gin.H{"error": err}) return @@ -232,7 +232,7 @@ func (s *ApiServer) updatePipe(c *gin.Context) { newPipeline := request.toK8() newPipeline.ResourceVersion = pipeline.ResourceVersion - newPipeline, err = s.pipeclientset.GravityV1alpha1().Pipelines(s.namespace).Update(newPipeline) + newPipeline, err = s.pipeclientset.PipelineV1alpha1().Pipelines(s.namespace).Update(context.Background(), newPipeline, metav1.UpdateOptions{}) if err != nil { if apierrors.IsConflict(err) { log.Errorf("[ApiServer.updatePipe] pipeline %s has been updated. err: %s", request.Name, err) @@ -246,7 +246,7 @@ func (s *ApiServer) updatePipe(c *gin.Context) { if pipeline.Spec.ConfigHash != newPipeline.Spec.ConfigHash { configMap := request.newConfigMap(newPipeline) - _, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Update(configMap) + _, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Update(context.Background(), configMap, metav1.UpdateOptions{}) if err != nil { log.Errorf("[ApiServer.updatePipe] error update config. %v", err) c.JSON(http.StatusInternalServerError, gin.H{"error": err}) @@ -297,7 +297,7 @@ func (s *ApiServer) updatePauseSpecWithRetry(name string, expected bool) error { } } pipeline.Spec.Paused = expected - _, err = s.pipeclientset.GravityV1alpha1().Pipelines(s.namespace).Update(pipeline) + _, err = s.pipeclientset.PipelineV1alpha1().Pipelines(s.namespace).Update(context.Background(), pipeline, metav1.UpdateOptions{}) return err }, 6, 1) return err @@ -320,7 +320,7 @@ func (s *ApiServer) getPipe(c *gin.Context) { ret := &ApiPipeline{} ret.fromK8(pipeline) - configMaps, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Get(name, metav1.GetOptions{}) + configMaps, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { log.Errorf("[ApiServer.getPipe] error get config maps. %v", err) c.JSON(http.StatusInternalServerError, gin.H{"error": err}) @@ -372,7 +372,7 @@ func (s *ApiServer) listPipe(c *gin.Context) { func (s *ApiServer) deletePipe(c *gin.Context) { name := c.Param("name") - configMaps, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Get(name, metav1.GetOptions{}) + configMaps, err := s.kubeclientset.CoreV1().ConfigMaps(s.namespace).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { log.Errorf("[ApiServer.deletePipe] error get config for %s. %v", name, err) c.JSON(http.StatusInternalServerError, gin.H{"error": err}) @@ -398,7 +398,7 @@ func (s *ApiServer) deletePipe(c *gin.Context) { return } - err = s.pipeclientset.GravityV1alpha1().Pipelines(s.namespace).Delete(name, utils.ForegroundDeleteOptions) + err = s.pipeclientset.PipelineV1alpha1().Pipelines(s.namespace).Delete(context.Background(), name, *utils.ForegroundDeleteOptions) if err != nil { log.Errorf("[ApiServer.deletePipe] %v", err) c.JSON(http.StatusInternalServerError, gin.H{"error": err}) @@ -428,7 +428,7 @@ func (s *ApiServer) createCronJob(c *gin.Context) { } jobSpec := request.tok8(OperatorURI(), pipeline, request.Action) - if _, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Create(jobSpec); err != nil { + if _, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Create(context.Background(), jobSpec, metav1.CreateOptions{}); err != nil { log.Errorf("[ApiServer.createConJob] failed to create cronjob: %v", err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) return @@ -439,7 +439,7 @@ func (s *ApiServer) createCronJob(c *gin.Context) { func (s *ApiServer) listCronJob(c *gin.Context) { selector := labels.SelectorFromSet(map[string]string{"app.kubernetes.io/name": "gravity-cronjob"}) - jobList, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).List(metav1.ListOptions{LabelSelector: selector.String()}) + jobList, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).List(context.Background(), metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { log.Errorf("[ApiServer.listCronJob] failed to list cronjob: %v", err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) @@ -464,7 +464,7 @@ func (s *ApiServer) listPipelineCronJob(c *gin.Context) { selector := labels.SelectorFromSet(map[string]string{"app.kubernetes.io/name": "gravity-cronjob", "pipeline": pipelineName}) - jobList, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).List(metav1.ListOptions{LabelSelector: selector.String()}) + jobList, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).List(context.Background(), metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { log.Errorf("[ApiServer.listCronJob] failed to list cronjob: %v", err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) @@ -487,7 +487,7 @@ func (s *ApiServer) listPipelineCronJob(c *gin.Context) { func (s *ApiServer) getCronJob(c *gin.Context) { jobName := c.Param("name") - job, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Get(jobName, metav1.GetOptions{}) + job, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Get(context.Background(), jobName, metav1.GetOptions{}) if err != nil { log.Errorf("[ApiServer.getCronJob] failed to get cronjob name: %v, err: %v", jobName, err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) @@ -519,7 +519,7 @@ func (s *ApiServer) updateCronJob(c *gin.Context) { } jobName := c.Param("name") - job, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Get(jobName, metav1.GetOptions{}) + job, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Get(context.Background(), jobName, metav1.GetOptions{}) if err != nil { log.Errorf("[ApiServer.getCronJob] failed to get cronjob name: %v, err: %v", jobName, err) c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) @@ -531,7 +531,7 @@ func (s *ApiServer) updateCronJob(c *gin.Context) { job.Annotations["action"] = request.Action job.Annotations["schedule"] = request.Schedule - if _, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Update(job); err != nil { + if _, err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Update(context.Background(), job, metav1.UpdateOptions{}); err != nil { log.Errorf("[ApiServer.updateCronJob] failed name: %v, err: %v", jobName, err) c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return @@ -543,7 +543,7 @@ func (s *ApiServer) updateCronJob(c *gin.Context) { func (s *ApiServer) deleteCronJob(c *gin.Context) { jobName := c.Param("name") - err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Delete(jobName, utils.ForegroundDeleteOptions) + err := s.kubeclientset.BatchV1beta1().CronJobs(s.namespace).Delete(context.Background(), jobName, *utils.ForegroundDeleteOptions) if err != nil { log.Errorf("[ApiServer.deleteCronJob] failed to delete cronjob name: %v, err: %v", jobName, err) c.JSON(http.StatusBadRequest, gin.H{"error": err}) diff --git a/pkg/client/cluster/clientset/versioned/clientset.go b/pkg/client/cluster/clientset/versioned/clientset.go deleted file mode 100644 index 232fec8..0000000 --- a/pkg/client/cluster/clientset/versioned/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package versioned - -import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface - // Deprecated: please explicitly pick a version if possible. - Gravity() gravityv1alpha1.GravityV1alpha1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - gravityV1alpha1 *gravityv1alpha1.GravityV1alpha1Client -} - -// GravityV1alpha1 retrieves the GravityV1alpha1Client -func (c *Clientset) GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface { - return c.gravityV1alpha1 -} - -// Deprecated: Gravity retrieves the default version of GravityClient. -// Please explicitly pick a version. -func (c *Clientset) Gravity() gravityv1alpha1.GravityV1alpha1Interface { - return c.gravityV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.gravityV1alpha1, err = gravityv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.gravityV1alpha1 = gravityv1alpha1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.gravityV1alpha1 = gravityv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/client/cluster/clientset/versioned/doc.go b/pkg/client/cluster/clientset/versioned/doc.go deleted file mode 100644 index 41721ca..0000000 --- a/pkg/client/cluster/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/pkg/client/cluster/clientset/versioned/fake/clientset_generated.go b/pkg/client/cluster/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index acde37b..0000000 --- a/pkg/client/cluster/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1" - fakegravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// GravityV1alpha1 retrieves the GravityV1alpha1Client -func (c *Clientset) GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface { - return &fakegravityv1alpha1.FakeGravityV1alpha1{Fake: &c.Fake} -} - -// Gravity retrieves the GravityV1alpha1Client -func (c *Clientset) Gravity() gravityv1alpha1.GravityV1alpha1Interface { - return &fakegravityv1alpha1.FakeGravityV1alpha1{Fake: &c.Fake} -} diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go b/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go deleted file mode 100644 index 7fd4979..0000000 --- a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" - "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type GravityV1alpha1Interface interface { - RESTClient() rest.Interface - ClustersGetter -} - -// GravityV1alpha1Client is used to interact with features provided by the gravity.mobike.io group. -type GravityV1alpha1Client struct { - restClient rest.Interface -} - -func (c *GravityV1alpha1Client) Clusters(namespace string) ClusterInterface { - return newClusters(c, namespace) -} - -// NewForConfig creates a new GravityV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*GravityV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &GravityV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new GravityV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *GravityV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new GravityV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *GravityV1alpha1Client { - return &GravityV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *GravityV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/cluster/informers/externalversions/factory.go b/pkg/client/cluster/informers/externalversions/factory.go deleted file mode 100644 index d96232c..0000000 --- a/pkg/client/cluster/informers/externalversions/factory.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Copyright The Kubernetes 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 informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - versioned "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" - cluster "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/cluster" - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/internalinterfaces" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - Gravity() cluster.Interface -} - -func (f *sharedInformerFactory) Gravity() cluster.Interface { - return cluster.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/client/pipeline/clientset/versioned/clientset.go b/pkg/client/pipeline/clientset/versioned/clientset.go deleted file mode 100644 index a7dab40..0000000 --- a/pkg/client/pipeline/clientset/versioned/clientset.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package versioned - -import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface - // Deprecated: please explicitly pick a version if possible. - Gravity() gravityv1alpha1.GravityV1alpha1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - gravityV1alpha1 *gravityv1alpha1.GravityV1alpha1Client -} - -// GravityV1alpha1 retrieves the GravityV1alpha1Client -func (c *Clientset) GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface { - return c.gravityV1alpha1 -} - -// Deprecated: Gravity retrieves the default version of GravityClient. -// Please explicitly pick a version. -func (c *Clientset) Gravity() gravityv1alpha1.GravityV1alpha1Interface { - return c.gravityV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.gravityV1alpha1, err = gravityv1alpha1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.gravityV1alpha1 = gravityv1alpha1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.gravityV1alpha1 = gravityv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/client/pipeline/clientset/versioned/doc.go b/pkg/client/pipeline/clientset/versioned/doc.go deleted file mode 100644 index 41721ca..0000000 --- a/pkg/client/pipeline/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/pkg/client/pipeline/clientset/versioned/fake/doc.go b/pkg/client/pipeline/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e71..0000000 --- a/pkg/client/pipeline/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/client/pipeline/clientset/versioned/fake/register.go b/pkg/client/pipeline/clientset/versioned/fake/register.go deleted file mode 100644 index 05a95a2..0000000 --- a/pkg/client/pipeline/clientset/versioned/fake/register.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package fake - -import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - gravityv1alpha1.AddToScheme(scheme) -} diff --git a/pkg/client/pipeline/clientset/versioned/scheme/register.go b/pkg/client/pipeline/clientset/versioned/scheme/register.go deleted file mode 100644 index b3f0510..0000000 --- a/pkg/client/pipeline/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package scheme - -import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - gravityv1alpha1.AddToScheme(scheme) -} diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go b/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go deleted file mode 100644 index d733b28..0000000 --- a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes 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 client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type GravityV1alpha1Interface interface { - RESTClient() rest.Interface - PipelinesGetter -} - -// GravityV1alpha1Client is used to interact with features provided by the gravity.mobike.io group. -type GravityV1alpha1Client struct { - restClient rest.Interface -} - -func (c *GravityV1alpha1Client) Pipelines(namespace string) PipelineInterface { - return newPipelines(c, namespace) -} - -// NewForConfig creates a new GravityV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*GravityV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &GravityV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new GravityV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *GravityV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new GravityV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *GravityV1alpha1Client { - return &GravityV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *GravityV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/pipeline/informers/externalversions/generic.go b/pkg/client/pipeline/informers/externalversions/generic.go deleted file mode 100644 index 900f689..0000000 --- a/pkg/client/pipeline/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright The Kubernetes 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 informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=gravity.mobike.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("pipelines"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gravity().V1alpha1().Pipelines().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/client/pipeline/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/pipeline/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 6ab3355..0000000 --- a/pkg/client/pipeline/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright The Kubernetes 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 informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - versioned "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" -) - -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/controller/cluster_controller.go b/pkg/controller/cluster_controller.go index b1d36c9..5b797fa 100644 --- a/pkg/controller/cluster_controller.go +++ b/pkg/controller/cluster_controller.go @@ -1,6 +1,7 @@ package controller import ( + "context" "fmt" "reflect" "sort" @@ -24,14 +25,15 @@ import ( clusterapi "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" pipeapi "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - clusterclient "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" - clusterschema "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/scheme" - pipeschema "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/scheme" - clusterinformer "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/cluster/v1alpha1" - clusterlister "github.com/moiot/gravity-operator/pkg/client/cluster/listers/cluster/v1alpha1" - pipeclient "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - pipeinformer "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1" - pipelister "github.com/moiot/gravity-operator/pkg/client/pipeline/listers/pipeline/v1alpha1" + + clusterclient "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + pipeclient "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + clusterschema "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" + pipeschema "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" + clusterinformer "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/cluster/v1alpha1" + pipeinformer "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/pipeline/v1alpha1" + clusterlister "github.com/moiot/gravity-operator/pkg/generated/listers/cluster/v1alpha1" + pipelister "github.com/moiot/gravity-operator/pkg/generated/listers/pipeline/v1alpha1" ) const controllerAgentName = "gravity-controller" @@ -153,7 +155,7 @@ func (cc *ClusterController) enqueueByPipe(pipeline *pipeapi.Pipeline) { pipeline.OwnerReferences = []metav1.OwnerReference{ *metav1.NewControllerRef(cc.GetCluster(), clusterapi.SchemeGroupVersion.WithKind(clusterapi.ClusterResourceKind)), } - _, err := cc.pipeClient.GravityV1alpha1().Pipelines(pipeline.Namespace).Update(pipeline) + _, err := cc.pipeClient.PipelineV1alpha1().Pipelines(pipeline.Namespace).Update(context.Background(), pipeline, metav1.UpdateOptions{}) if err != nil { log.Error(errors.Trace(err)) } @@ -290,7 +292,7 @@ func (cc *ClusterController) syncHandler(key string) error { scheduleHistogram.WithLabelValues(name, "cluster").Observe(time.Since(start).Seconds()) }() - cluster, err := cc.clusterClient.GravityV1alpha1().Clusters(namespace).Get(name, metav1.GetOptions{}) + cluster, err := cc.clusterClient.ClusterV1alpha1().Clusters(namespace).Get(context.Background(), name, metav1.GetOptions{}) if k8serrors.IsNotFound(err) { log.Infof("cluster %s has been deleted", key) return nil @@ -316,7 +318,7 @@ func (cc *ClusterController) syncHandler(key string) error { if !reflect.DeepEqual(c.Status, status) { c.Status = status - c, err = cc.clusterClient.GravityV1alpha1().Clusters(namespace).UpdateStatus(c) + c, err = cc.clusterClient.ClusterV1alpha1().Clusters(namespace).UpdateStatus(context.Background(), c, metav1.UpdateOptions{}) if err != nil { return errors.Trace(err) } @@ -366,7 +368,7 @@ func (cc *ClusterController) upgrade(c *clusterapi.Cluster, pipelines []*pipeapi func (cc *ClusterController) upgradeIgnoreConflict(p *pipeapi.Pipeline, rule *clusterapi.DeploymentRule) { p.Spec.Image = rule.Image p.Spec.Command = rule.Command - _, err := cc.pipeClient.GravityV1alpha1().Pipelines(p.Namespace).Update(p) + _, err := cc.pipeClient.PipelineV1alpha1().Pipelines(p.Namespace).Update(context.Background(), p, metav1.UpdateOptions{}) if err != nil { if k8serrors.IsConflict(err) { newP, getErr := cc.pipeLister.Pipelines(p.Namespace).Get(p.Name) diff --git a/pkg/controller/pipeline_manager.go b/pkg/controller/pipeline_manager.go index 02b3fb7..590c833 100644 --- a/pkg/controller/pipeline_manager.go +++ b/pkg/controller/pipeline_manager.go @@ -1,9 +1,10 @@ package controller import ( + "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "reflect" "time" @@ -33,9 +34,9 @@ import ( "k8s.io/client-go/util/workqueue" api "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - client "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/scheme" - listers "github.com/moiot/gravity-operator/pkg/client/pipeline/listers/pipeline/v1alpha1" + client "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" + listers "github.com/moiot/gravity-operator/pkg/generated/listers/pipeline/v1alpha1" "github.com/moiot/gravity-operator/pkg/utils" "github.com/moiot/gravity/pkg/app" "github.com/moiot/gravity/pkg/config" @@ -294,7 +295,7 @@ func (pm *PipelineManager) syncHandler(key string) error { } func (pm *PipelineManager) syncNoneBatch(pipeline *api.Pipeline) error { - err := pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Delete(pipeline.Name, utils.ForegroundDeleteOptions) + err := pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Delete(context.Background(), pipeline.Name, *utils.ForegroundDeleteOptions) if err != nil && !apierrors.IsNotFound(err) { return errors.Trace(err) } @@ -302,11 +303,11 @@ func (pm *PipelineManager) syncNoneBatch(pipeline *api.Pipeline) error { statefulSet, err := pm.statefulSetLister.StatefulSets(pipeline.Namespace).Get(pipeline.Name) // If the resource doesn't exist, we'll create it if apierrors.IsNotFound(err) { - _, err = pm.kubeclientset.CoreV1().Services(pipeline.Namespace).Create(pm.newHeadlessService(pipeline)) + _, err = pm.kubeclientset.CoreV1().Services(pipeline.Namespace).Create(context.Background(), pm.newHeadlessService(pipeline), metav1.CreateOptions{}) if err != nil && !apierrors.IsAlreadyExists(err) { return errors.Annotatef(err, "error create headless service for %s", pipeline.Name) } - statefulSet, err = pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Create(pm.newStatefulSet(pipeline)) + statefulSet, err = pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Create(context.Background(), pm.newStatefulSet(pipeline), metav1.CreateOptions{}) } // If an error occurs during Get/Create, we'll requeue the item so we can @@ -339,7 +340,7 @@ func (pm *PipelineManager) syncNoneBatch(pipeline *api.Pipeline) error { statefulSet.Spec.Template.Spec.Containers[0].Command = pipeline.Spec.Command } if !reflect.DeepEqual(originSpec, statefulSet.Spec) { - statefulSet, err = pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Update(statefulSet) + statefulSet, err = pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Update(context.Background(), statefulSet, metav1.UpdateOptions{}) if err != nil { pm.recorder.Eventf(pipeline, corev1.EventTypeWarning, ErrSyncFailed, MessageSyncFailed, err.Error()) return errors.Trace(err) @@ -396,7 +397,7 @@ func (pm *PipelineManager) syncNoneBatch(pipeline *api.Pipeline) error { if !reflect.DeepEqual(status, pipeline.Status) { pipeline.Status = *status - pipeline, err := pm.pipeclientset.GravityV1alpha1().Pipelines(pipeline.Namespace).UpdateStatus(pipeline) + pipeline, err := pm.pipeclientset.PipelineV1alpha1().Pipelines(pipeline.Namespace).UpdateStatus(context.Background(), pipeline, metav1.UpdateOptions{}) if err != nil { if pipeline != nil { pm.recorder.Eventf(pipeline, corev1.EventTypeWarning, ErrSyncFailed, MessageSyncFailed, err.Error()) @@ -408,7 +409,7 @@ func (pm *PipelineManager) syncNoneBatch(pipeline *api.Pipeline) error { } func (pm *PipelineManager) syncBatch(pipeline *api.Pipeline) error { - err := pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Delete(pipeline.Name, utils.ForegroundDeleteOptions) + err := pm.kubeclientset.AppsV1().StatefulSets(pipeline.Namespace).Delete(context.Background(), pipeline.Name, *utils.ForegroundDeleteOptions) if err != nil && !apierrors.IsNotFound(err) { return errors.Trace(err) } @@ -420,7 +421,7 @@ func (pm *PipelineManager) syncBatch(pipeline *api.Pipeline) error { } if pipeline.Spec.Paused { // job has no replica, delete it - err := pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Delete(pipeline.Name, utils.ForegroundDeleteOptions) + err := pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Delete(context.Background(), pipeline.Name, *utils.ForegroundDeleteOptions) if err != nil && !apierrors.IsNotFound(err) { return errors.Trace(err) } @@ -435,11 +436,11 @@ func (pm *PipelineManager) syncBatch(pipeline *api.Pipeline) error { } else { job, err := pm.jobLister.Jobs(pipeline.Namespace).Get(pipeline.Name) if apierrors.IsNotFound(err) { - _, err = pm.kubeclientset.CoreV1().Services(pipeline.Namespace).Create(pm.newHeadlessService(pipeline)) + _, err = pm.kubeclientset.CoreV1().Services(pipeline.Namespace).Create(context.Background(), pm.newHeadlessService(pipeline), metav1.CreateOptions{}) if err != nil && !apierrors.IsAlreadyExists(err) { return errors.Annotatef(err, "error create headless service for %s", pipeline.Name) } - job, err = pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Create(pm.newJob(pipeline)) + job, err = pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Create(context.Background(), pm.newJob(pipeline), metav1.CreateOptions{}) } // If an error occurs during Get/Create, we'll requeue the item so we can // attempt processing again later. This could have been caused by a @@ -459,7 +460,7 @@ func (pm *PipelineManager) syncBatch(pipeline *api.Pipeline) error { if container.Image != pipeline.Spec.Image || !reflect.DeepEqual(container.Command, pipeline.Spec.Command) { job.Spec.Template.Spec.Containers[0].Image = pipeline.Spec.Image job.Spec.Template.Spec.Containers[0].Command = pipeline.Spec.Command - job, err = pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Update(job) + job, err = pm.kubeclientset.BatchV1().Jobs(pipeline.Namespace).Update(context.Background(), job, metav1.UpdateOptions{}) if err != nil { pm.recorder.Eventf(pipeline, corev1.EventTypeWarning, ErrSyncFailed, MessageSyncFailed, err.Error()) return errors.Trace(err) @@ -531,7 +532,7 @@ func (pm *PipelineManager) syncBatch(pipeline *api.Pipeline) error { }) if !reflect.DeepEqual(status, pipeline.Status) { pipeline.Status = *status - pipeline, err := pm.pipeclientset.GravityV1alpha1().Pipelines(pipeline.Namespace).UpdateStatus(pipeline) + pipeline, err := pm.pipeclientset.PipelineV1alpha1().Pipelines(pipeline.Namespace).UpdateStatus(context.Background(), pipeline, metav1.UpdateOptions{}) if err != nil { if pipeline != nil { pm.recorder.Eventf(pipeline, corev1.EventTypeWarning, ErrSyncFailed, MessageSyncFailed, err.Error()) @@ -659,7 +660,7 @@ func podTemplate(pipeline *api.Pipeline, rp corev1.RestartPolicy) corev1.PodTemp }, }, LivenessProbe: &corev1.Probe{ - Handler: corev1.Handler{ + ProbeHandler: corev1.ProbeHandler{ HTTPGet: &corev1.HTTPGetAction{ Port: intstr.FromString("http"), Path: "/healthz", @@ -737,7 +738,7 @@ func getReportStatus(url string) (*core.TaskReportStatus, error) { return nil, errors.Annotatef(err, "fail to get report status, url: %s", url) } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, errors.Annotatef(err, "fail to read report status, url: %s", url) } @@ -854,7 +855,7 @@ func (pm *PipelineManager) resetRunning(pipeline *api.Pipeline) error { return errors.Annotatef(err, "fail to request %s", url) } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return errors.Annotatef(err, "fail to read body of %s", url) } @@ -892,7 +893,7 @@ func (pm *PipelineManager) getRunningPodFromSelector(namespace string, labelSele } func (pm *PipelineManager) resetPaused(pipeline *api.Pipeline) error { - cm, err := pm.kubeclientset.CoreV1().ConfigMaps(pipeline.Namespace).Get(pipeline.Name, metav1.GetOptions{}) + cm, err := pm.kubeclientset.CoreV1().ConfigMaps(pipeline.Namespace).Get(context.Background(), pipeline.Name, metav1.GetOptions{}) if err != nil { return errors.Annotatef(err, "[PipelineManager.resetPaused] can't get config map for %s", pipeline.Name) } diff --git a/pkg/gatekeeper/chaos.go b/pkg/gatekeeper/chaos.go index a1a5629..ac33ae4 100644 --- a/pkg/gatekeeper/chaos.go +++ b/pkg/gatekeeper/chaos.go @@ -1,6 +1,7 @@ package gatekeeper import ( + "context" "math/rand" "sync" "time" @@ -83,7 +84,7 @@ func (c *ChaosMonkey) run() { gvr = statefulSetGvr } - list, err := c.kube.Resource(gvr).Namespace(c.namespace).List(metav1.ListOptions{ + list, err := c.kube.Resource(gvr).Namespace(c.namespace).List(context.Background(), metav1.ListOptions{ LabelSelector: selector.String(), }) if err != nil { @@ -97,7 +98,7 @@ func (c *ChaosMonkey) run() { } item := list.Items[rnd.Intn(len(list.Items))] - err = c.kube.Resource(gvr).Namespace(item.GetNamespace()).Delete(item.GetName(), deleteOps(rnd)) + err = c.kube.Resource(gvr).Namespace(item.GetNamespace()).Delete(context.Background(), item.GetName(), *deleteOps(rnd)) if err != nil { log.Error(errors.Annotatef(err, "[ChaosMonkey] fail to delete %s %s", item.GetKind(), item.GetName())) } else { diff --git a/pkg/gatekeeper/repository.go b/pkg/gatekeeper/repository.go index 721a82e..a52f46b 100644 --- a/pkg/gatekeeper/repository.go +++ b/pkg/gatekeeper/repository.go @@ -1,6 +1,7 @@ package gatekeeper import ( + "context" "database/sql" "encoding/json" "fmt" @@ -10,11 +11,11 @@ import ( "strings" "github.com/juju/errors" - "gopkg.in/yaml.v2" - "k8s.io/apimachinery/pkg/apis/meta/v1" + yaml "gopkg.in/yaml.v2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterapi "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" - clusterclient "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1" + clusterclient "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/cluster/v1alpha1" ) const dbName = "gatekeeper" @@ -103,7 +104,7 @@ func (r *Repository) insert(v *Version) error { Command: defaultRule.Command, } c.Spec.DeploymentRules = append([]clusterapi.DeploymentRule{rule}, c.Spec.DeploymentRules...) - c, err := r.clusterClient.Update(c) + c, err := r.clusterClient.Update(context.Background(), c, v1.UpdateOptions{}) if err != nil { return errors.Annotatef(err, "error add deployment rule %#v.", rule) } @@ -136,7 +137,7 @@ func getDefaultRule(rules []clusterapi.DeploymentRule) clusterapi.DeploymentRule } func (r *Repository) getCluster() *clusterapi.Cluster { - ret, err := r.clusterClient.List(v1.ListOptions{}) + ret, err := r.clusterClient.List(context.Background(), v1.ListOptions{}) if err != nil { log.Fatalf("[Repository.insert] error list cluster: %s", err) } @@ -165,7 +166,7 @@ func (r *Repository) delete(name string) error { } } c.Spec.DeploymentRules = rules - c, err = r.clusterClient.Update(c) + c, err = r.clusterClient.Update(context.Background(), c, v1.UpdateOptions{}) if err != nil { return errors.Annotatef(err, "error remove deployment rule %s.", name) } diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 0000000..21aa662 --- /dev/null +++ b/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,133 @@ +/* +Copyright The Kubernetes 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 client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + clusterv1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/cluster/v1alpha1" + pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface + PipelineV1alpha1() pipelinev1alpha1.PipelineV1alpha1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + clusterV1alpha1 *clusterv1alpha1.ClusterV1alpha1Client + pipelineV1alpha1 *pipelinev1alpha1.PipelineV1alpha1Client +} + +// ClusterV1alpha1 retrieves the ClusterV1alpha1Client +func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { + return c.clusterV1alpha1 +} + +// PipelineV1alpha1 retrieves the PipelineV1alpha1Client +func (c *Clientset) PipelineV1alpha1() pipelinev1alpha1.PipelineV1alpha1Interface { + return c.pipelineV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.clusterV1alpha1, err = clusterv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.pipelineV1alpha1, err = pipelinev1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.clusterV1alpha1 = clusterv1alpha1.New(c) + cs.pipelineV1alpha1 = pipelinev1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/client/pipeline/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go similarity index 65% rename from pkg/client/pipeline/clientset/versioned/fake/clientset_generated.go rename to pkg/generated/clientset/versioned/fake/clientset_generated.go index 480b45f..f7f2f7c 100644 --- a/pkg/client/pipeline/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -19,9 +19,11 @@ limitations under the License. package fake import ( - clientset "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1" - fakegravityv1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake" + clientset "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + clusterv1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/cluster/v1alpha1" + fakeclusterv1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake" + pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1" + fakepipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -41,7 +43,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { } } - cs := &Clientset{} + cs := &Clientset{tracker: o} cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { @@ -63,20 +65,28 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { type Clientset struct { testing.Fake discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker } func (c *Clientset) Discovery() discovery.DiscoveryInterface { return c.discovery } -var _ clientset.Interface = &Clientset{} +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) -// GravityV1alpha1 retrieves the GravityV1alpha1Client -func (c *Clientset) GravityV1alpha1() gravityv1alpha1.GravityV1alpha1Interface { - return &fakegravityv1alpha1.FakeGravityV1alpha1{Fake: &c.Fake} +// ClusterV1alpha1 retrieves the ClusterV1alpha1Client +func (c *Clientset) ClusterV1alpha1() clusterv1alpha1.ClusterV1alpha1Interface { + return &fakeclusterv1alpha1.FakeClusterV1alpha1{Fake: &c.Fake} } -// Gravity retrieves the GravityV1alpha1Client -func (c *Clientset) Gravity() gravityv1alpha1.GravityV1alpha1Interface { - return &fakegravityv1alpha1.FakeGravityV1alpha1{Fake: &c.Fake} +// PipelineV1alpha1 retrieves the PipelineV1alpha1Client +func (c *Clientset) PipelineV1alpha1() pipelinev1alpha1.PipelineV1alpha1Interface { + return &fakepipelinev1alpha1.FakePipelineV1alpha1{Fake: &c.Fake} } diff --git a/pkg/client/cluster/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go similarity index 100% rename from pkg/client/cluster/clientset/versioned/fake/doc.go rename to pkg/generated/clientset/versioned/fake/doc.go diff --git a/pkg/client/cluster/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go similarity index 63% rename from pkg/client/cluster/clientset/versioned/fake/register.go rename to pkg/generated/clientset/versioned/fake/register.go index c1df07a..267312a 100644 --- a/pkg/client/cluster/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -19,36 +19,40 @@ limitations under the License. package fake import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + clusterv1alpha1.AddToScheme, + pipelinev1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -func AddToScheme(scheme *runtime.Scheme) { - gravityv1alpha1.AddToScheme(scheme) +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) } diff --git a/pkg/client/cluster/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go similarity index 100% rename from pkg/client/cluster/clientset/versioned/scheme/doc.go rename to pkg/generated/clientset/versioned/scheme/doc.go diff --git a/pkg/client/cluster/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go similarity index 64% rename from pkg/client/cluster/clientset/versioned/scheme/register.go rename to pkg/generated/clientset/versioned/scheme/register.go index 3efbeb5..42ec23f 100644 --- a/pkg/client/cluster/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -19,36 +19,40 @@ limitations under the License. package scheme import ( - gravityv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + clusterv1alpha1.AddToScheme, + pipelinev1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: // -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) // -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -func AddToScheme(scheme *runtime.Scheme) { - gravityv1alpha1.AddToScheme(scheme) +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) } diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster.go similarity index 55% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster.go index 04526a7..fa14727 100644 --- a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/cluster.go +++ b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + "context" + "time" + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" - scheme "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/scheme" + scheme "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -35,15 +38,15 @@ type ClustersGetter interface { // ClusterInterface has methods to work with Cluster resources. type ClusterInterface interface { - Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) - Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) - UpdateStatus(*v1alpha1.Cluster) (*v1alpha1.Cluster, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Cluster, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) + Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (*v1alpha1.Cluster, error) + Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) + UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Cluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) ClusterExpansion } @@ -54,7 +57,7 @@ type clusters struct { } // newClusters returns a Clusters -func newClusters(c *GravityV1alpha1Client, namespace string) *clusters { +func newClusters(c *ClusterV1alpha1Client, namespace string) *clusters { return &clusters{ client: c.RESTClient(), ns: namespace, @@ -62,113 +65,131 @@ func newClusters(c *GravityV1alpha1Client, namespace string) *clusters { } // Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *clusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { +func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { result = &v1alpha1.Cluster{} err = c.client.Get(). Namespace(c.ns). Resource("clusters"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *clusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { +func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.ClusterList{} err = c.client.Get(). Namespace(c.ns). Resource("clusters"). VersionedParams(&opts, scheme.ParameterCodec). - Do(). + Timeout(timeout). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusters. -func (c *clusters) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("clusters"). VersionedParams(&opts, scheme.ParameterCodec). - Watch() + Timeout(timeout). + Watch(ctx) } // Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *clusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) { result = &v1alpha1.Cluster{} err = c.client.Post(). Namespace(c.ns). Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cluster). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *clusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) { result = &v1alpha1.Cluster{} err = c.client.Put(). Namespace(c.ns). Resource("clusters"). Name(cluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cluster). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusters) UpdateStatus(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) { result = &v1alpha1.Cluster{} err = c.client.Put(). Namespace(c.ns). Resource("clusters"). Name(cluster.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cluster). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *clusters) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("clusters"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("clusters"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cluster. -func (c *clusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { +func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) { result = &v1alpha1.Cluster{} err = c.client.Patch(pt). Namespace(c.ns). Resource("clusters"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go new file mode 100644 index 0000000..a5a9f85 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/cluster_client.go @@ -0,0 +1,107 @@ +/* +Copyright The Kubernetes 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type ClusterV1alpha1Interface interface { + RESTClient() rest.Interface + ClustersGetter +} + +// ClusterV1alpha1Client is used to interact with features provided by the cluster.gravity.mobike.io group. +type ClusterV1alpha1Client struct { + restClient rest.Interface +} + +func (c *ClusterV1alpha1Client) Clusters(namespace string) ClusterInterface { + return newClusters(c, namespace) +} + +// NewForConfig creates a new ClusterV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ClusterV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ClusterV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ClusterV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new ClusterV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ClusterV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *ClusterV1alpha1Client { + return &ClusterV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ClusterV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/doc.go similarity index 100% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/doc.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/doc.go diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/doc.go diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go similarity index 70% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go index 29fab4c..078bf8f 100644 --- a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go +++ b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster.go @@ -19,10 +19,11 @@ limitations under the License. package fake import ( + "context" + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -30,16 +31,16 @@ import ( // FakeClusters implements ClusterInterface type FakeClusters struct { - Fake *FakeGravityV1alpha1 + Fake *FakeClusterV1alpha1 ns string } -var clustersResource = schema.GroupVersionResource{Group: "gravity.mobike.io", Version: "v1alpha1", Resource: "clusters"} +var clustersResource = v1alpha1.SchemeGroupVersion.WithResource("clusters") -var clustersKind = schema.GroupVersionKind{Group: "gravity.mobike.io", Version: "v1alpha1", Kind: "Cluster"} +var clustersKind = v1alpha1.SchemeGroupVersion.WithKind("Cluster") // Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. -func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Cluster, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) @@ -50,7 +51,7 @@ func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1alpha1 } // List takes label and field selectors, and returns the list of Clusters that match those selectors. -func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { +func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha1.ClusterList{}) @@ -72,14 +73,14 @@ func (c *FakeClusters) List(opts v1.ListOptions) (result *v1alpha1.ClusterList, } // Watch returns a watch.Interface that watches the requested clusters. -func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeClusters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts)) } // Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Create(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.CreateOptions) (result *v1alpha1.Cluster, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) @@ -90,7 +91,7 @@ func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Clust } // Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any. -func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Update(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (result *v1alpha1.Cluster, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha1.Cluster{}) @@ -102,7 +103,7 @@ func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Clust // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluster, error) { +func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha1.Cluster, opts v1.UpdateOptions) (*v1alpha1.Cluster, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1alpha1.Cluster{}) @@ -113,25 +114,25 @@ func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluste } // Delete takes name of the cluster and deletes it. Returns an error if one occurs. -func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(clustersResource, c.ns, name), &v1alpha1.Cluster{}) + Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha1.Cluster{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOptions) +func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{}) return err } // Patch applies the patch and returns the patched cluster. -func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Cluster, err error) { +func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, data, subresources...), &v1alpha1.Cluster{}) + Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha1.Cluster{}) if obj == nil { return nil, err diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go similarity index 77% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go index fd0a4e7..6fa779c 100644 --- a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go +++ b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/fake/fake_cluster_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/cluster/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeGravityV1alpha1 struct { +type FakeClusterV1alpha1 struct { *testing.Fake } -func (c *FakeGravityV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface { +func (c *FakeClusterV1alpha1) Clusters(namespace string) v1alpha1.ClusterInterface { return &FakeClusters{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeGravityV1alpha1) RESTClient() rest.Interface { +func (c *FakeClusterV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/client/cluster/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go rename to pkg/generated/clientset/versioned/typed/cluster/v1alpha1/generated_expansion.go diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/doc.go similarity index 100% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/doc.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/doc.go diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/doc.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/doc.go diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go similarity index 70% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go index 859dcee..eb5331f 100644 --- a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go +++ b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline.go @@ -19,10 +19,11 @@ limitations under the License. package fake import ( + "context" + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" @@ -30,16 +31,16 @@ import ( // FakePipelines implements PipelineInterface type FakePipelines struct { - Fake *FakeGravityV1alpha1 + Fake *FakePipelineV1alpha1 ns string } -var pipelinesResource = schema.GroupVersionResource{Group: "gravity.mobike.io", Version: "v1alpha1", Resource: "pipelines"} +var pipelinesResource = v1alpha1.SchemeGroupVersion.WithResource("pipelines") -var pipelinesKind = schema.GroupVersionKind{Group: "gravity.mobike.io", Version: "v1alpha1", Kind: "Pipeline"} +var pipelinesKind = v1alpha1.SchemeGroupVersion.WithKind("Pipeline") // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *FakePipelines) Get(name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { +func (c *FakePipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(pipelinesResource, c.ns, name), &v1alpha1.Pipeline{}) @@ -50,7 +51,7 @@ func (c *FakePipelines) Get(name string, options v1.GetOptions) (result *v1alpha } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *FakePipelines) List(opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { +func (c *FakePipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(pipelinesResource, pipelinesKind, c.ns, opts), &v1alpha1.PipelineList{}) @@ -72,14 +73,14 @@ func (c *FakePipelines) List(opts v1.ListOptions) (result *v1alpha1.PipelineList } // Watch returns a watch.Interface that watches the requested pipelines. -func (c *FakePipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakePipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(pipelinesResource, c.ns, opts)) } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *FakePipelines) Create(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *FakePipelines) Create(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.CreateOptions) (result *v1alpha1.Pipeline, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(pipelinesResource, c.ns, pipeline), &v1alpha1.Pipeline{}) @@ -90,7 +91,7 @@ func (c *FakePipelines) Create(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pi } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *FakePipelines) Update(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *FakePipelines) Update(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (result *v1alpha1.Pipeline, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(pipelinesResource, c.ns, pipeline), &v1alpha1.Pipeline{}) @@ -102,7 +103,7 @@ func (c *FakePipelines) Update(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pi // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePipelines) UpdateStatus(pipeline *v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) { +func (c *FakePipelines) UpdateStatus(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (*v1alpha1.Pipeline, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(pipelinesResource, "status", c.ns, pipeline), &v1alpha1.Pipeline{}) @@ -113,25 +114,25 @@ func (c *FakePipelines) UpdateStatus(pipeline *v1alpha1.Pipeline) (*v1alpha1.Pip } // Delete takes name of the pipeline and deletes it. Returns an error if one occurs. -func (c *FakePipelines) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakePipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(pipelinesResource, c.ns, name), &v1alpha1.Pipeline{}) + Invokes(testing.NewDeleteActionWithOptions(pipelinesResource, c.ns, name, opts), &v1alpha1.Pipeline{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakePipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pipelinesResource, c.ns, listOptions) +func (c *FakePipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelinesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PipelineList{}) return err } // Patch applies the patch and returns the patched pipeline. -func (c *FakePipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pipeline, err error) { +func (c *FakePipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Pipeline, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pipelinesResource, c.ns, name, data, subresources...), &v1alpha1.Pipeline{}) + Invokes(testing.NewPatchSubresourceAction(pipelinesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Pipeline{}) if obj == nil { return nil, err diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go similarity index 75% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go index a899be0..0c03cf1 100644 --- a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go +++ b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/fake/fake_pipeline_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeGravityV1alpha1 struct { +type FakePipelineV1alpha1 struct { *testing.Fake } -func (c *FakeGravityV1alpha1) Pipelines(namespace string) v1alpha1.PipelineInterface { +func (c *FakePipelineV1alpha1) Pipelines(namespace string) v1alpha1.PipelineInterface { return &FakePipelines{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeGravityV1alpha1) RESTClient() rest.Interface { +func (c *FakePipelineV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/generated_expansion.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/generated_expansion.go diff --git a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go similarity index 55% rename from pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go rename to pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go index d33b8b9..68ee679 100644 --- a/pkg/client/pipeline/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go +++ b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go @@ -19,8 +19,11 @@ limitations under the License. package v1alpha1 import ( + "context" + "time" + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - scheme "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned/scheme" + scheme "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -35,15 +38,15 @@ type PipelinesGetter interface { // PipelineInterface has methods to work with Pipeline resources. type PipelineInterface interface { - Create(*v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) - Update(*v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) - UpdateStatus(*v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Pipeline, error) - List(opts v1.ListOptions) (*v1alpha1.PipelineList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pipeline, err error) + Create(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.CreateOptions) (*v1alpha1.Pipeline, error) + Update(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (*v1alpha1.Pipeline, error) + UpdateStatus(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (*v1alpha1.Pipeline, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Pipeline, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PipelineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Pipeline, err error) PipelineExpansion } @@ -54,7 +57,7 @@ type pipelines struct { } // newPipelines returns a Pipelines -func newPipelines(c *GravityV1alpha1Client, namespace string) *pipelines { +func newPipelines(c *PipelineV1alpha1Client, namespace string) *pipelines { return &pipelines{ client: c.RESTClient(), ns: namespace, @@ -62,113 +65,131 @@ func newPipelines(c *GravityV1alpha1Client, namespace string) *pipelines { } // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *pipelines) List(opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { +func (c *pipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.PipelineList{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). - Do(). + Timeout(timeout). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelines. -func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *pipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). - Watch() + Timeout(timeout). + Watch(ctx) } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Create(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Create(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.CreateOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Post(). Namespace(c.ns). Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Update(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Update(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Put(). Namespace(c.ns). Resource("pipelines"). Name(pipeline.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *pipelines) UpdateStatus(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) UpdateStatus(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Put(). Namespace(c.ns). Resource("pipelines"). Name(pipeline.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipeline and deletes it. Returns an error if one occurs. -func (c *pipelines) Delete(name string, options *v1.DeleteOptions) error { +func (c *pipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *pipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipeline. -func (c *pipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelines"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go new file mode 100644 index 0000000..b84ccc1 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/pipeline/v1alpha1/pipeline_client.go @@ -0,0 +1,107 @@ +/* +Copyright The Kubernetes 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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" + "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type PipelineV1alpha1Interface interface { + RESTClient() rest.Interface + PipelinesGetter +} + +// PipelineV1alpha1Client is used to interact with features provided by the pipeline.gravity.mobike.io group. +type PipelineV1alpha1Client struct { + restClient rest.Interface +} + +func (c *PipelineV1alpha1Client) Pipelines(namespace string) PipelineInterface { + return newPipelines(c, namespace) +} + +// NewForConfig creates a new PipelineV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*PipelineV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new PipelineV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PipelineV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &PipelineV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new PipelineV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *PipelineV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new PipelineV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *PipelineV1alpha1Client { + return &PipelineV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *PipelineV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/cluster/informers/externalversions/cluster/interface.go b/pkg/generated/informers/externalversions/cluster/interface.go similarity index 85% rename from pkg/client/cluster/informers/externalversions/cluster/interface.go rename to pkg/generated/informers/externalversions/cluster/interface.go index be00345..8e52d73 100644 --- a/pkg/client/cluster/informers/externalversions/cluster/interface.go +++ b/pkg/generated/informers/externalversions/cluster/interface.go @@ -16,11 +16,11 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package gravity +package cluster import ( - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/cluster/v1alpha1" - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/cluster/v1alpha1" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/cluster/informers/externalversions/cluster/v1alpha1/cluster.go b/pkg/generated/informers/externalversions/cluster/v1alpha1/cluster.go similarity index 87% rename from pkg/client/cluster/informers/externalversions/cluster/v1alpha1/cluster.go rename to pkg/generated/informers/externalversions/cluster/v1alpha1/cluster.go index e7b31a1..11d34b3 100644 --- a/pkg/client/cluster/informers/externalversions/cluster/v1alpha1/cluster.go +++ b/pkg/generated/informers/externalversions/cluster/v1alpha1/cluster.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" clusterv1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" - versioned "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/cluster/listers/cluster/v1alpha1" + versioned "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/listers/cluster/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,13 +62,13 @@ func NewFilteredClusterInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.GravityV1alpha1().Clusters(namespace).List(options) + return client.ClusterV1alpha1().Clusters(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GravityV1alpha1().Clusters(namespace).Watch(options) + return client.ClusterV1alpha1().Clusters(namespace).Watch(context.TODO(), options) }, }, &clusterv1alpha1.Cluster{}, diff --git a/pkg/client/cluster/informers/externalversions/cluster/v1alpha1/interface.go b/pkg/generated/informers/externalversions/cluster/v1alpha1/interface.go similarity index 92% rename from pkg/client/cluster/informers/externalversions/cluster/v1alpha1/interface.go rename to pkg/generated/informers/externalversions/cluster/v1alpha1/interface.go index ed5aeb1..aa8f685 100644 --- a/pkg/client/cluster/informers/externalversions/cluster/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/cluster/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/cluster/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/client/pipeline/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go similarity index 61% rename from pkg/client/pipeline/informers/externalversions/factory.go rename to pkg/generated/informers/externalversions/factory.go index b32d70f..17db231 100644 --- a/pkg/client/pipeline/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -23,9 +23,10 @@ import ( sync "sync" time "time" - versioned "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/internalinterfaces" - pipeline "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/pipeline" + versioned "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + cluster "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/cluster" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" + pipeline "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/pipeline" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -42,11 +43,17 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -75,6 +82,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return NewSharedInformerFactoryWithOptions(client, defaultResync) @@ -107,20 +122,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -142,7 +176,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -160,6 +194,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -167,14 +202,66 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Gravity() pipeline.Interface + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + Cluster() cluster.Interface + Pipeline() pipeline.Interface +} + +func (f *sharedInformerFactory) Cluster() cluster.Interface { + return cluster.New(f, f.namespace, f.tweakListOptions) } -func (f *sharedInformerFactory) Gravity() pipeline.Interface { +func (f *sharedInformerFactory) Pipeline() pipeline.Interface { return pipeline.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/cluster/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go similarity index 81% rename from pkg/client/cluster/informers/externalversions/generic.go rename to pkg/generated/informers/externalversions/generic.go index 96202e0..4c206d8 100644 --- a/pkg/client/cluster/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -22,6 +22,7 @@ import ( "fmt" v1alpha1 "github.com/moiot/gravity-operator/pkg/apis/cluster/v1alpha1" + pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -52,9 +53,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=gravity.mobike.io, Version=v1alpha1 + // Group=cluster.gravity.mobike.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("clusters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gravity().V1alpha1().Clusters().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().Clusters().Informer()}, nil + + // Group=pipeline.gravity.mobike.io, Version=v1alpha1 + case pipelinev1alpha1.SchemeGroupVersion.WithResource("pipelines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Pipeline().V1alpha1().Pipelines().Informer()}, nil } diff --git a/pkg/client/cluster/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go similarity index 82% rename from pkg/client/cluster/informers/externalversions/internalinterfaces/factory_interfaces.go rename to pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index 70a8ca2..420761a 100644 --- a/pkg/client/cluster/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -21,12 +21,13 @@ package internalinterfaces import ( time "time" - versioned "github.com/moiot/gravity-operator/pkg/client/cluster/clientset/versioned" + versioned "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" ) +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -35,4 +36,5 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/client/pipeline/informers/externalversions/pipeline/interface.go b/pkg/generated/informers/externalversions/pipeline/interface.go similarity index 85% rename from pkg/client/pipeline/informers/externalversions/pipeline/interface.go rename to pkg/generated/informers/externalversions/pipeline/interface.go index a7627dc..6a48c68 100644 --- a/pkg/client/pipeline/informers/externalversions/pipeline/interface.go +++ b/pkg/generated/informers/externalversions/pipeline/interface.go @@ -16,11 +16,11 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package gravity +package pipeline import ( - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/pipeline/v1alpha1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go b/pkg/generated/informers/externalversions/pipeline/v1alpha1/interface.go similarity index 92% rename from pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go rename to pkg/generated/informers/externalversions/pipeline/v1alpha1/interface.go index 721e1cb..d38cf97 100644 --- a/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/pipeline/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go b/pkg/generated/informers/externalversions/pipeline/v1alpha1/pipeline.go similarity index 87% rename from pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go rename to pkg/generated/informers/externalversions/pipeline/v1alpha1/pipeline.go index 7ab51dd..8de840d 100644 --- a/pkg/client/pipeline/informers/externalversions/pipeline/v1alpha1/pipeline.go +++ b/pkg/generated/informers/externalversions/pipeline/v1alpha1/pipeline.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" pipelinev1alpha1 "github.com/moiot/gravity-operator/pkg/apis/pipeline/v1alpha1" - versioned "github.com/moiot/gravity-operator/pkg/client/pipeline/clientset/versioned" - internalinterfaces "github.com/moiot/gravity-operator/pkg/client/pipeline/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/moiot/gravity-operator/pkg/client/pipeline/listers/pipeline/v1alpha1" + versioned "github.com/moiot/gravity-operator/pkg/generated/clientset/versioned" + internalinterfaces "github.com/moiot/gravity-operator/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/moiot/gravity-operator/pkg/generated/listers/pipeline/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -61,13 +62,13 @@ func NewFilteredPipelineInformer(client versioned.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.GravityV1alpha1().Pipelines(namespace).List(options) + return client.PipelineV1alpha1().Pipelines(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GravityV1alpha1().Pipelines(namespace).Watch(options) + return client.PipelineV1alpha1().Pipelines(namespace).Watch(context.TODO(), options) }, }, &pipelinev1alpha1.Pipeline{}, diff --git a/pkg/client/cluster/listers/cluster/v1alpha1/cluster.go b/pkg/generated/listers/cluster/v1alpha1/cluster.go similarity index 91% rename from pkg/client/cluster/listers/cluster/v1alpha1/cluster.go rename to pkg/generated/listers/cluster/v1alpha1/cluster.go index 445d780..8a17162 100644 --- a/pkg/client/cluster/listers/cluster/v1alpha1/cluster.go +++ b/pkg/generated/listers/cluster/v1alpha1/cluster.go @@ -26,8 +26,10 @@ import ( ) // ClusterLister helps list Clusters. +// All objects returned here must be treated as read-only. type ClusterLister interface { // List lists all Clusters in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) // Clusters returns an object that can list and get Clusters. Clusters(namespace string) ClusterNamespaceLister @@ -58,10 +60,13 @@ func (s *clusterLister) Clusters(namespace string) ClusterNamespaceLister { } // ClusterNamespaceLister helps list and get Clusters. +// All objects returned here must be treated as read-only. type ClusterNamespaceLister interface { // List lists all Clusters in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Cluster, err error) // Get retrieves the Cluster from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.Cluster, error) ClusterNamespaceListerExpansion } diff --git a/pkg/client/cluster/listers/cluster/v1alpha1/expansion_generated.go b/pkg/generated/listers/cluster/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/cluster/listers/cluster/v1alpha1/expansion_generated.go rename to pkg/generated/listers/cluster/v1alpha1/expansion_generated.go diff --git a/pkg/client/pipeline/listers/pipeline/v1alpha1/expansion_generated.go b/pkg/generated/listers/pipeline/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/pipeline/listers/pipeline/v1alpha1/expansion_generated.go rename to pkg/generated/listers/pipeline/v1alpha1/expansion_generated.go diff --git a/pkg/client/pipeline/listers/pipeline/v1alpha1/pipeline.go b/pkg/generated/listers/pipeline/v1alpha1/pipeline.go similarity index 91% rename from pkg/client/pipeline/listers/pipeline/v1alpha1/pipeline.go rename to pkg/generated/listers/pipeline/v1alpha1/pipeline.go index a986bca..ae894c3 100644 --- a/pkg/client/pipeline/listers/pipeline/v1alpha1/pipeline.go +++ b/pkg/generated/listers/pipeline/v1alpha1/pipeline.go @@ -26,8 +26,10 @@ import ( ) // PipelineLister helps list Pipelines. +// All objects returned here must be treated as read-only. type PipelineLister interface { // List lists all Pipelines in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Pipeline, err error) // Pipelines returns an object that can list and get Pipelines. Pipelines(namespace string) PipelineNamespaceLister @@ -58,10 +60,13 @@ func (s *pipelineLister) Pipelines(namespace string) PipelineNamespaceLister { } // PipelineNamespaceLister helps list and get Pipelines. +// All objects returned here must be treated as read-only. type PipelineNamespaceLister interface { // List lists all Pipelines in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.Pipeline, err error) // Get retrieves the Pipeline from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.Pipeline, error) PipelineNamespaceListerExpansion }