From 73d178e4a3ed8546a82a70c4476057acb0b45b9e Mon Sep 17 00:00:00 2001 From: Adam Janikowski <12255597+ajanikow@users.noreply.github.com> Date: Tue, 23 Mar 2021 16:47:28 +0100 Subject: [PATCH] [Feature] Switch k8s to 1.19 (#701) --- CHANGELOG.md | 1 + Makefile | 2 +- go.mod | 50 +- go.sum | 604 ++++++------------ lifecycle.go | 3 +- main.go | 3 +- .../arango/backup/backup_suite_test.go | 7 +- .../handlers/arango/backup/finalizer.go | 6 +- pkg/backup/handlers/arango/backup/handler.go | 23 +- .../handlers/arango/backup/lifecycle.go | 3 +- pkg/backup/handlers/arango/backup/util.go | 3 +- pkg/backup/handlers/arango/policy/handler.go | 9 +- .../arango/policy/handler_suite_test.go | 11 +- .../handlers/arango/policy/lifecycle.go | 3 +- pkg/backup/operator/event/event.go | 3 +- pkg/backup/operator/event/event_test.go | 5 +- pkg/backup/operator/operator_test.go | 41 +- pkg/deployment/access_package.go | 9 +- pkg/deployment/cleanup.go | 4 +- pkg/deployment/cluster_scaling_integration.go | 2 +- pkg/deployment/context_impl.go | 28 +- pkg/deployment/deployment.go | 18 +- pkg/deployment/deployment_finalizers.go | 6 +- pkg/deployment/deployment_inspector.go | 2 +- pkg/deployment/deployment_pod_sync_test.go | 9 +- pkg/deployment/deployment_pod_tls_sni_test.go | 3 +- pkg/deployment/deployment_run_test.go | 9 +- pkg/deployment/deployment_suite_test.go | 2 +- pkg/deployment/images.go | 6 +- pkg/deployment/images_test.go | 25 +- pkg/deployment/pod/encryption.go | 3 +- .../reconcile/action_encryption_add.go | 4 +- .../reconcile/action_encryption_refresh.go | 2 +- .../reconcile/action_encryption_remove.go | 4 +- .../action_encryption_status_update.go | 2 +- pkg/deployment/reconcile/action_jwt_add.go | 4 +- pkg/deployment/reconcile/action_jwt_clean.go | 4 +- .../reconcile/action_jwt_set_active.go | 4 +- .../reconcile/action_tls_ca_append.go | 4 +- .../reconcile/action_tls_ca_clean.go | 4 +- .../reconcile/action_tls_ca_renew.go | 2 +- .../reconcile/action_tls_status_update.go | 2 +- pkg/deployment/reconcile/plan_builder_test.go | 2 +- pkg/deployment/resources/annotations.go | 20 +- pkg/deployment/resources/context.go | 2 +- .../resources/inspector/inspector.go | 12 +- pkg/deployment/resources/inspector/members.go | 4 +- pkg/deployment/resources/inspector/pdbs.go | 4 +- pkg/deployment/resources/inspector/pods.go | 4 +- pkg/deployment/resources/inspector/pvcs.go | 4 +- pkg/deployment/resources/inspector/sa.go | 4 +- pkg/deployment/resources/inspector/secrets.go | 6 +- .../resources/inspector/services.go | 4 +- pkg/deployment/resources/inspector/sms.go | 8 +- pkg/deployment/resources/labels.go | 19 +- pkg/deployment/resources/member_cleanup.go | 5 +- pkg/deployment/resources/pdbs.go | 6 +- pkg/deployment/resources/pod_finalizers.go | 4 +- pkg/deployment/resources/pod_termination.go | 8 +- pkg/deployment/resources/pvc_finalizers.go | 2 +- pkg/deployment/resources/resources.go | 2 +- pkg/deployment/resources/secrets.go | 13 +- pkg/deployment/resources/servicemonitor.go | 18 +- pkg/deployment/resources/services.go | 9 +- pkg/deployment/server_api.go | 5 +- pkg/deployment/server_member_api.go | 4 +- .../clientset/versioned/clientset.go | 2 +- .../clientset/versioned/fake/register.go | 2 +- .../versioned/typed/backup/v1/arangobackup.go | 72 ++- .../typed/backup/v1/arangobackuppolicy.go | 72 ++- .../typed/backup/v1/fake/fake_arangobackup.go | 22 +- .../backup/v1/fake/fake_arangobackuppolicy.go | 22 +- .../typed/deployment/v1/arangodeployment.go | 72 ++- .../typed/deployment/v1/arangomember.go | 72 ++- .../v1/fake/fake_arangodeployment.go | 22 +- .../deployment/v1/fake/fake_arangomember.go | 22 +- .../deployment/v2alpha1/arangodeployment.go | 72 ++- .../typed/deployment/v2alpha1/arangomember.go | 72 ++- .../v2alpha1/fake/fake_arangodeployment.go | 22 +- .../v2alpha1/fake/fake_arangomember.go | 22 +- .../v1/arangodeploymentreplication.go | 72 ++- .../fake/fake_arangodeploymentreplication.go | 22 +- .../v2alpha1/arangodeploymentreplication.go | 72 ++- .../fake/fake_arangodeploymentreplication.go | 22 +- .../storage/v1alpha/arangolocalstorage.go | 72 ++- .../v1alpha/fake/fake_arangolocalstorage.go | 22 +- .../backup/v1/arangobackup.go | 5 +- .../backup/v1/arangobackuppolicy.go | 5 +- .../deployment/v1/arangodeployment.go | 5 +- .../deployment/v1/arangomember.go | 5 +- .../deployment/v2alpha1/arangodeployment.go | 5 +- .../deployment/v2alpha1/arangomember.go | 5 +- .../v1/arangodeploymentreplication.go | 5 +- .../v2alpha1/arangodeploymentreplication.go | 5 +- .../storage/v1alpha/arangolocalstorage.go | 5 +- .../listers/backup/v1/arangobackup.go | 5 + .../listers/backup/v1/arangobackuppolicy.go | 5 + .../listers/deployment/v1/arangodeployment.go | 5 + .../listers/deployment/v1/arangomember.go | 5 + .../deployment/v2alpha1/arangodeployment.go | 5 + .../deployment/v2alpha1/arangomember.go | 5 + .../v1/arangodeploymentreplication.go | 5 + .../v2alpha1/arangodeploymentreplication.go | 5 + .../storage/v1alpha/arangolocalstorage.go | 3 + pkg/operator/crd.go | 8 +- pkg/operator/operator.go | 2 +- pkg/operator/operator_leader.go | 6 +- pkg/operator/server_discovery_api.go | 7 +- pkg/replication/deployment_replication.go | 13 +- pkg/replication/finalizers.go | 8 +- pkg/replication/sync_client.go | 5 +- pkg/server/auth.go | 3 +- pkg/server/server.go | 3 +- pkg/storage/clients.go | 2 +- pkg/storage/daemon_set.go | 7 +- pkg/storage/image.go | 4 +- pkg/storage/local_storage.go | 12 +- pkg/storage/pv_cleanup.go | 2 +- pkg/storage/pv_creator.go | 10 +- pkg/storage/pv_inspector.go | 3 +- pkg/storage/pvc_inspector.go | 4 +- pkg/storage/server_api.go | 3 +- pkg/storage/service.go | 4 +- pkg/storage/storage_class.go | 6 +- pkg/util/crd/crd.go | 3 +- pkg/util/k8sutil/annotations.go | 14 +- pkg/util/k8sutil/client.go | 2 +- pkg/util/k8sutil/finalizers.go | 10 +- pkg/util/k8sutil/inspector/inspector.go | 2 +- pkg/util/k8sutil/inspector/secret/secret.go | 4 +- .../k8sutil/inspector/servicemonitor/sm.go | 2 +- pkg/util/k8sutil/owner.go | 6 +- pkg/util/k8sutil/pods.go | 3 +- pkg/util/k8sutil/pvc.go | 7 +- pkg/util/k8sutil/pvc_cache.go | 76 --- pkg/util/k8sutil/secrets.go | 38 +- pkg/util/k8sutil/secrets_cache.go | 94 --- pkg/util/k8sutil/secrets_test.go | 139 ---- pkg/util/k8sutil/services.go | 67 +- pkg/util/k8sutil/services_cache.go | 93 --- pkg/util/k8sutil/storageclass.go | 5 +- pkg/util/k8sutil/storageclass_test.go | 5 +- reboot.go | 18 +- tests/annotations_test.go | 7 +- tests/auth_test.go | 13 +- tests/backup_test.go | 116 ++-- tests/change_args_test.go | 8 +- tests/cursor_test.go | 7 +- tests/deployments_test.go | 7 +- tests/environments_test.go | 5 +- tests/immutable_test.go | 3 +- tests/load_balancer_source_ranges_test.go | 6 +- tests/load_balancer_test.go | 3 +- tests/member_resilience_test.go | 36 +- tests/metrics_test.go | 4 +- tests/operator_upgrade_test.go | 15 +- tests/pc_test.go | 19 +- tests/pdb_test.go | 5 +- tests/persistent_volumes_test.go | 37 +- tests/predicates.go | 3 +- tests/prepull_image_util.go | 7 +- tests/resilience_test.go | 44 +- tests/resources_test.go | 4 +- tests/rocksdb_encryption_test.go | 3 +- tests/scale_test.go | 7 +- tests/secret_hashes_test.go | 6 +- tests/service_account_test.go | 14 +- tests/sidecar_test.go | 3 +- tests/simple_test.go | 9 +- tests/sync_test.go | 10 +- tests/test_util.go | 24 +- tests/upgrade_test.go | 3 +- tests/version_test.go | 3 +- 173 files changed, 1389 insertions(+), 1788 deletions(-) delete mode 100644 pkg/util/k8sutil/pvc_cache.go delete mode 100644 pkg/util/k8sutil/secrets_cache.go delete mode 100644 pkg/util/k8sutil/secrets_test.go delete mode 100644 pkg/util/k8sutil/services_cache.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 679343388..4aea7dabb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- Bump Kubernetes Dependencies to 1.19.x ## [1.1.6](https://github.com/arangodb/kube-arangodb/tree/1.1.6) (2021-03-02) - Add ArangoMember Resource and required RBAC rules diff --git a/Makefile b/Makefile index 5f5700f8d..2f35ea7de 100644 --- a/Makefile +++ b/Makefile @@ -229,7 +229,7 @@ endif .PHONY: update-vendor update-vendor: @rm -Rf $(VENDORDIR)/k8s.io/code-generator - @git clone --branch kubernetes-1.16.15 https://github.com/kubernetes/code-generator.git $(VENDORDIR)/k8s.io/code-generator + @git clone --branch kubernetes-1.19.8 https://github.com/kubernetes/code-generator.git $(VENDORDIR)/k8s.io/code-generator @rm -Rf $(VENDORDIR)/k8s.io/code-generator/.git diff --git a/go.mod b/go.mod index 05d1f8b73..0243e38d4 100644 --- a/go.mod +++ b/go.mod @@ -4,21 +4,22 @@ go 1.13 replace ( github.com/arangodb/go-driver => github.com/arangodb/go-driver v0.0.0-20200617115956-9dac4c7fed22 - github.com/coreos/prometheus-operator => github.com/coreos/prometheus-operator v0.37.0 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring => github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.46.0 + github.com/prometheus-operator/prometheus-operator/pkg/client => github.com/prometheus-operator/prometheus-operator/pkg/client v0.46.0 github.com/stretchr/testify => github.com/stretchr/testify v1.5.1 github.com/ugorji/go => github.com/ugorji/go v0.0.0-20181209151446-772ced7fd4c2 - k8s.io/api => k8s.io/api v0.16.15 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.16.15 - k8s.io/apimachinery => k8s.io/apimachinery v0.16.15 - k8s.io/apiserver => k8s.io/apiserver v0.16.15 - k8s.io/client-go => k8s.io/client-go v0.16.15 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.16.15 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.16.15 + k8s.io/api => k8s.io/api v0.19.8 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.8 + k8s.io/apimachinery => k8s.io/apimachinery v0.19.8 + k8s.io/apiserver => k8s.io/apiserver v0.19.8 + k8s.io/client-go => k8s.io/client-go v0.19.8 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.8 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.19.8 k8s.io/code-generator => ./deps/k8s.io/code-generator - k8s.io/component-base => k8s.io/component-base v0.16.15 - k8s.io/kubernetes => k8s.io/kubernetes v0.16.15 - k8s.io/metrics => k8s.io/metrics v0.16.15 + k8s.io/component-base => k8s.io/component-base v0.19.8 + k8s.io/kubernetes => k8s.io/kubernetes v0.19.8 + k8s.io/metrics => k8s.io/metrics v0.19.8 ) require ( @@ -28,37 +29,38 @@ require ( github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21 github.com/cenkalti/backoff v2.1.1+incompatible github.com/coreos/go-semver v0.3.0 - github.com/coreos/prometheus-operator v0.37.0 github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/evanphx/json-patch v4.9.0+incompatible github.com/ghodss/yaml v1.0.0 github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect github.com/gin-gonic/gin v1.3.0 - github.com/google/addlicense v0.0.0-20200906110928-a0294312aa76 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f + github.com/jessevdk/go-flags v1.4.0 // indirect github.com/julienschmidt/httprouter v1.3.0 github.com/magiconair/properties v1.8.0 github.com/mattn/go-isatty v0.0.12 // indirect - github.com/pkg/errors v0.8.1 - github.com/prometheus/client_golang v1.2.1 + github.com/onsi/gomega v1.7.1 // indirect + github.com/pkg/errors v0.9.1 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.44.1 + github.com/prometheus-operator/prometheus-operator/pkg/client v0.0.0-00010101000000-000000000000 + github.com/prometheus/client_golang v1.7.1 github.com/robfig/cron v1.2.0 github.com/rs/zerolog v1.14.3 - github.com/spf13/cobra v0.0.5 + github.com/spf13/cobra v1.0.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.5.1 github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2 // indirect - golang.org/x/mod v0.4.1 // indirect - golang.org/x/net v0.0.0-20201021035429-f5854403a974 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210223085322-b80eb88b80d2 - golang.org/x/tools v0.1.0 // indirect + golang.org/x/net v0.0.0-20201110031124-69a78807bb2b + golang.org/x/sys v0.0.0-20201112073958-5cba982894dd + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v8 v8.18.2 // indirect - k8s.io/api v0.17.3 - k8s.io/apiextensions-apiserver v0.17.3 - k8s.io/apimachinery v0.17.3 + k8s.io/api v0.19.8 + k8s.io/apiextensions-apiserver v0.18.3 + k8s.io/apimachinery v0.19.8 k8s.io/client-go v12.0.0+incompatible k8s.io/klog v1.0.0 ) diff --git a/go.sum b/go.sum index 4f489b7ef..76b24526d 100644 --- a/go.sum +++ b/go.sum @@ -6,42 +6,28 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.49.0/go.mod h1:hGvAdzcWNbyuxS3nWhD7H2cIJxjRRTRLQVB0bdputVY= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.3.0/go.mod h1:9IAwXhoyBJ7z9LcAwkj0/7NnPzYaPeZxxVp3zm+5IqA= -contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v36.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.3.1-0.20191028180845-3492b2aff503/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.1-0.20191028180845-3492b2aff503/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/PuerkitoBio/purell v1.0.0 h1:0GoNN3taZV6QI81IXgCbxMyEaJDXMSIjArYBCYzVVvs= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -50,18 +36,14 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2 h1:JCHLVE3B+kJd github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/aliyun/aliyun-oss-go-sdk v2.0.4+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680 h1:5YCGq0gkf/sCEkDFIsMBPj59GOm5cMibGqDBH2OWWfQ= github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680/go.mod h1:xDyzBwyYzcEhsaDXtmxCNM4p5BrtuoVYYsRTuJqmCeg= github.com/arangodb/arangosync-client v0.6.3 h1:CJL9IxjCNVci2HNuWncZdVzHBeYTz0CeqqTf5Kpj2Ac= @@ -72,16 +54,9 @@ github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21 h1:+W7D5 github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21/go.mod h1:RkPIG6JJ2pcJUoymc18NxAJGraZd+iAEVnOTDjZey/w= github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e h1:Xg+hGrY2LcQBbxd0ZFdbGSyRKTYMZCfBbw/pMJFOk1g= github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e/go.mod h1:mq7Shfa/CaixoDxiyAAc5jZ6CVBAyPaNQCGS7mkj4Ho= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= 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.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= @@ -90,42 +65,32 @@ 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/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= -github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8= -github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v0.0.0-20181017004759-096ff4a8a059/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.3/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/prometheus-operator v0.37.0 h1:pz7nkDrJr/Iha+0A+l0N/oLvGTklgAcXuMvPWrx2AXk= -github.com/coreos/prometheus-operator v0.37.0/go.mod h1:21GquRqU+gbUFNns/aE5kaQNel+4RJLMYGCIYytevPI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -133,37 +98,27 @@ github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 h1:74lLNRzvsdIlkTgfD github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9/go.mod h1:GgB8SF9nRG+GqaDtLcwJZsQFhcogVCJ79j4EdT0c2V4= 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/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elastic/go-sysinfo v1.0.1/go.mod h1:O/D5m1VpYLwGjCYzEt63g3Z1uO3jXfwyzzjiW90t8cY= -github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= -github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= -github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/structtag v1.1.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -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/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -173,8 +128,7 @@ 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/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -182,92 +136,89 @@ github.com/go-logfmt/logfmt v0.3.0 h1:8HUsc87TaSWLKwrnumgC8/YconD2fJQsRJAsWaPg2i github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.17.2/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.17.2/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1 h1:wSt/4CYxs70xbATrGXhokKF1i0tZjENLOo1ioIO13zk= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.17.2/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9 h1:tF+augKRWlWx0J0B7ZyyKSiTyV6E1zZe+7b3qQlcEf8= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.17.2/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.17.2/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.18.0/go.mod h1:uI6pHuxWYTy94zZxgcwJkUWa9wbIlhteGfloI10GD4U= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501 h1:C1JKChikHGpXwT5UQDFaryIpDtyyGL/CR6C2kB7F1oc= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.17.2/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.17.2/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87 h1:zP3nY8Tk2E6RTkqGYrarZXuzh+ffyLDljLxCy1iJw80= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.17.2/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= 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/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= 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-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/addlicense v0.0.0-20200906110928-a0294312aa76 h1:JypWNzPMSgH5yL0NvFoAIsDRlKFgL0AsS3GO5bg4Pto= -github.com/google/addlicense v0.0.0-20200906110928-a0294312aa76/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -275,66 +226,33 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.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-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.6.0/go.mod h1:GICNByuaEBibcjmjvI7QvYJSZEbGkcYwAR7EZK2WMqM= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 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/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= @@ -342,41 +260,28 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 h1:cW/amwGEJK5MSKntPXRjX4dxs/nGxGT8gXKIsKFmHGc= github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15/go.mod h1:Fdm/oWRW+CH8PRbLntksCNtmcCBximKPkVQYvmMl80k= github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f h1:K2zqtTU3T3ZX/vVeFtJ1OoxEm+gsLhu3zQ34tKgOAyk= github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f/go.mod h1:GjkD6wGIxVEccQ4pa27Ebe00zAi1EEpAcL6rL0ADvwU= -github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jsonnet-bundler/jsonnet-bundler v0.2.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= @@ -385,19 +290,16 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/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 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= 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/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.0/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lovoo/gcloud-opentracing v0.3.0/go.mod h1:ZFqk2y38kMDDikZPAK7ynTTGuyt17nSPdS3K5e+ZTBY= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a h1:TpvdAwDAt1K4ANVOfcihouRdvP+MgAfDWwBuct4l6ZY= @@ -408,181 +310,116 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20191113090002-7c0f6868bffe/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.6/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 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/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.22/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/minio/minio-go/v6 v6.0.44/go.mod h1:qD0lajrGW49lKZLtXKtCB4X/qkMf0a5tBvN2PaZg7Gg= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= 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-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/mozillazg/go-cos v0.13.0/go.mod h1:Zp6DvvXn0RUOXGJ2chmWt2bLEqRAnJnS3DnAZsJsoaE= -github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v0.0.0-20170117200651-66bb6560562f/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 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/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw= -github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible h1:Jd6xfriVlJ6hWPvYOE0Ni0QWcNTLRehfGPFxr3eSL80= github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible/go.mod h1:xlUlxe/2ItGlQyMTstqeDv9r3U4obH7xYd26TbDQutY= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= 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/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/alertmanager v0.18.0/go.mod h1:WcxHBl40VSPuOaqWae6l6HpnEOVRIycEJ7i9iYkadEE= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.46.0 h1:J+aQlaDVIemgZDR1f/48MBaiA7rDTm6OyKSRhDX2ZTY= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.46.0/go.mod h1:3WYi4xqXxGGXWDdQIITnLNmuDzO5n6wYva9spVhR4fg= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.46.0 h1:J5gQysJlkhJWOzCZQUx/POBqD6dpM5OI6TRZtAXgYpM= +github.com/prometheus-operator/prometheus-operator/pkg/client v0.46.0/go.mod h1:k4BrWlVQQsvBiTcDnKEMgyh/euRxyxgrHdur/ZX/sdA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -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_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.0/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= -github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= +github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= 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.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/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/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/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.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.6 h1:0qbH+Yqu/cj1ViVLvEWCP6qMQ4efWUj6bQqOEA0V0U4= -github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/prometheus v0.0.0-20180315085919-58e2a31db8de/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= -github.com/prometheus/prometheus v1.8.2-0.20200107122003-4708915ac6ef/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI= -github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.14.3 h1:4EGfSkR2hJDB0s3oFfrlPqjU1e4WLncergLil3nEKW0= github.com/rs/zerolog v1.14.3/go.mod h1:3WXPzbXEEliJ+a6UFE4vhIxV8qR1EML6ngzP9ug4eYg= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= -github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/vfsgen v0.0.0-20180825020608-02ddb050ef6b/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= -github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 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/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 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/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= @@ -591,65 +428,50 @@ github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/thanos-io/thanos v0.10.1/go.mod h1:usT/TxtJQ7DzinTt+G9kinDQmRS5sxwu0unVKZ9vdcw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber/jaeger-client-go v2.20.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v0.0.0-20181209151446-772ced7fd4c2 h1:c3hsfAKt9dRzwckD9YqrACtMWPmjXSf+eocCfhoYdU8= +github.com/ugorji/go v0.0.0-20181209151446-772ced7fd4c2/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= 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/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go.elastic.co/apm v1.5.0/go.mod h1:OdB9sPtM6Vt7oz3VXt7+KR96i9li74qrxBGHTQygFvk= -go.elastic.co/apm/module/apmhttp v1.5.0/go.mod h1:1FbmNuyD3ddauwzgVwFB0fqY6KbZt3JkV187tGCYYhY= -go.elastic.co/apm/module/apmot v1.5.0/go.mod h1:d2KYwhJParTpyw2WnTNy8geNlHKKFX+4oK3YLlsesWE= -go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHtchs= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5/go.mod h1:skWido08r9w6Lq/w70DO5XYIKMu4QFu1+4VsqLQuJy8= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= -go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4= -golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -658,26 +480,22 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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-20181023162649-9b4f9f5ad519/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-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -690,24 +508,19 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/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-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 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.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -716,84 +529,59 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEha golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200930132711-30421366ff76 h1:JnxiSYT3Nm0BT2a8CyvYyM6cnrWpidecD1UuSYbhKm0= -golang.org/x/sync v0.0.0-20200930132711-30421366ff76/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190310054646-10058d7d4faa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056 h1:dHtDnRWQtSx0Hjq9kvKFpBh9uPPKfQN70NZZmvssGwk= -golang.org/x/sys v0.0.0-20191113165036-4c7a9d0fe056/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210223085322-b80eb88b80d2 h1:13AoIkn4ArHk7oLuacugPQZZRRxNXUSnuyNY4TVUJr8= -golang.org/x/sys v0.0.0-20210223085322-b80eb88b80d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -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-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/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-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/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-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc h1:N3zlSgxkefUH/ecsl37RWTkESTB026kmXzNly8TuZCI= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -801,40 +589,28 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190918214516-5a1a30219888/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191111182352-50fa39b762bc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2 h1:EtTFh6h4SAKemS+CURDMTDIANuduG5zKEXShyy18bGA= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200917132429-63098cc47d65 h1:pSBfdsmz/LD4Z+CedEf2tYuhDR+/nb77SHI1Ap7+WDQ= -golang.org/x/tools v0.0.0-20200917132429-63098cc47d65/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201005185003-576e169c3de7 h1:YTAUHYgZh/ZOA35/OrjTDmFFKb6ddkBL1Zgtl9r8Di8= -golang.org/x/tools v0.0.0-20201005185003-576e169c3de7/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 h1:HHeAlu5H9b71C+Fx0K+1dGgVFN1DM1/wz4aoGOA5qS8= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= 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= @@ -848,24 +624,28 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= 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= @@ -874,80 +654,64 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/fsnotify/fsnotify.v1 v1.4.7/go.mod h1:Fyux9zXlo4rWoMSIzpn9fDAYjalPqJ/K1qJ27s+7ltE= 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/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= 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.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= 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.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= 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= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.16.15 h1:6yvV9YNGwnebDAsA4Sfj+1b1S9j5OYfmckjTdc9b1bI= -k8s.io/api v0.16.15/go.mod h1:8z880CLtpCJqHWe9vmBkZMQeMKHNvdTQuqLW2QUefUA= -k8s.io/apiextensions-apiserver v0.16.15 h1:+tx3F9Yxrmt5iMZsoFOjICv4FF3rHCGkNbxC1nwfTko= -k8s.io/apiextensions-apiserver v0.16.15/go.mod h1:8L35Pijr64c590A9rmne7KCktA+DjovkbnuWcz9WDjA= -k8s.io/apimachinery v0.16.15 h1:4cmEfuRsKuV8pMpaQ6z0AKEUXZ3r+u/NKaz5dvIjySk= -k8s.io/apimachinery v0.16.15/go.mod h1:xAtIC8Gj83Pn2OCs2g57wZpZembRhJhiXIlQIqanwas= -k8s.io/apiserver v0.16.15/go.mod h1:0tAQf1+cDOwK9m9it6jo1HydLjZJp74e8U4SI1sTSME= -k8s.io/client-go v0.16.15 h1:cuSmM5begnN77V0beNgmhQ9yob6TFUnN+YaqAfRBD40= -k8s.io/client-go v0.16.15/go.mod h1:onpbkg9XeonG579HOlK9RS56ixfOJdbBM5dKluyFM8c= -k8s.io/code-generator v0.16.15/go.mod h1:J2H4yLa80/c3JcoMtjfRQ/cqZNWeJnNhrCtedYrPJ+k= -k8s.io/code-generator v0.17.3/go.mod h1:l8BLVwASXQZTo2xamW5mQNFCe1XPiAesVq7Y1t7PiQQ= -k8s.io/component-base v0.16.15/go.mod h1:KV1nlaKpvS7LmzugCfL8ss3gZV0glkODyJdYNJNB5CM= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= +k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= +k8s.io/apiextensions-apiserver v0.19.8 h1:3Vb4N/QUoUmD5l+qB/N4rS1q+miNBOyFGf2U1iNuas0= +k8s.io/apiextensions-apiserver v0.19.8/go.mod h1:NX3bMN7hJgtV2ViTgEySaZElHdrqyF9vw8EpkQTmqD0= +k8s.io/apimachinery v0.19.8 h1:MaehcNcx8brsgvMsqspcI0bi22E1np/DACnjf2mhJ5A= +k8s.io/apimachinery v0.19.8/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= +k8s.io/apiserver v0.19.8/go.mod h1:+OJE9rJCT99Qr9DYITQDCKDLxFLVi5zA8nI9KqjGshk= +k8s.io/client-go v0.19.8 h1:rcb2BrXb1HUBiBCoP3m/9Q2VZIMWhZUAmH49EmAyRUA= +k8s.io/client-go v0.19.8/go.mod h1:5Op2bSbK+COBz8mwH62rrRgqhA9wOcORkWZ03+GL0Ow= +k8s.io/component-base v0.19.8/go.mod h1:cvHAT4oGxKsfcnnm0hMp3JkEMxAt5s6le943V796FXM= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 h1:PsbYeEz2x7ll6JYUzBEG+DT78910DDTlvn5Ma10F5/E= -k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= -k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v1.0.2/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/lifecycle.go b/lifecycle.go index 1b02c355c..627d4c98d 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -23,6 +23,7 @@ package main import ( + "context" "io" "os" "path/filepath" @@ -90,7 +91,7 @@ func cmdLifecyclePreStopRun(cmd *cobra.Command, args []string) { pods := kubecli.CoreV1().Pods(namespace) recentErrors := 0 for { - p, err := pods.Get(name, metav1.GetOptions{}) + p, err := pods.Get(context.Background(), name, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { cliLog.Warn().Msg("Pod not found") return diff --git a/main.go b/main.go index faf4fc3a7..de07c800b 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ package main import ( + "context" goflag "flag" "fmt" "net" @@ -345,7 +346,7 @@ func newOperatorConfigAndDeps(id, namespace, name string) (operator.Config, oper func getMyPodInfo(kubecli kubernetes.Interface, namespace, name string) (string, string, error) { var image, sa string op := func() error { - pod, err := kubecli.CoreV1().Pods(namespace).Get(name, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(namespace).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { cliLog.Error(). Err(err). diff --git a/pkg/backup/handlers/arango/backup/backup_suite_test.go b/pkg/backup/handlers/arango/backup/backup_suite_test.go index bc6324daf..2296bc989 100644 --- a/pkg/backup/handlers/arango/backup/backup_suite_test.go +++ b/pkg/backup/handlers/arango/backup/backup_suite_test.go @@ -23,6 +23,7 @@ package backup import ( + "context" "fmt" "testing" @@ -133,13 +134,13 @@ func newArangoBackup(objectRef, namespace, name string, state state.State) *back func createArangoBackup(t *testing.T, h *handler, backups ...*backupApi.ArangoBackup) { for _, backup := range backups { - _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Create(backup) + _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Create(context.Background(), backup, meta.CreateOptions{}) require.NoError(t, err) } } func refreshArangoBackup(t *testing.T, h *handler, backup *backupApi.ArangoBackup) *backupApi.ArangoBackup { - obj, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Get(backup.Name, meta.GetOptions{}) + obj, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Get(context.Background(), backup.Name, meta.GetOptions{}) require.NoError(t, err) return obj } @@ -165,7 +166,7 @@ func newArangoDeployment(namespace, name string) *database.ArangoDeployment { func createArangoDeployment(t *testing.T, h *handler, deployments ...*database.ArangoDeployment) { for _, deployment := range deployments { - _, err := h.client.DatabaseV1().ArangoDeployments(deployment.Namespace).Create(deployment) + _, err := h.client.DatabaseV1().ArangoDeployments(deployment.Namespace).Create(context.Background(), deployment, meta.CreateOptions{}) require.NoError(t, err) } } diff --git a/pkg/backup/handlers/arango/backup/finalizer.go b/pkg/backup/handlers/arango/backup/finalizer.go index 52fea9898..5e55b948a 100644 --- a/pkg/backup/handlers/arango/backup/finalizer.go +++ b/pkg/backup/handlers/arango/backup/finalizer.go @@ -23,6 +23,8 @@ package backup import ( + "context" + "github.com/arangodb/go-driver" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" "github.com/arangodb/kube-arangodb/pkg/backup/utils" @@ -61,7 +63,7 @@ func (h *handler) finalize(backup *backupApi.ArangoBackup) error { i) } - if _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Update(backup); err != nil { + if _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Update(context.Background(), backup, meta.UpdateOptions{}); err != nil { return err } @@ -94,7 +96,7 @@ func (h *handler) finalizeBackup(backup *backupApi.ArangoBackup) error { return err } - backups, err := h.client.BackupV1().ArangoBackups(backup.Namespace).List(meta.ListOptions{}) + backups, err := h.client.BackupV1().ArangoBackups(backup.Namespace).List(context.Background(), meta.ListOptions{}) if err != nil { return err } diff --git a/pkg/backup/handlers/arango/backup/handler.go b/pkg/backup/handlers/arango/backup/handler.go index ed43d122e..e6840dca8 100644 --- a/pkg/backup/handlers/arango/backup/handler.go +++ b/pkg/backup/handlers/arango/backup/handler.go @@ -23,6 +23,7 @@ package backup import ( + "context" "fmt" "sync" "time" @@ -103,7 +104,7 @@ func (h *handler) start(stopCh <-chan struct{}) { } func (h *handler) refresh() error { - deployments, err := h.client.DatabaseV1().ArangoDeployments(h.operator.Namespace()).List(meta.ListOptions{}) + deployments, err := h.client.DatabaseV1().ArangoDeployments(h.operator.Namespace()).List(context.Background(), meta.ListOptions{}) if err != nil { return err } @@ -127,7 +128,7 @@ func (h *handler) refreshDeployment(deployment *database.ArangoDeployment) error return err } - backups, err := h.client.BackupV1().ArangoBackups(deployment.Namespace).List(meta.ListOptions{}) + backups, err := h.client.BackupV1().ArangoBackups(deployment.Namespace).List(context.Background(), meta.ListOptions{}) if err != nil { return err } @@ -176,7 +177,7 @@ func (h *handler) refreshDeploymentBackup(deployment *database.ArangoDeployment, }, } - _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Create(backup) + _, err := h.client.BackupV1().ArangoBackups(backup.Namespace).Create(context.Background(), backup, meta.CreateOptions{}) if err != nil { return err } @@ -202,14 +203,14 @@ func (h *handler) Name() string { func (h *handler) updateBackupStatus(b *backupApi.ArangoBackup) error { return utils.Retry(retryCount, retryDelay, func() error { - backup, err := h.client.BackupV1().ArangoBackups(b.Namespace).Get(b.Name, meta.GetOptions{}) + backup, err := h.client.BackupV1().ArangoBackups(b.Namespace).Get(context.Background(), b.Name, meta.GetOptions{}) if err != nil { return err } backup.Status = b.Status - _, err = h.client.BackupV1().ArangoBackups(b.Namespace).UpdateStatus(backup) + _, err = h.client.BackupV1().ArangoBackups(b.Namespace).UpdateStatus(context.Background(), backup, meta.UpdateOptions{}) return err }) } @@ -233,7 +234,7 @@ func (h *handler) getDeploymentMutex(namespace, deployment string) *sync.Mutex { func (h *handler) Handle(item operation.Item) error { // Get Backup object. It also cover NotFound case - b, err := h.client.BackupV1().ArangoBackups(item.Namespace).Get(item.Name, meta.GetOptions{}) + b, err := h.client.BackupV1().ArangoBackups(item.Namespace).Get(context.Background(), item.Name, meta.GetOptions{}) if err != nil { if apiErrors.IsNotFound(err) { return nil @@ -260,7 +261,7 @@ func (h *handler) Handle(item operation.Item) error { item.Namespace, item.Name) - if _, err = h.client.BackupV1().ArangoBackups(item.Namespace).Update(b); err != nil { + if _, err = h.client.BackupV1().ArangoBackups(item.Namespace).Update(context.Background(), b, meta.UpdateOptions{}); err != nil { return err } @@ -274,18 +275,18 @@ func (h *handler) Handle(item operation.Item) error { // Add owner reference if b.OwnerReferences == nil || len(b.OwnerReferences) == 0 { - deployment, err := h.client.DatabaseV1().ArangoDeployments(b.Namespace).Get(b.Spec.Deployment.Name, meta.GetOptions{}) + deployment, err := h.client.DatabaseV1().ArangoDeployments(b.Namespace).Get(context.Background(), b.Spec.Deployment.Name, meta.GetOptions{}) if err == nil { b.OwnerReferences = []meta.OwnerReference{ deployment.AsOwner(), } - if _, err = h.client.BackupV1().ArangoBackups(item.Namespace).Update(b); err != nil { + if _, err = h.client.BackupV1().ArangoBackups(item.Namespace).Update(context.Background(), b, meta.UpdateOptions{}); err != nil { return err } } - b, err = h.client.BackupV1().ArangoBackups(item.Namespace).Get(item.Name, meta.GetOptions{}) + b, err = h.client.BackupV1().ArangoBackups(item.Namespace).Get(context.Background(), item.Name, meta.GetOptions{}) if err != nil { if apiErrors.IsNotFound(err) { return nil @@ -388,7 +389,7 @@ func (h *handler) getArangoDeploymentObject(backup *backupApi.ArangoBackup) (*da return nil, newFatalErrorf("deployment ref is not specified for backup %s/%s", backup.Namespace, backup.Name) } - obj, err := h.client.DatabaseV1().ArangoDeployments(backup.Namespace).Get(backup.Spec.Deployment.Name, meta.GetOptions{}) + obj, err := h.client.DatabaseV1().ArangoDeployments(backup.Namespace).Get(context.Background(), backup.Spec.Deployment.Name, meta.GetOptions{}) if err == nil { return obj, nil } diff --git a/pkg/backup/handlers/arango/backup/lifecycle.go b/pkg/backup/handlers/arango/backup/lifecycle.go index aaa925af4..88fa07d06 100644 --- a/pkg/backup/handlers/arango/backup/lifecycle.go +++ b/pkg/backup/handlers/arango/backup/lifecycle.go @@ -23,6 +23,7 @@ package backup import ( + "context" "time" "github.com/arangodb/kube-arangodb/pkg/apis/backup" @@ -44,7 +45,7 @@ func (h *handler) LifecyclePreStart() error { }() for { - _, err := h.client.BackupV1().ArangoBackups(h.operator.Namespace()).List(meta.ListOptions{}) + _, err := h.client.BackupV1().ArangoBackups(h.operator.Namespace()).List(context.Background(), meta.ListOptions{}) if err != nil { log.Warn().Err(err).Msgf("CR for %s not found", backup.ArangoBackupResourceKind) diff --git a/pkg/backup/handlers/arango/backup/util.go b/pkg/backup/handlers/arango/backup/util.go index f86f53fe6..cb574b770 100644 --- a/pkg/backup/handlers/arango/backup/util.go +++ b/pkg/backup/handlers/arango/backup/util.go @@ -23,6 +23,7 @@ package backup import ( + "context" "strings" clientBackup "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/backup/v1" @@ -55,7 +56,7 @@ func inProgress(backup *backupApi.ArangoBackup) bool { } func isBackupRunning(backup *backupApi.ArangoBackup, client clientBackup.ArangoBackupInterface) (bool, error) { - backups, err := client.List(meta.ListOptions{}) + backups, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return false, newTemporaryError(err) diff --git a/pkg/backup/handlers/arango/policy/handler.go b/pkg/backup/handlers/arango/policy/handler.go index 8f2ed7522..c304932b0 100644 --- a/pkg/backup/handlers/arango/policy/handler.go +++ b/pkg/backup/handlers/arango/policy/handler.go @@ -23,6 +23,7 @@ package policy import ( + "context" "fmt" "reflect" "time" @@ -68,7 +69,7 @@ func (h *handler) Handle(item operation.Item) error { } // Get Backup object. It also cover NotFound case - policy, err := h.client.BackupV1().ArangoBackupPolicies(item.Namespace).Get(item.Name, meta.GetOptions{}) + policy, err := h.client.BackupV1().ArangoBackupPolicies(item.Namespace).Get(context.Background(), item.Name, meta.GetOptions{}) if err != nil { return err } @@ -86,7 +87,7 @@ func (h *handler) Handle(item operation.Item) error { policy.Status = status // Update status on object - if _, err = h.client.BackupV1().ArangoBackupPolicies(item.Namespace).UpdateStatus(policy); err != nil { + if _, err = h.client.BackupV1().ArangoBackupPolicies(item.Namespace).UpdateStatus(context.Background(), policy, meta.UpdateOptions{}); err != nil { return err } @@ -150,7 +151,7 @@ func (h *handler) processBackupPolicy(policy *backupApi.ArangoBackupPolicy) (bac listOptions.LabelSelector = meta.FormatLabelSelector(policy.Spec.DeploymentSelector) } - deployments, err := h.client.DatabaseV1().ArangoDeployments(policy.Namespace).List(listOptions) + deployments, err := h.client.DatabaseV1().ArangoDeployments(policy.Namespace).List(context.Background(), listOptions) if err != nil { h.eventRecorder.Warning(policy, policyError, "Policy Error: %s", err.Error()) @@ -164,7 +165,7 @@ func (h *handler) processBackupPolicy(policy *backupApi.ArangoBackupPolicy) (bac for _, deployment := range deployments.Items { b := policy.NewBackup(deployment.DeepCopy()) - if _, err := h.client.BackupV1().ArangoBackups(b.Namespace).Create(b); err != nil { + if _, err := h.client.BackupV1().ArangoBackups(b.Namespace).Create(context.Background(), b, meta.CreateOptions{}); err != nil { h.eventRecorder.Warning(policy, policyError, "Policy Error: %s", err.Error()) return backupApi.ArangoBackupPolicyStatus{ diff --git a/pkg/backup/handlers/arango/policy/handler_suite_test.go b/pkg/backup/handlers/arango/policy/handler_suite_test.go index 00a06fbfa..8c3c41f72 100644 --- a/pkg/backup/handlers/arango/policy/handler_suite_test.go +++ b/pkg/backup/handlers/arango/policy/handler_suite_test.go @@ -23,6 +23,7 @@ package policy import ( + "context" "fmt" "testing" @@ -99,7 +100,7 @@ func newArangoBackupPolicy(schedule, namespace, name string, selector map[string } func refreshArangoBackupPolicy(t *testing.T, h *handler, policy *backupApi.ArangoBackupPolicy) *backupApi.ArangoBackupPolicy { - newPolicy, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Get(policy.Name, meta.GetOptions{}) + newPolicy, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Get(context.Background(), policy.Name, meta.GetOptions{}) require.NoError(t, err) return newPolicy @@ -107,14 +108,14 @@ func refreshArangoBackupPolicy(t *testing.T, h *handler, policy *backupApi.Arang func createArangoBackupPolicy(t *testing.T, h *handler, policies ...*backupApi.ArangoBackupPolicy) { for _, policy := range policies { - _, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Create(policy) + _, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Create(context.Background(), policy, meta.CreateOptions{}) require.NoError(t, err) } } func updateArangoBackupPolicy(t *testing.T, h *handler, policies ...*backupApi.ArangoBackupPolicy) { for _, policy := range policies { - _, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Update(policy) + _, err := h.client.BackupV1().ArangoBackupPolicies(policy.Namespace).Update(context.Background(), policy, meta.UpdateOptions{}) require.NoError(t, err) } } @@ -142,13 +143,13 @@ func newArangoDeployment(namespace string, labels map[string]string) *database.A func createArangoDeployment(t *testing.T, h *handler, deployments ...*database.ArangoDeployment) { for _, deployment := range deployments { - _, err := h.client.DatabaseV1().ArangoDeployments(deployment.Namespace).Create(deployment) + _, err := h.client.DatabaseV1().ArangoDeployments(deployment.Namespace).Create(context.Background(), deployment, meta.CreateOptions{}) require.NoError(t, err) } } func listArangoBackups(t *testing.T, handler *handler, namespace string) []backupApi.ArangoBackup { - result, err := handler.client.BackupV1().ArangoBackups(namespace).List(meta.ListOptions{}) + result, err := handler.client.BackupV1().ArangoBackups(namespace).List(context.Background(), meta.ListOptions{}) require.NoError(t, err) return result.Items diff --git a/pkg/backup/handlers/arango/policy/lifecycle.go b/pkg/backup/handlers/arango/policy/lifecycle.go index 7873e7903..1800f3107 100644 --- a/pkg/backup/handlers/arango/policy/lifecycle.go +++ b/pkg/backup/handlers/arango/policy/lifecycle.go @@ -23,6 +23,7 @@ package policy import ( + "context" "time" "github.com/arangodb/kube-arangodb/pkg/apis/backup" @@ -44,7 +45,7 @@ func (h *handler) LifecyclePreStart() error { }() for { - _, err := h.client.BackupV1().ArangoBackupPolicies(h.operator.Namespace()).List(meta.ListOptions{}) + _, err := h.client.BackupV1().ArangoBackupPolicies(h.operator.Namespace()).List(context.Background(), meta.ListOptions{}) if err != nil { log.Warn().Err(err).Msgf("CR for %s not found", backup.ArangoBackupPolicyResourceKind) diff --git a/pkg/backup/operator/event/event.go b/pkg/backup/operator/event/event.go index c9b646d6f..3f4951330 100644 --- a/pkg/backup/operator/event/event.go +++ b/pkg/backup/operator/event/event.go @@ -23,6 +23,7 @@ package event import ( + "context" "fmt" "github.com/rs/zerolog/log" @@ -87,7 +88,7 @@ func (e *eventRecorder) newObjectReference(group, version, kind string, object m } func (e *eventRecorder) event(group, version, kind string, object meta.Object, eventType, reason, message string) { - _, err := e.kubeClientSet.CoreV1().Events(object.GetNamespace()).Create(e.newEvent(group, version, kind, object, eventType, reason, message)) + _, err := e.kubeClientSet.CoreV1().Events(object.GetNamespace()).Create(context.Background(), e.newEvent(group, version, kind, object, eventType, reason, message), meta.CreateOptions{}) if err != nil { log.Warn().Err(err). Str("APIVersion", fmt.Sprintf("%s/%s", group, version)). diff --git a/pkg/backup/operator/event/event_test.go b/pkg/backup/operator/event/event_test.go index 48288ece5..adc8e4e4f 100644 --- a/pkg/backup/operator/event/event_test.go +++ b/pkg/backup/operator/event/event_test.go @@ -23,6 +23,7 @@ package event import ( + "context" "fmt" "testing" @@ -70,7 +71,7 @@ func Test_Event_Handler(t *testing.T) { call(p, reason, message) // Assert - events, err := c.CoreV1().Events(namespace).List(meta.ListOptions{}) + events, err := c.CoreV1().Events(namespace).List(context.Background(), meta.ListOptions{}) require.NoError(t, err) require.Len(t, events.Items, 1) @@ -85,7 +86,7 @@ func Test_Event_Handler(t *testing.T) { assert.Equal(t, namespace, event.InvolvedObject.Namespace) assert.Equal(t, name, event.InvolvedObject.Name) - require.NoError(t, c.CoreV1().Events(namespace).Delete(event.Name, &meta.DeleteOptions{})) + require.NoError(t, c.CoreV1().Events(namespace).Delete(context.Background(), event.Name, meta.DeleteOptions{})) }) } } diff --git a/pkg/backup/operator/operator_test.go b/pkg/backup/operator/operator_test.go index 72a25696b..28db0bfb2 100644 --- a/pkg/backup/operator/operator_test.go +++ b/pkg/backup/operator/operator_test.go @@ -23,6 +23,7 @@ package operator import ( + "context" "time" "github.com/arangodb/kube-arangodb/pkg/backup/operator/operation" @@ -65,7 +66,7 @@ func Test_Operator_InformerProcessing(t *testing.T) { require.NoError(t, o.Start(4, stopCh)) for _, name := range objects { - _, err := client.CoreV1().Pods("test").Create(&core.Pod{ + _, err := client.CoreV1().Pods("test").Create(context.Background(), &core.Pod{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Pod", @@ -73,7 +74,7 @@ func Test_Operator_InformerProcessing(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) } @@ -115,7 +116,7 @@ func Test_Operator_MultipleInformers(t *testing.T) { require.NoError(t, o.Start(4, stopCh)) for _, name := range objects { - _, err := client.CoreV1().Pods("test").Create(&core.Pod{ + _, err := client.CoreV1().Pods("test").Create(context.Background(), &core.Pod{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Pod", @@ -123,10 +124,10 @@ func Test_Operator_MultipleInformers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) - _, err = client.CoreV1().Nodes().Create(&core.Node{ + _, err = client.CoreV1().Nodes().Create(context.Background(), &core.Node{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Node", @@ -134,7 +135,7 @@ func Test_Operator_MultipleInformers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) } @@ -175,7 +176,7 @@ func Test_Operator_MultipleInformers_IgnoredTypes(t *testing.T) { require.NoError(t, o.Start(4, stopCh)) for _, name := range objects { - _, err := client.CoreV1().Pods("test").Create(&core.Pod{ + _, err := client.CoreV1().Pods("test").Create(context.Background(), &core.Pod{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Pod", @@ -183,10 +184,10 @@ func Test_Operator_MultipleInformers_IgnoredTypes(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) - _, err = client.CoreV1().Nodes().Create(&core.Node{ + _, err = client.CoreV1().Nodes().Create(context.Background(), &core.Node{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Node", @@ -194,7 +195,7 @@ func Test_Operator_MultipleInformers_IgnoredTypes(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) } @@ -253,7 +254,7 @@ func Test_Operator_MultipleInformers_MultipleHandlers(t *testing.T) { require.NoError(t, o.Start(4, stopCh)) for _, name := range objects { - _, err := client.CoreV1().Pods("test").Create(&core.Pod{ + _, err := client.CoreV1().Pods("test").Create(context.Background(), &core.Pod{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Pod", @@ -261,10 +262,10 @@ func Test_Operator_MultipleInformers_MultipleHandlers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) - _, err = client.CoreV1().Nodes().Create(&core.Node{ + _, err = client.CoreV1().Nodes().Create(context.Background(), &core.Node{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Node", @@ -272,10 +273,10 @@ func Test_Operator_MultipleInformers_MultipleHandlers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) - _, err = client.CoreV1().Services("test").Create(&core.Service{ + _, err = client.CoreV1().Services("test").Create(context.Background(), &core.Service{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Service", @@ -283,10 +284,10 @@ func Test_Operator_MultipleInformers_MultipleHandlers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) - _, err = client.CoreV1().ServiceAccounts("test").Create(&core.ServiceAccount{ + _, err = client.CoreV1().ServiceAccounts("test").Create(context.Background(), &core.ServiceAccount{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "ServiceAccount", @@ -294,7 +295,7 @@ func Test_Operator_MultipleInformers_MultipleHandlers(t *testing.T) { ObjectMeta: meta.ObjectMeta{ Name: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) } @@ -343,7 +344,7 @@ func Test_Operator_InformerProcessing_Namespaced(t *testing.T) { require.NoError(t, o.Start(4, stopCh)) for _, name := range objects { - _, err := client.CoreV1().Pods(name).Create(&core.Pod{ + _, err := client.CoreV1().Pods(name).Create(context.Background(), &core.Pod{ TypeMeta: meta.TypeMeta{ APIVersion: "v1", Kind: "Pod", @@ -352,7 +353,7 @@ func Test_Operator_InformerProcessing_Namespaced(t *testing.T) { Name: name, Namespace: name, }, - }) + }, meta.CreateOptions{}) require.NoError(t, err) } diff --git a/pkg/deployment/access_package.go b/pkg/deployment/access_package.go index bc03f40e1..43c77056c 100644 --- a/pkg/deployment/access_package.go +++ b/pkg/deployment/access_package.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "strings" "time" @@ -65,7 +66,7 @@ func (d *Deployment) createAccessPackages() error { } // Remove all access packages that we did build, but are no longer needed - secretList, err := secrets.List(metav1.ListOptions{}) + secretList, err := secrets.List(context.Background(), metav1.ListOptions{}) if err != nil { log.Debug().Err(err).Msg("Failed to list secrets") return errors.WithStack(err) @@ -76,7 +77,7 @@ func (d *Deployment) createAccessPackages() error { // Secret is an access package if _, wanted := apNameMap[secret.GetName()]; !wanted { // We found an obsolete access package secret. Remove it. - if err := secrets.Delete(secret.GetName(), &metav1.DeleteOptions{ + if err := secrets.Delete(context.Background(), secret.GetName(), metav1.DeleteOptions{ Preconditions: &metav1.Preconditions{UID: &secret.UID}, }); err != nil && !k8sutil.IsNotFound(err) { // Not serious enough to stop everything now, just log and create an event @@ -103,7 +104,7 @@ func (d *Deployment) ensureAccessPackage(apSecretName string) error { secrets := d.deps.KubeCli.CoreV1().Secrets(ns) spec := d.apiObject.Spec - if _, err := secrets.Get(apSecretName, metav1.GetOptions{}); err == nil { + if _, err := secrets.Get(context.Background(), apSecretName, metav1.GetOptions{}); err == nil { // Secret already exists return nil } @@ -204,7 +205,7 @@ func (d *Deployment) ensureAccessPackage(apSecretName string) error { } // Attach secret to owner secret.SetOwnerReferences(append(secret.GetOwnerReferences(), d.apiObject.AsOwner())) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, metav1.CreateOptions{}); err != nil { // Failed to create secret log.Debug().Err(err).Str("secret-name", apSecretName).Msg("Failed to create access package Secret") return errors.WithStack(err) diff --git a/pkg/deployment/cleanup.go b/pkg/deployment/cleanup.go index 1d7cdd012..86472357f 100644 --- a/pkg/deployment/cleanup.go +++ b/pkg/deployment/cleanup.go @@ -23,6 +23,8 @@ package deployment import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/deployment/resources/inspector" "github.com/arangodb/kube-arangodb/pkg/util" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil" @@ -42,7 +44,7 @@ func (d *Deployment) removePodFinalizers(cachedStatus inspectorInterface.Inspect return err } - if err := kubecli.CoreV1().Pods(pod.GetNamespace()).Delete(pod.GetName(), &meta.DeleteOptions{ + if err := kubecli.CoreV1().Pods(pod.GetNamespace()).Delete(context.Background(), pod.GetName(), meta.DeleteOptions{ GracePeriodSeconds: util.NewInt64(1), }); err != nil { if !k8sutil.IsNotFound(err) { diff --git a/pkg/deployment/cluster_scaling_integration.go b/pkg/deployment/cluster_scaling_integration.go index ca4961a36..42b3e2a89 100644 --- a/pkg/deployment/cluster_scaling_integration.go +++ b/pkg/deployment/cluster_scaling_integration.go @@ -191,7 +191,7 @@ func (ci *clusterScalingIntegration) inspectCluster(ctx context.Context, expectS } // Let's update the spec apiObject := ci.depl.apiObject - current, err := ci.depl.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(apiObject.Namespace).Get(apiObject.Name, metav1.GetOptions{}) + current, err := ci.depl.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(apiObject.Namespace).Get(context.Background(), apiObject.Name, metav1.GetOptions{}) if err != nil { return errors.WithStack(err) } diff --git a/pkg/deployment/context_impl.go b/pkg/deployment/context_impl.go index 34105ff53..21ba96f6c 100644 --- a/pkg/deployment/context_impl.go +++ b/pkg/deployment/context_impl.go @@ -40,7 +40,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/operator/scope" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "github.com/arangodb/kube-arangodb/pkg/deployment/features" @@ -68,7 +68,7 @@ import ( // GetBackup receives information about a backup resource func (d *Deployment) GetBackup(backup string) (*backupApi.ArangoBackup, error) { - return d.deps.DatabaseCRCli.BackupV1().ArangoBackups(d.Namespace()).Get(backup, meta.GetOptions{}) + return d.deps.DatabaseCRCli.BackupV1().ArangoBackups(d.Namespace()).Get(context.Background(), backup, meta.GetOptions{}) } // GetAPIObject returns the deployment as k8s object. @@ -276,7 +276,7 @@ func (d *Deployment) getAuth() (driver.Authentication, error) { var secret string if i := d.apiObject.Status.CurrentImage; i == nil || !features.JWTRotation().Supported(i.ArangoDBVersion, i.Enterprise) { - s, err := secrets.Get(d.apiObject.Spec.Authentication.GetJWTSecretName(), meta.GetOptions{}) + s, err := secrets.Get(context.Background(), d.apiObject.Spec.Authentication.GetJWTSecretName(), meta.GetOptions{}) if err != nil { return nil, errors.Newf("JWT Secret is missing") } @@ -288,7 +288,7 @@ func (d *Deployment) getAuth() (driver.Authentication, error) { secret = string(jwt) } else { - s, err := secrets.Get(pod.JWTSecretFolder(d.apiObject.GetName()), meta.GetOptions{}) + s, err := secrets.Get(context.Background(), pod.JWTSecretFolder(d.apiObject.GetName()), meta.GetOptions{}) if err != nil { d.deps.Log.Error().Err(err).Msgf("Unable to get secret") return nil, errors.Newf("JWT Folder Secret is missing") @@ -379,7 +379,7 @@ func (d *Deployment) CreateMember(group api.ServerGroup, id string) (string, err func (d *Deployment) DeletePod(podName string) error { log := d.deps.Log ns := d.apiObject.GetNamespace() - if err := d.deps.KubeCli.CoreV1().Pods(ns).Delete(podName, &meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := d.deps.KubeCli.CoreV1().Pods(ns).Delete(context.Background(), podName, meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Debug().Err(err).Str("pod", podName).Msg("Failed to remove pod") return errors.WithStack(err) } @@ -394,7 +394,7 @@ func (d *Deployment) CleanupPod(p *v1.Pod) error { ns := p.GetNamespace() options := meta.NewDeleteOptions(0) options.Preconditions = meta.NewUIDPreconditions(string(p.GetUID())) - if err := d.deps.KubeCli.CoreV1().Pods(ns).Delete(podName, options); err != nil && !k8sutil.IsNotFound(err) { + if err := d.deps.KubeCli.CoreV1().Pods(ns).Delete(context.Background(), podName, *options); err != nil && !k8sutil.IsNotFound(err) { log.Debug().Err(err).Str("pod", podName).Msg("Failed to cleanup pod") return errors.WithStack(err) } @@ -407,7 +407,7 @@ func (d *Deployment) RemovePodFinalizers(podName string) error { log := d.deps.Log ns := d.GetNamespace() kubecli := d.deps.KubeCli - p, err := kubecli.CoreV1().Pods(ns).Get(podName, meta.GetOptions{}) + p, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), podName, meta.GetOptions{}) if err != nil { if k8sutil.IsNotFound(err) { return nil @@ -425,7 +425,7 @@ func (d *Deployment) RemovePodFinalizers(podName string) error { func (d *Deployment) DeletePvc(pvcName string) error { log := d.deps.Log ns := d.apiObject.GetNamespace() - if err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(ns).Delete(pvcName, &meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(ns).Delete(context.Background(), pvcName, meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Debug().Err(err).Str("pvc", pvcName).Msg("Failed to remove pvc") return errors.WithStack(err) } @@ -435,7 +435,7 @@ func (d *Deployment) DeletePvc(pvcName string) error { // UpdatePvc updated a persistent volume claim in the namespace // of the deployment. If the pvc does not exist, the error is ignored. func (d *Deployment) UpdatePvc(pvc *v1.PersistentVolumeClaim) error { - _, err := d.GetKubeCli().CoreV1().PersistentVolumeClaims(d.GetNamespace()).Update(pvc) + _, err := d.GetKubeCli().CoreV1().PersistentVolumeClaims(d.GetNamespace()).Update(context.Background(), pvc, meta.UpdateOptions{}) if err == nil { return nil } @@ -451,7 +451,7 @@ func (d *Deployment) UpdatePvc(pvc *v1.PersistentVolumeClaim) error { func (d *Deployment) GetOwnedPVCs() ([]v1.PersistentVolumeClaim, error) { // Get all current PVCs log := d.deps.Log - pvcs, err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(d.apiObject.GetNamespace()).List(k8sutil.DeploymentListOpt(d.apiObject.GetName())) + pvcs, err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(d.apiObject.GetNamespace()).List(context.Background(), k8sutil.DeploymentListOpt(d.apiObject.GetName())) if err != nil { log.Debug().Err(err).Msg("Failed to list PVCs") return nil, errors.WithStack(err) @@ -467,7 +467,7 @@ func (d *Deployment) GetOwnedPVCs() ([]v1.PersistentVolumeClaim, error) { // GetPvc gets a PVC by the given name, in the samespace of the deployment. func (d *Deployment) GetPvc(pvcName string) (*v1.PersistentVolumeClaim, error) { - pvc, err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(d.apiObject.GetNamespace()).Get(pvcName, meta.GetOptions{}) + pvc, err := d.deps.KubeCli.CoreV1().PersistentVolumeClaims(d.apiObject.GetNamespace()).Get(context.Background(), pvcName, meta.GetOptions{}) if err != nil { log.Debug().Err(err).Str("pvc-name", pvcName).Msg("Failed to get PVC") return nil, errors.WithStack(err) @@ -493,7 +493,7 @@ func (d *Deployment) GetTLSKeyfile(group api.ServerGroup, member api.MemberStatu func (d *Deployment) DeleteTLSKeyfile(group api.ServerGroup, member api.MemberStatus) error { secretName := k8sutil.CreateTLSKeyfileSecretName(d.apiObject.GetName(), group.AsRole(), member.ID) ns := d.apiObject.GetNamespace() - if err := d.deps.KubeCli.CoreV1().Secrets(ns).Delete(secretName, &meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := d.deps.KubeCli.CoreV1().Secrets(ns).Delete(context.Background(), secretName, meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { return errors.WithStack(err) } return nil @@ -503,7 +503,7 @@ func (d *Deployment) DeleteTLSKeyfile(group api.ServerGroup, member api.MemberSt // If the secret does not exist, the error is ignored. func (d *Deployment) DeleteSecret(secretName string) error { ns := d.apiObject.GetNamespace() - if err := d.deps.KubeCli.CoreV1().Secrets(ns).Delete(secretName, &meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := d.deps.KubeCli.CoreV1().Secrets(ns).Delete(context.Background(), secretName, meta.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { return errors.WithStack(err) } return nil @@ -581,7 +581,7 @@ func (d *Deployment) GetName() string { } func (d *Deployment) GetOwnedPods() ([]v1.Pod, error) { - pods, err := d.GetKubeCli().CoreV1().Pods(d.apiObject.GetNamespace()).List(meta.ListOptions{}) + pods, err := d.GetKubeCli().CoreV1().Pods(d.apiObject.GetNamespace()).List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index 1bb7a7bdc..7ae06a836 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -38,7 +38,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/operator/scope" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" @@ -302,7 +302,7 @@ func (d *Deployment) handleArangoDeploymentUpdatedEvent() error { log := d.deps.Log.With().Str("deployment", d.apiObject.GetName()).Logger() // Get the most recent version of the deployment from the API server - current, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.apiObject.GetNamespace()).Get(d.apiObject.GetName(), metav1.GetOptions{}) + current, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.apiObject.GetNamespace()).Get(context.Background(), d.apiObject.GetName(), metav1.GetOptions{}) if err != nil { log.Debug().Err(err).Msg("Failed to get current version of deployment from API server") if k8sutil.IsNotFound(err) { @@ -396,7 +396,7 @@ func (d *Deployment) updateCRStatus(force ...bool) error { if update.GetDeletionTimestamp() == nil { ensureFinalizers(update) } - newAPIObject, err := depls.Update(update) + newAPIObject, err := depls.Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object d.apiObject = newAPIObject @@ -406,7 +406,7 @@ func (d *Deployment) updateCRStatus(force ...bool) error { // API object may have been changed already, // Reload api object and try again var current *api.ArangoDeployment - current, err = depls.Get(update.GetName(), metav1.GetOptions{}) + current, err = depls.Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -440,7 +440,7 @@ func (d *Deployment) updateCRSpec(newSpec api.DeploymentSpec, force ...bool) err update.Spec = newSpec update.Status = d.status.last ns := d.apiObject.GetNamespace() - newAPIObject, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(ns).Update(update) + newAPIObject, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(ns).Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object d.apiObject = newAPIObject @@ -450,7 +450,7 @@ func (d *Deployment) updateCRSpec(newSpec api.DeploymentSpec, force ...bool) err // API object may have been changed already, // Reload api object and try again var current *api.ArangoDeployment - current, err = d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(ns).Get(update.GetName(), metav1.GetOptions{}) + current, err = d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -479,9 +479,9 @@ func (d *Deployment) isOwnerOf(obj metav1.Object) bool { func (d *Deployment) lookForServiceMonitorCRD() { var err error if d.GetScope().IsNamespaced() { - _, err = d.deps.KubeMonitoringCli.ServiceMonitors(d.GetNamespace()).List(metav1.ListOptions{}) + _, err = d.deps.KubeMonitoringCli.ServiceMonitors(d.GetNamespace()).List(context.Background(), metav1.ListOptions{}) } else { - _, err = d.deps.KubeExtCli.ApiextensionsV1beta1().CustomResourceDefinitions().Get("servicemonitors.monitoring.coreos.com", metav1.GetOptions{}) + _, err = d.deps.KubeExtCli.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.Background(), "servicemonitors.monitoring.coreos.com", metav1.GetOptions{}) } log := d.deps.Log log.Debug().Msgf("Looking for ServiceMonitor CRD...") @@ -530,7 +530,7 @@ func (d *Deployment) ApplyPatch(p ...patch.Item) error { c := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.apiObject.GetNamespace()) - depl, err := c.Patch(d.apiObject.GetName(), types.JSONPatchType, data) + depl, err := c.Patch(context.Background(), d.apiObject.GetName(), types.JSONPatchType, data, metav1.PatchOptions{}) if err != nil { return err } diff --git a/pkg/deployment/deployment_finalizers.go b/pkg/deployment/deployment_finalizers.go index 822a1dd19..62f4b84e6 100644 --- a/pkg/deployment/deployment_finalizers.go +++ b/pkg/deployment/deployment_finalizers.go @@ -56,7 +56,7 @@ func (d *Deployment) runDeploymentFinalizers(ctx context.Context, cachedStatus i var removalList []string depls := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.GetNamespace()) - updated, err := depls.Get(d.apiObject.GetName(), metav1.GetOptions{}) + updated, err := depls.Get(context.Background(), d.apiObject.GetName(), metav1.GetOptions{}) if err != nil { return errors.WithStack(err) } @@ -98,7 +98,7 @@ func (d *Deployment) inspectRemoveChildFinalizers(ctx context.Context, log zerol func removeDeploymentFinalizers(log zerolog.Logger, cli versioned.Interface, depl *api.ArangoDeployment, finalizers []string) error { depls := cli.DatabaseV1().ArangoDeployments(depl.GetNamespace()) getFunc := func() (metav1.Object, error) { - result, err := depls.Get(depl.GetName(), metav1.GetOptions{}) + result, err := depls.Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } @@ -106,7 +106,7 @@ func removeDeploymentFinalizers(log zerolog.Logger, cli versioned.Interface, dep } updateFunc := func(updated metav1.Object) error { updatedDepl := updated.(*api.ArangoDeployment) - result, err := depls.Update(updatedDepl) + result, err := depls.Update(context.Background(), updatedDepl, metav1.UpdateOptions{}) if err != nil { return errors.WithStack(err) } diff --git a/pkg/deployment/deployment_inspector.go b/pkg/deployment/deployment_inspector.go index 184fc707b..3f6e3ee72 100644 --- a/pkg/deployment/deployment_inspector.go +++ b/pkg/deployment/deployment_inspector.go @@ -76,7 +76,7 @@ func (d *Deployment) inspectDeployment(lastInterval util.Interval) util.Interval } // Check deployment still exists - updated, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.apiObject.GetNamespace()).Get(deploymentName, metav1.GetOptions{}) + updated, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(d.apiObject.GetNamespace()).Get(context.Background(), deploymentName, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { // Deployment is gone log.Info().Msg("Deployment is gone") diff --git a/pkg/deployment/deployment_pod_sync_test.go b/pkg/deployment/deployment_pod_sync_test.go index b4035dce4..5b3ed53bb 100644 --- a/pkg/deployment/deployment_pod_sync_test.go +++ b/pkg/deployment/deployment_pod_sync_test.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "testing" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -99,7 +100,7 @@ func TestEnsurePod_Sync_Error(t *testing.T) { } secretName := testCase.ArangoDeployment.Spec.Sync.Monitoring.GetTokenSecretName() - err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(secretName, &metav1.DeleteOptions{}) + err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(context.Background(), secretName, metav1.DeleteOptions{}) require.NoError(t, err) }, ExpectedError: errors.New("Monitoring token secret validation failed: secrets \"" + @@ -133,7 +134,7 @@ func TestEnsurePod_Sync_Master(t *testing.T) { } secretName := testCase.ArangoDeployment.Spec.Sync.TLS.GetCASecretName() - err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(secretName, &metav1.DeleteOptions{}) + err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(context.Background(), secretName, metav1.DeleteOptions{}) require.NoError(t, err) }, ExpectedError: errors.New("Failed to create TLS keyfile secret: secrets \"" + @@ -161,7 +162,7 @@ func TestEnsurePod_Sync_Master(t *testing.T) { } secretName := testCase.ArangoDeployment.Spec.Authentication.GetJWTSecretName() - err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(secretName, &metav1.DeleteOptions{}) + err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(context.Background(), secretName, metav1.DeleteOptions{}) require.NoError(t, err) }, ExpectedError: errors.New("Cluster JWT secret validation failed: secrets \"" + @@ -189,7 +190,7 @@ func TestEnsurePod_Sync_Master(t *testing.T) { } secretName := testCase.ArangoDeployment.Spec.Sync.Authentication.GetClientCASecretName() - err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(secretName, &metav1.DeleteOptions{}) + err := deployment.GetKubeCli().CoreV1().Secrets(testNamespace).Delete(context.Background(), secretName, metav1.DeleteOptions{}) require.NoError(t, err) }, ExpectedError: errors.New("Client authentication CA certificate secret validation failed: " + diff --git a/pkg/deployment/deployment_pod_tls_sni_test.go b/pkg/deployment/deployment_pod_tls_sni_test.go index 10c90137e..178e0990b 100644 --- a/pkg/deployment/deployment_pod_tls_sni_test.go +++ b/pkg/deployment/deployment_pod_tls_sni_test.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "fmt" "testing" @@ -51,7 +52,7 @@ func createTLSSNISecret(t *testing.T, client kubernetes.Interface, name, namespa secret.Data[key] = []byte(value) } - _, err := client.CoreV1().Secrets(namespace).Create(&secret) + _, err := client.CoreV1().Secrets(namespace).Create(context.Background(), &secret, meta.CreateOptions{}) require.NoError(t, err) } diff --git a/pkg/deployment/deployment_run_test.go b/pkg/deployment/deployment_run_test.go index 4c98f98f2..f205b0c9a 100644 --- a/pkg/deployment/deployment_run_test.go +++ b/pkg/deployment/deployment_run_test.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "encoding/json" "fmt" "testing" @@ -88,7 +89,7 @@ func runTestCase(t *testing.T, testCase testCaseStruct) { } // Create custom resource in the fake kubernetes API - _, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(testNamespace).Create(d.apiObject) + _, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(testNamespace).Create(context.Background(), d.apiObject, metav1.CreateOptions{}) require.NoError(t, err) if testCase.Resources != nil { @@ -110,7 +111,7 @@ func runTestCase(t *testing.T, testCase testCaseStruct) { } c := d.GetArangoCli() - if _, err := c.DatabaseV1().ArangoMembers(member.GetNamespace()).Create(&member); err != nil { + if _, err := c.DatabaseV1().ArangoMembers(member.GetNamespace()).Create(context.Background(), &member, metav1.CreateOptions{}); err != nil { return err } @@ -122,7 +123,7 @@ func runTestCase(t *testing.T, testCase testCaseStruct) { } k := d.GetKubeCli() - if _, err := k.CoreV1().Services(member.GetNamespace()).Create(&s); err != nil { + if _, err := k.CoreV1().Services(member.GetNamespace()).Create(context.Background(), &s, metav1.CreateOptions{}); err != nil { return err } } @@ -154,7 +155,7 @@ func runTestCase(t *testing.T, testCase testCaseStruct) { } require.NoError(t, err) - pods, err := d.deps.KubeCli.CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := d.deps.KubeCli.CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) if util.BoolOrDefault(testCase.CompareChecksum, true) { diff --git a/pkg/deployment/deployment_suite_test.go b/pkg/deployment/deployment_suite_test.go index 1f9fc1fad..07b288cdb 100644 --- a/pkg/deployment/deployment_suite_test.go +++ b/pkg/deployment/deployment_suite_test.go @@ -31,7 +31,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/deployment/client" - monitoringFakeClient "github.com/coreos/prometheus-operator/pkg/client/versioned/fake" + monitoringFakeClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/fake" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/probes" diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 109581717..a0463d273 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -134,12 +134,12 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima Logger() // Check if pod exists - if pod, err := ib.KubeCli.CoreV1().Pods(ns).Get(podName, metav1.GetOptions{}); err == nil { + if pod, err := ib.KubeCli.CoreV1().Pods(ns).Get(context.Background(), podName, metav1.GetOptions{}); err == nil { // Pod found if k8sutil.IsPodFailed(pod) { // Wait some time before deleting the pod if time.Now().After(pod.GetCreationTimestamp().Add(30 * time.Second)) { - if err := ib.KubeCli.CoreV1().Pods(ns).Delete(podName, nil); err != nil && !k8sutil.IsNotFound(err) { + if err := ib.KubeCli.CoreV1().Pods(ns).Delete(context.Background(), podName, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Warn().Err(err).Msg("Failed to delete Image ID Pod") return false, nil } @@ -176,7 +176,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima enterprise := strings.ToLower(v.License) == "enterprise" // We have all the info we need now, kill the pod and store the image info. - if err := ib.KubeCli.CoreV1().Pods(ns).Delete(podName, nil); err != nil && !k8sutil.IsNotFound(err) { + if err := ib.KubeCli.CoreV1().Pods(ns).Delete(context.Background(), podName, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Warn().Err(err).Msg("Failed to delete Image ID Pod") return true, nil } diff --git a/pkg/deployment/images_test.go b/pkg/deployment/images_test.go index 5ab385294..85e4666e7 100644 --- a/pkg/deployment/images_test.go +++ b/pkg/deployment/images_test.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "crypto/sha1" "fmt" "testing" @@ -180,11 +181,11 @@ func TestEnsureImages(t *testing.T) { }, } - _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(&pod) + _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(context.Background(), &pod, metav1.CreateOptions{}) require.NoError(t, err) }, After: func(t *testing.T, deployment *Deployment) { - pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) }, @@ -205,11 +206,11 @@ func TestEnsureImages(t *testing.T) { Phase: v1.PodFailed, }, } - _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(&pod) + _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(context.Background(), &pod, metav1.CreateOptions{}) require.NoError(t, err) }, After: func(t *testing.T, deployment *Deployment) { - pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 0) }, @@ -235,11 +236,11 @@ func TestEnsureImages(t *testing.T) { }, }, } - _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(&pod) + _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(context.Background(), &pod, metav1.CreateOptions{}) require.NoError(t, err) }, After: func(t *testing.T, deployment *Deployment) { - pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) }, @@ -266,11 +267,11 @@ func TestEnsureImages(t *testing.T) { }, }, } - _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(&pod) + _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(context.Background(), &pod, metav1.CreateOptions{}) require.NoError(t, err) }, After: func(t *testing.T, deployment *Deployment) { - pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) }, @@ -300,11 +301,11 @@ func TestEnsureImages(t *testing.T) { }, }, } - _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(&pod) + _, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).Create(context.Background(), &pod, metav1.CreateOptions{}) require.NoError(t, err) }, After: func(t *testing.T, deployment *Deployment) { - pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := deployment.GetKubeCli().CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) }, @@ -326,7 +327,7 @@ func TestEnsureImages(t *testing.T) { } // Create custom resource in the fake kubernetes API - _, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(testNamespace).Create(d.apiObject) + _, err := d.deps.DatabaseCRCli.DatabaseV1().ArangoDeployments(testNamespace).Create(context.Background(), d.apiObject, metav1.CreateOptions{}) require.NoError(t, err) // Act @@ -342,7 +343,7 @@ func TestEnsureImages(t *testing.T) { require.NoError(t, err) if len(testCase.ExpectedPod.Spec.Containers) > 0 { - pods, err := d.deps.KubeCli.CoreV1().Pods(testNamespace).List(metav1.ListOptions{}) + pods, err := d.deps.KubeCli.CoreV1().Pods(testNamespace).List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) require.Len(t, pods.Items, 1) require.Equal(t, testCase.ExpectedPod.Spec, pods.Items[0].Spec) diff --git a/pkg/deployment/pod/encryption.go b/pkg/deployment/pod/encryption.go index 366578962..0cf4c8eff 100644 --- a/pkg/deployment/pod/encryption.go +++ b/pkg/deployment/pod/encryption.go @@ -23,6 +23,7 @@ package pod import ( + "context" "crypto/sha256" "fmt" "path/filepath" @@ -67,7 +68,7 @@ func GroupEncryptionSupported(mode api.DeploymentMode, group api.ServerGroup) bo } func GetEncryptionKey(secrets k8sutil.SecretInterface, name string) (string, []byte, bool, error) { - keyfile, err := secrets.Get(name, meta.GetOptions{}) + keyfile, err := secrets.Get(context.Background(), name, meta.GetOptions{}) if err != nil { if k8sutil.IsNotFound(err) { return "", nil, false, nil diff --git a/pkg/deployment/reconcile/action_encryption_add.go b/pkg/deployment/reconcile/action_encryption_add.go index 920f3b629..c8df1c277 100644 --- a/pkg/deployment/reconcile/action_encryption_add.go +++ b/pkg/deployment/reconcile/action_encryption_add.go @@ -26,6 +26,8 @@ import ( "context" "encoding/base64" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/deployment/features" @@ -102,7 +104,7 @@ func (a *encryptionKeyAddAction) Start(ctx context.Context) (bool, error) { return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { return false, err } diff --git a/pkg/deployment/reconcile/action_encryption_refresh.go b/pkg/deployment/reconcile/action_encryption_refresh.go index 30492a207..d829cf795 100644 --- a/pkg/deployment/reconcile/action_encryption_refresh.go +++ b/pkg/deployment/reconcile/action_encryption_refresh.go @@ -54,7 +54,7 @@ func (a *encryptionKeyRefreshAction) Start(ctx context.Context) (bool, error) { } func (a *encryptionKeyRefreshAction) CheckProgress(ctx context.Context) (bool, bool, error) { - keyfolder, err := a.actionCtx.SecretsInterface().Get(pod.GetEncryptionFolderSecretName(a.actionCtx.GetName()), meta.GetOptions{}) + keyfolder, err := a.actionCtx.SecretsInterface().Get(ctx, pod.GetEncryptionFolderSecretName(a.actionCtx.GetName()), meta.GetOptions{}) if err != nil { a.log.Err(err).Msgf("Unable to fetch encryption folder") return true, false, nil diff --git a/pkg/deployment/reconcile/action_encryption_remove.go b/pkg/deployment/reconcile/action_encryption_remove.go index 71e9d074b..e8eb0f1f6 100644 --- a/pkg/deployment/reconcile/action_encryption_remove.go +++ b/pkg/deployment/reconcile/action_encryption_remove.go @@ -25,6 +25,8 @@ package reconcile import ( "context" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" @@ -79,7 +81,7 @@ func (a *encryptionKeyRemoveAction) Start(ctx context.Context) (bool, error) { return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", string(patch)) diff --git a/pkg/deployment/reconcile/action_encryption_status_update.go b/pkg/deployment/reconcile/action_encryption_status_update.go index 73e8f748e..4782a1f4e 100644 --- a/pkg/deployment/reconcile/action_encryption_status_update.go +++ b/pkg/deployment/reconcile/action_encryption_status_update.go @@ -57,7 +57,7 @@ func (a *encryptionKeyStatusUpdateAction) Start(ctx context.Context) (bool, erro return true, nil } - f, err := a.actionCtx.SecretsInterface().Get(pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), meta.GetOptions{}) + f, err := a.actionCtx.SecretsInterface().Get(ctx, pod.GetEncryptionFolderSecretName(a.actionCtx.GetAPIObject().GetName()), meta.GetOptions{}) if err != nil { a.log.Error().Err(err).Msgf("Unable to get folder info") return true, nil diff --git a/pkg/deployment/reconcile/action_jwt_add.go b/pkg/deployment/reconcile/action_jwt_add.go index bf2ba135d..5ecfe52d9 100644 --- a/pkg/deployment/reconcile/action_jwt_add.go +++ b/pkg/deployment/reconcile/action_jwt_add.go @@ -26,6 +26,8 @@ import ( "context" "encoding/base64" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/constants" @@ -114,7 +116,7 @@ func (a *jwtAddAction) Start(ctx context.Context) (bool, error) { return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", pod.JWTSecretFolder(a.actionCtx.GetName())) diff --git a/pkg/deployment/reconcile/action_jwt_clean.go b/pkg/deployment/reconcile/action_jwt_clean.go index 1ee45fadb..169c9d58e 100644 --- a/pkg/deployment/reconcile/action_jwt_clean.go +++ b/pkg/deployment/reconcile/action_jwt_clean.go @@ -25,6 +25,8 @@ package reconcile import ( "context" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -105,7 +107,7 @@ func (a *jwtCleanAction) Start(ctx context.Context) (bool, error) { return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", pod.JWTSecretFolder(a.actionCtx.GetName())) diff --git a/pkg/deployment/reconcile/action_jwt_set_active.go b/pkg/deployment/reconcile/action_jwt_set_active.go index ae530f422..17245d98c 100644 --- a/pkg/deployment/reconcile/action_jwt_set_active.go +++ b/pkg/deployment/reconcile/action_jwt_set_active.go @@ -26,6 +26,8 @@ import ( "context" "encoding/base64" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/constants" @@ -116,7 +118,7 @@ func (a *jwtSetActiveAction) Start(ctx context.Context) (bool, error) { return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, pod.JWTSecretFolder(a.actionCtx.GetName()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", pod.JWTSecretFolder(a.actionCtx.GetName())) diff --git a/pkg/deployment/reconcile/action_tls_ca_append.go b/pkg/deployment/reconcile/action_tls_ca_append.go index bc659320e..7eab3151f 100644 --- a/pkg/deployment/reconcile/action_tls_ca_append.go +++ b/pkg/deployment/reconcile/action_tls_ca_append.go @@ -26,6 +26,8 @@ import ( "context" "encoding/base64" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" @@ -113,7 +115,7 @@ func (a *appendTLSCACertificateAction) Start(ctx context.Context) (bool, error) return true, nil } - _, err = a.actionCtx.SecretsInterface().Patch(resources.GetCASecretName(a.actionCtx.GetAPIObject()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, resources.GetCASecretName(a.actionCtx.GetAPIObject()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", string(patch)) diff --git a/pkg/deployment/reconcile/action_tls_ca_clean.go b/pkg/deployment/reconcile/action_tls_ca_clean.go index f37a22cb6..5615bdd97 100644 --- a/pkg/deployment/reconcile/action_tls_ca_clean.go +++ b/pkg/deployment/reconcile/action_tls_ca_clean.go @@ -25,6 +25,8 @@ package reconcile import ( "context" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/deployment/patch" @@ -115,7 +117,7 @@ func (a *cleanTLSCACertificateAction) Start(ctx context.Context) (bool, error) { } a.log.Info().Msgf("Removing key %s from truststore", certChecksum) - _, err = a.actionCtx.SecretsInterface().Patch(resources.GetCASecretName(a.actionCtx.GetAPIObject()), types.JSONPatchType, patch) + _, err = a.actionCtx.SecretsInterface().Patch(ctx, resources.GetCASecretName(a.actionCtx.GetAPIObject()), types.JSONPatchType, patch, meta.PatchOptions{}) if err != nil { if !k8sutil.IsInvalid(err) { return false, errors.Wrapf(err, "Unable to update secret: %s", string(patch)) diff --git a/pkg/deployment/reconcile/action_tls_ca_renew.go b/pkg/deployment/reconcile/action_tls_ca_renew.go index 1e2575952..772a40c64 100644 --- a/pkg/deployment/reconcile/action_tls_ca_renew.go +++ b/pkg/deployment/reconcile/action_tls_ca_renew.go @@ -55,7 +55,7 @@ func (a *renewTLSCACertificateAction) Start(ctx context.Context) (bool, error) { } s := a.actionCtx.SecretsInterface() - if err := s.Delete(a.actionCtx.GetSpec().TLS.GetCASecretName(), &meta.DeleteOptions{}); err != nil { + if err := s.Delete(ctx, a.actionCtx.GetSpec().TLS.GetCASecretName(), meta.DeleteOptions{}); err != nil { if !k8sutil.IsNotFound(err) { a.log.Warn().Err(err).Msgf("Unable to clean cert %s", a.actionCtx.GetSpec().TLS.GetCASecretName()) return true, nil diff --git a/pkg/deployment/reconcile/action_tls_status_update.go b/pkg/deployment/reconcile/action_tls_status_update.go index 21bb4933c..c5a604d1b 100644 --- a/pkg/deployment/reconcile/action_tls_status_update.go +++ b/pkg/deployment/reconcile/action_tls_status_update.go @@ -56,7 +56,7 @@ func (a *tlsKeyStatusUpdateAction) Start(ctx context.Context) (bool, error) { return true, nil } - f, err := a.actionCtx.SecretsInterface().Get(resources.GetCASecretName(a.actionCtx.GetAPIObject()), meta.GetOptions{}) + f, err := a.actionCtx.SecretsInterface().Get(ctx, resources.GetCASecretName(a.actionCtx.GetAPIObject()), meta.GetOptions{}) if err != nil { a.log.Error().Err(err).Msgf("Unable to get folder info") return true, nil diff --git a/pkg/deployment/reconcile/plan_builder_test.go b/pkg/deployment/reconcile/plan_builder_test.go index f85b22026..736580794 100644 --- a/pkg/deployment/reconcile/plan_builder_test.go +++ b/pkg/deployment/reconcile/plan_builder_test.go @@ -33,7 +33,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/arangod/conn" - monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" policy "k8s.io/api/policy/v1beta1" diff --git a/pkg/deployment/resources/annotations.go b/pkg/deployment/resources/annotations.go index d8f5e967c..471e50f8a 100644 --- a/pkg/deployment/resources/annotations.go +++ b/pkg/deployment/resources/annotations.go @@ -23,11 +23,13 @@ package resources import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/deployment/patch" "github.com/arangodb/kube-arangodb/pkg/util/collection" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" - monitoringTypedClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringTypedClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "k8s.io/apimachinery/pkg/types" "github.com/arangodb/kube-arangodb/pkg/apis/deployment" @@ -117,7 +119,7 @@ func (r *Resources) EnsureAnnotations(cachedStatus inspectorInterface.Inspector) func ensureSecretsAnnotations(client typedCore.SecretInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IterateSecrets(func(secret *core.Secret) error { ensureAnnotationsMap(secret.Kind, secret, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -133,7 +135,7 @@ func ensureSecretsAnnotations(client typedCore.SecretInterface, cachedStatus ins func ensureServiceAccountsAnnotations(client typedCore.ServiceAccountInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IterateServiceAccounts(func(serviceAccount *core.ServiceAccount) error { ensureAnnotationsMap(serviceAccount.Kind, serviceAccount, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -149,7 +151,7 @@ func ensureServiceAccountsAnnotations(client typedCore.ServiceAccountInterface, func ensureServicesAnnotations(client typedCore.ServiceInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IterateServices(func(service *core.Service) error { ensureAnnotationsMap(service.Kind, service, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -165,7 +167,7 @@ func ensureServicesAnnotations(client typedCore.ServiceInterface, cachedStatus i func ensurePdbsAnnotations(client policyTyped.PodDisruptionBudgetInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IteratePodDisruptionBudgets(func(podDisruptionBudget *policy.PodDisruptionBudget) error { ensureAnnotationsMap(podDisruptionBudget.Kind, podDisruptionBudget, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -181,7 +183,7 @@ func ensurePdbsAnnotations(client policyTyped.PodDisruptionBudgetInterface, cach func ensurePvcsAnnotations(client typedCore.PersistentVolumeClaimInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IteratePersistentVolumeClaims(func(persistentVolumeClaim *core.PersistentVolumeClaim) error { ensureGroupAnnotationsMap(persistentVolumeClaim.Kind, persistentVolumeClaim, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -197,7 +199,7 @@ func ensurePvcsAnnotations(client typedCore.PersistentVolumeClaimInterface, cach func ensureServiceMonitorsAnnotations(client monitoringTypedClient.ServiceMonitorInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, spec api.DeploymentSpec) error { if err := cachedStatus.IterateServiceMonitors(func(serviceMonitor *monitoring.ServiceMonitor) error { ensureAnnotationsMap(serviceMonitor.Kind, serviceMonitor, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil @@ -227,7 +229,7 @@ func getObjectGroup(obj meta.Object) api.ServerGroup { func ensurePodsAnnotations(client typedCore.PodInterface, cachedStatus inspectorInterface.Inspector, kind, name, namespace string, annotations map[string]string, spec api.DeploymentSpec) error { if err := cachedStatus.IteratePods(func(pod *core.Pod) error { ensureGroupAnnotationsMap(pod.Kind, pod, spec, func(name string, d []byte) error { - _, err := client.Patch(name, types.JSONPatchType, d) + _, err := client.Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) return nil diff --git a/pkg/deployment/resources/context.go b/pkg/deployment/resources/context.go index 2c5672ecb..6da4c6e8d 100644 --- a/pkg/deployment/resources/context.go +++ b/pkg/deployment/resources/context.go @@ -29,7 +29,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/operator/scope" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" diff --git a/pkg/deployment/resources/inspector/inspector.go b/pkg/deployment/resources/inspector/inspector.go index da6af6b28..f91dffc15 100644 --- a/pkg/deployment/resources/inspector/inspector.go +++ b/pkg/deployment/resources/inspector/inspector.go @@ -23,20 +23,28 @@ package inspector import ( + "context" "sync" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" core "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" "k8s.io/client-go/kubernetes" ) +// SecretReadInterface has methods to work with Secret resources with ReadOnly mode. +type SecretReadInterface interface { + Get(ctx context.Context, name string, opts meta.GetOptions) (*core.Secret, error) +} + func NewInspector(k kubernetes.Interface, m monitoringClient.MonitoringV1Interface, c versioned.Interface, namespace string) (inspectorInterface.Inspector, error) { pods, err := podsToMap(k, namespace) if err != nil { diff --git a/pkg/deployment/resources/inspector/members.go b/pkg/deployment/resources/inspector/members.go index 561f32d9a..620b45679 100644 --- a/pkg/deployment/resources/inspector/members.go +++ b/pkg/deployment/resources/inspector/members.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -98,7 +100,7 @@ func arangoMemberPointer(pod api.ArangoMember) *api.ArangoMember { } func getArangoMembers(k versioned.Interface, namespace, cont string) ([]api.ArangoMember, error) { - arangoMembers, err := k.DatabaseV1().ArangoMembers(namespace).List(meta.ListOptions{ + arangoMembers, err := k.DatabaseV1().ArangoMembers(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/pdbs.go b/pkg/deployment/resources/inspector/pdbs.go index d0596db64..95bc74b0f 100644 --- a/pkg/deployment/resources/inspector/pdbs.go +++ b/pkg/deployment/resources/inspector/pdbs.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/poddisruptionbudget" policy "k8s.io/api/policy/v1beta1" @@ -98,7 +100,7 @@ func podDisruptionBudgetPointer(podDisruptionBudget policy.PodDisruptionBudget) } func getPodDisruptionBudgets(k kubernetes.Interface, namespace, cont string) ([]policy.PodDisruptionBudget, error) { - podDisruptionBudgets, err := k.PolicyV1beta1().PodDisruptionBudgets(namespace).List(meta.ListOptions{ + podDisruptionBudgets, err := k.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/pods.go b/pkg/deployment/resources/inspector/pods.go index 61e4034b7..aad1db3a3 100644 --- a/pkg/deployment/resources/inspector/pods.go +++ b/pkg/deployment/resources/inspector/pods.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/pod" core "k8s.io/api/core/v1" @@ -98,7 +100,7 @@ func podPointer(pod core.Pod) *core.Pod { } func getPods(k kubernetes.Interface, namespace, cont string) ([]core.Pod, error) { - pods, err := k.CoreV1().Pods(namespace).List(meta.ListOptions{ + pods, err := k.CoreV1().Pods(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/pvcs.go b/pkg/deployment/resources/inspector/pvcs.go index 1cbe13646..10d71493c 100644 --- a/pkg/deployment/resources/inspector/pvcs.go +++ b/pkg/deployment/resources/inspector/pvcs.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/persistentvolumeclaim" core "k8s.io/api/core/v1" @@ -98,7 +100,7 @@ func pvcPointer(pvc core.PersistentVolumeClaim) *core.PersistentVolumeClaim { } func getPersistentVolumeClaims(k kubernetes.Interface, namespace, cont string) ([]core.PersistentVolumeClaim, error) { - pvcs, err := k.CoreV1().PersistentVolumeClaims(namespace).List(meta.ListOptions{ + pvcs, err := k.CoreV1().PersistentVolumeClaims(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/sa.go b/pkg/deployment/resources/inspector/sa.go index ba0681e87..514727d01 100644 --- a/pkg/deployment/resources/inspector/sa.go +++ b/pkg/deployment/resources/inspector/sa.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount" core "k8s.io/api/core/v1" @@ -98,7 +100,7 @@ func serviceAccountPointer(serviceAccount core.ServiceAccount) *core.ServiceAcco } func getServiceAccounts(k kubernetes.Interface, namespace, cont string) ([]core.ServiceAccount, error) { - serviceAccounts, err := k.CoreV1().ServiceAccounts(namespace).List(meta.ListOptions{ + serviceAccounts, err := k.CoreV1().ServiceAccounts(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/secrets.go b/pkg/deployment/resources/inspector/secrets.go index b331a475e..d05502dcb 100644 --- a/pkg/deployment/resources/inspector/secrets.go +++ b/pkg/deployment/resources/inspector/secrets.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/secret" core "k8s.io/api/core/v1" @@ -83,7 +85,7 @@ type secretReadInterface struct { i *inspector } -func (s secretReadInterface) Get(name string, options meta.GetOptions) (*core.Secret, error) { +func (s secretReadInterface) Get(ctx context.Context, name string, opts meta.GetOptions) (*core.Secret, error) { if s, ok := s.i.Secret(name); !ok { return nil, apiErrors.NewNotFound(schema.GroupResource{ Group: core.GroupName, @@ -119,7 +121,7 @@ func secretPointer(pod core.Secret) *core.Secret { } func getSecrets(k kubernetes.Interface, namespace, cont string) ([]core.Secret, error) { - secrets, err := k.CoreV1().Secrets(namespace).List(meta.ListOptions{ + secrets, err := k.CoreV1().Secrets(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/services.go b/pkg/deployment/resources/inspector/services.go index 20db7828a..410a65a62 100644 --- a/pkg/deployment/resources/inspector/services.go +++ b/pkg/deployment/resources/inspector/services.go @@ -23,6 +23,8 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" core "k8s.io/api/core/v1" @@ -98,7 +100,7 @@ func servicePointer(pod core.Service) *core.Service { } func getServices(k kubernetes.Interface, namespace, cont string) ([]core.Service, error) { - services, err := k.CoreV1().Services(namespace).List(meta.ListOptions{ + services, err := k.CoreV1().Services(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/inspector/sms.go b/pkg/deployment/resources/inspector/sms.go index fa2a25be2..3f1d4bbc8 100644 --- a/pkg/deployment/resources/inspector/sms.go +++ b/pkg/deployment/resources/inspector/sms.go @@ -23,10 +23,12 @@ package inspector import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor" - monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -94,7 +96,7 @@ func serviceMonitorsToMap(m monitoringClient.MonitoringV1Interface, namespace st } func getServiceMonitors(m monitoringClient.MonitoringV1Interface, namespace, cont string) ([]*monitoring.ServiceMonitor, error) { - serviceMonitors, err := m.ServiceMonitors(namespace).List(meta.ListOptions{ + serviceMonitors, err := m.ServiceMonitors(namespace).List(context.Background(), meta.ListOptions{ Limit: 128, Continue: cont, }) diff --git a/pkg/deployment/resources/labels.go b/pkg/deployment/resources/labels.go index 218cc36fc..2c8bfe58d 100644 --- a/pkg/deployment/resources/labels.go +++ b/pkg/deployment/resources/labels.go @@ -23,9 +23,12 @@ package resources import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" - monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" + monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" core "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" @@ -70,7 +73,7 @@ func (r *Resources) EnsureSecretLabels(cachedStatus inspectorInterface.Inspector changed := false if err := cachedStatus.IterateSecrets(func(secret *core.Secret) error { if ensureLabelsMap(secret.Kind, secret, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().CoreV1().Secrets(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().CoreV1().Secrets(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -94,7 +97,7 @@ func (r *Resources) EnsureServiceAccountsLabels(cachedStatus inspectorInterface. changed := false if err := cachedStatus.IterateServiceAccounts(func(serviceAccount *core.ServiceAccount) error { if ensureLabelsMap(serviceAccount.Kind, serviceAccount, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().CoreV1().ServiceAccounts(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().CoreV1().ServiceAccounts(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -118,7 +121,7 @@ func (r *Resources) EnsureServicesLabels(cachedStatus inspectorInterface.Inspect changed := false if err := cachedStatus.IterateServices(func(service *core.Service) error { if ensureLabelsMap(service.Kind, service, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().CoreV1().Services(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().CoreV1().Services(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -142,7 +145,7 @@ func (r *Resources) EnsureServiceMonitorsLabels(cachedStatus inspectorInterface. changed := false if err := cachedStatus.IterateServiceMonitors(func(serviceMonitor *monitoring.ServiceMonitor) error { if ensureLabelsMap(serviceMonitor.Kind, serviceMonitor, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetMonitoringV1Cli().ServiceMonitors(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetMonitoringV1Cli().ServiceMonitors(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -166,7 +169,7 @@ func (r *Resources) EnsurePodsLabels(cachedStatus inspectorInterface.Inspector) changed := false if err := cachedStatus.IteratePods(func(pod *core.Pod) error { if ensureGroupLabelsMap(pod.Kind, pod, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().CoreV1().Pods(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().CoreV1().Pods(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -190,7 +193,7 @@ func (r *Resources) EnsurePersistentVolumeClaimsLabels(cachedStatus inspectorInt changed := false if err := cachedStatus.IteratePersistentVolumeClaims(func(persistentVolumeClaim *core.PersistentVolumeClaim) error { if ensureGroupLabelsMap(persistentVolumeClaim.Kind, persistentVolumeClaim, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true @@ -214,7 +217,7 @@ func (r *Resources) EnsurePodDisruptionBudgetsLabels(cachedStatus inspectorInter changed := false if err := cachedStatus.IteratePodDisruptionBudgets(func(budget *policy.PodDisruptionBudget) error { if ensureLabelsMap(budget.Kind, budget, r.context.GetSpec(), func(name string, d []byte) error { - _, err := r.context.GetKubeCli().PolicyV1beta1().PodDisruptionBudgets(r.context.GetAPIObject().GetNamespace()).Patch(name, types.JSONPatchType, d) + _, err := r.context.GetKubeCli().PolicyV1beta1().PodDisruptionBudgets(r.context.GetAPIObject().GetNamespace()).Patch(context.Background(), name, types.JSONPatchType, d, meta.PatchOptions{}) return err }) { changed = true diff --git a/pkg/deployment/resources/member_cleanup.go b/pkg/deployment/resources/member_cleanup.go index 361036551..aba0af2d7 100644 --- a/pkg/deployment/resources/member_cleanup.go +++ b/pkg/deployment/resources/member_cleanup.go @@ -23,6 +23,7 @@ package resources import ( + "context" "time" inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector" @@ -186,7 +187,7 @@ func (r *Resources) EnsureArangoMembers(cachedStatus inspectorInterface.Inspecto }, } - if _, err := r.context.GetArangoCli().DatabaseV1().ArangoMembers(obj.GetNamespace()).Create(&a); err != nil { + if _, err := r.context.GetArangoCli().DatabaseV1().ArangoMembers(obj.GetNamespace()).Create(context.Background(), &a, metav1.CreateOptions{}); err != nil { return err } @@ -204,7 +205,7 @@ func (r *Resources) EnsureArangoMembers(cachedStatus inspectorInterface.Inspecto if !ok || g != member.Spec.Group { // Remove member - if err := r.context.GetArangoCli().DatabaseV1().ArangoMembers(obj.GetNamespace()).Delete(member.GetName(), &metav1.DeleteOptions{}); err != nil { + if err := r.context.GetArangoCli().DatabaseV1().ArangoMembers(obj.GetNamespace()).Delete(context.Background(), member.GetName(), metav1.DeleteOptions{}); err != nil { if !k8sutil.IsNotFound(err) { return err } diff --git a/pkg/deployment/resources/pdbs.go b/pkg/deployment/resources/pdbs.go index da615a3f2..a43a14679 100644 --- a/pkg/deployment/resources/pdbs.go +++ b/pkg/deployment/resources/pdbs.go @@ -115,13 +115,13 @@ func (r *Resources) ensurePDBForGroup(group api.ServerGroup, wantedMinAvail int) defer cancel() for { - pdb, err := pdbcli.Get(pdbname, metav1.GetOptions{}) + pdb, err := pdbcli.Get(context.Background(), pdbname, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { if wantedMinAvail != 0 { // No PDB found - create new pdb := newPDB(wantedMinAvail, deplname, group, r.context.GetAPIObject().AsOwner()) log.Debug().Msg("Creating new PDB") - if _, err := pdbcli.Create(pdb); err != nil { + if _, err := pdbcli.Create(context.Background(), pdb, metav1.CreateOptions{}); err != nil { log.Error().Err(err).Msg("failed to create PDB") return errors.WithStack(err) } @@ -142,7 +142,7 @@ func (r *Resources) ensurePDBForGroup(group api.ServerGroup, wantedMinAvail int) // Trigger deletion only if not already deleted if pdb.GetDeletionTimestamp() == nil { // Update the PDB - if err := pdbcli.Delete(pdbname, &metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := pdbcli.Delete(context.Background(), pdbname, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Error().Err(err).Msg("PDB deletion failed") return errors.WithStack(err) } diff --git a/pkg/deployment/resources/pod_finalizers.go b/pkg/deployment/resources/pod_finalizers.go index 6260e1604..eda510ea2 100644 --- a/pkg/deployment/resources/pod_finalizers.go +++ b/pkg/deployment/resources/pod_finalizers.go @@ -100,7 +100,7 @@ func (r *Resources) inspectFinalizerPodAgencyServing(ctx context.Context, log ze // of the agent, also remove the PVC if memberStatus.Conditions.IsTrue(api.ConditionTypeAgentRecoveryNeeded) { pvcs := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(r.context.GetNamespace()) - if err := pvcs.Delete(memberStatus.PersistentVolumeClaimName, &metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := pvcs.Delete(context.Background(), memberStatus.PersistentVolumeClaimName, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Warn().Err(err).Msg("Failed to delete PVC for member") return errors.WithStack(err) } @@ -127,7 +127,7 @@ func (r *Resources) inspectFinalizerPodDrainDBServer(ctx context.Context, log ze // If this DBServer is cleaned out, we need to remove the PVC. if memberStatus.Conditions.IsTrue(api.ConditionTypeCleanedOut) || memberStatus.Phase == api.MemberPhaseDrain { pvcs := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(r.context.GetNamespace()) - if err := pvcs.Delete(memberStatus.PersistentVolumeClaimName, &metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := pvcs.Delete(context.Background(), memberStatus.PersistentVolumeClaimName, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Warn().Err(err).Msg("Failed to delete PVC for member") return errors.WithStack(err) } diff --git a/pkg/deployment/resources/pod_termination.go b/pkg/deployment/resources/pod_termination.go index 533d608c2..9c624d19b 100644 --- a/pkg/deployment/resources/pod_termination.go +++ b/pkg/deployment/resources/pod_termination.go @@ -58,7 +58,7 @@ func (r *Resources) prepareAgencyPodTermination(ctx context.Context, log zerolog // Check node the pod is scheduled on. Only if not in namespaced scope agentDataWillBeGone := false if !r.context.GetScope().IsNamespaced() && p.Spec.NodeName != "" { - node, err := r.context.GetKubeCli().CoreV1().Nodes().Get(p.Spec.NodeName, metav1.GetOptions{}) + node, err := r.context.GetKubeCli().CoreV1().Nodes().Get(context.Background(), p.Spec.NodeName, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { log.Warn().Msg("Node not found") } else if err != nil { @@ -71,7 +71,7 @@ func (r *Resources) prepareAgencyPodTermination(ctx context.Context, log zerolog // Check PVC pvcs := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(apiObject.GetNamespace()) - pvc, err := pvcs.Get(memberStatus.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := pvcs.Get(context.Background(), memberStatus.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { log.Warn().Err(err).Msg("Failed to get PVC for member") return errors.WithStack(err) @@ -152,7 +152,7 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol // Check node the pod is scheduled on dbserverDataWillBeGone := false if !r.context.GetScope().IsNamespaced() && p.Spec.NodeName != "" { - node, err := r.context.GetKubeCli().CoreV1().Nodes().Get(p.Spec.NodeName, metav1.GetOptions{}) + node, err := r.context.GetKubeCli().CoreV1().Nodes().Get(context.Background(), p.Spec.NodeName, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { log.Warn().Msg("Node not found") } else if err != nil { @@ -167,7 +167,7 @@ func (r *Resources) prepareDBServerPodTermination(ctx context.Context, log zerol // Check PVC pvcs := r.context.GetKubeCli().CoreV1().PersistentVolumeClaims(apiObject.GetNamespace()) - pvc, err := pvcs.Get(memberStatus.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := pvcs.Get(context.Background(), memberStatus.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { log.Warn().Err(err).Msg("Failed to get PVC for member") return errors.WithStack(err) diff --git a/pkg/deployment/resources/pvc_finalizers.go b/pkg/deployment/resources/pvc_finalizers.go index 8ae94414c..e3cdd3d66 100644 --- a/pkg/deployment/resources/pvc_finalizers.go +++ b/pkg/deployment/resources/pvc_finalizers.go @@ -105,7 +105,7 @@ func (r *Resources) inspectFinalizerPVCMemberExists(ctx context.Context, log zer if memberStatus.PodName != "" { log.Info().Msg("Removing Pod of member, because PVC is being removed") pods := r.context.GetKubeCli().CoreV1().Pods(apiObject.GetNamespace()) - if err := pods.Delete(memberStatus.PodName, &metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := pods.Delete(context.Background(), memberStatus.PodName, metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Debug().Err(err).Msg("Failed to delete pod") return errors.WithStack(err) } diff --git a/pkg/deployment/resources/resources.go b/pkg/deployment/resources/resources.go index b64a9797e..afb8ab328 100644 --- a/pkg/deployment/resources/resources.go +++ b/pkg/deployment/resources/resources.go @@ -28,7 +28,7 @@ import ( driver "github.com/arangodb/go-driver" "github.com/arangodb/kube-arangodb/pkg/util/trigger" - clientv1 "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + clientv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "github.com/rs/zerolog" ) diff --git a/pkg/deployment/resources/secrets.go b/pkg/deployment/resources/secrets.go index 93abc0eb1..6ff77d19c 100644 --- a/pkg/deployment/resources/secrets.go +++ b/pkg/deployment/resources/secrets.go @@ -23,6 +23,7 @@ package resources import ( + "context" "crypto/rand" "crypto/sha256" "encoding/hex" @@ -236,7 +237,7 @@ func (r *Resources) ensureTokenSecretFolder(cachedStatus inspectorInterface.Insp f.Data[pod.ActiveJWTKey] = token f.Data[constants.SecretKeyToken] = token - if _, err := secrets.Update(f); err != nil { + if _, err := secrets.Update(context.Background(), f, meta.UpdateOptions{}); err != nil { return err } @@ -257,7 +258,7 @@ func (r *Resources) ensureTokenSecretFolder(cachedStatus inspectorInterface.Insp return err } - if _, err := secrets.Patch(folderSecretName, types.JSONPatchType, pdata); err != nil { + if _, err := secrets.Patch(context.Background(), folderSecretName, types.JSONPatchType, pdata, meta.PatchOptions{}); err != nil { return err } } @@ -276,7 +277,7 @@ func (r *Resources) ensureTokenSecretFolder(cachedStatus inspectorInterface.Insp return err } - if _, err := secrets.Patch(folderSecretName, types.JSONPatchType, pdata); err != nil { + if _, err := secrets.Patch(context.Background(), folderSecretName, types.JSONPatchType, pdata, meta.PatchOptions{}); err != nil { return err } } @@ -331,7 +332,7 @@ func (r *Resources) createSecret(secrets k8sutil.SecretInterface, secretName str // Attach secret to owner owner := r.context.GetAPIObject().AsOwner() k8sutil.AddOwnerRefToObject(secret, &owner) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -369,7 +370,7 @@ func (r *Resources) createSecretWithMod(secrets k8sutil.SecretInterface, secretN f(secret) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -449,7 +450,7 @@ func AppendKeyfileToKeyfolder(cachedStatus inspectorInterface.Inspector, secrets } // Attach secret to owner k8sutil.AddOwnerRefToObject(secret, ownerRef) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } diff --git a/pkg/deployment/resources/servicemonitor.go b/pkg/deployment/resources/servicemonitor.go index ac9f4b619..0ec771671 100644 --- a/pkg/deployment/resources/servicemonitor.go +++ b/pkg/deployment/resources/servicemonitor.go @@ -23,6 +23,8 @@ package resources import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/apis/deployment" deploymentApi "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" "github.com/arangodb/kube-arangodb/pkg/util/constants" @@ -32,8 +34,8 @@ import ( apiErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" - coreosv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" - clientv1 "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + coreosv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + clientv1 "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/rest" ) @@ -82,7 +84,9 @@ func (r *Resources) makeEndpoint(isSecure bool) coreosv1.Endpoint { Interval: "10s", Scheme: "https", TLSConfig: &coreosv1.TLSConfig{ - InsecureSkipVerify: true, + SafeTLSConfig: coreosv1.SafeTLSConfig{ + InsecureSkipVerify: true, + }, }, } } else { @@ -153,7 +157,7 @@ func (r *Resources) EnsureServiceMonitor() error { // Check if ServiceMonitor already exists serviceMonitors := mClient.ServiceMonitors(ns) - servMon, err := serviceMonitors.Get(serviceMonitorName, metav1.GetOptions{}) + servMon, err := serviceMonitors.Get(context.Background(), serviceMonitorName, metav1.GetOptions{}) if err != nil { if k8sutil.IsNotFound(err) { if !wantMetrics { @@ -174,7 +178,7 @@ func (r *Resources) EnsureServiceMonitor() error { }, Spec: spec, } - smon, err = serviceMonitors.Create(smon) + smon, err = serviceMonitors.Create(context.Background(), smon, metav1.CreateOptions{}) if err != nil { log.Error().Err(err).Msgf("Failed to create ServiceMonitor %s", serviceMonitorName) return errors.WithStack(err) @@ -216,7 +220,7 @@ func (r *Resources) EnsureServiceMonitor() error { servMon.Spec = spec - _, err = serviceMonitors.Update(servMon) + _, err = serviceMonitors.Update(context.Background(), servMon, metav1.UpdateOptions{}) if err != nil { return err } @@ -224,7 +228,7 @@ func (r *Resources) EnsureServiceMonitor() error { return nil } // Need to get rid of the ServiceMonitor: - err = serviceMonitors.Delete(serviceMonitorName, &metav1.DeleteOptions{}) + err = serviceMonitors.Delete(context.Background(), serviceMonitorName, metav1.DeleteOptions{}) if err == nil { log.Debug().Msgf("Deleted ServiceMonitor %s", serviceMonitorName) return nil diff --git a/pkg/deployment/resources/services.go b/pkg/deployment/resources/services.go index 90a0c3b14..4c93aa447 100644 --- a/pkg/deployment/resources/services.go +++ b/pkg/deployment/resources/services.go @@ -23,6 +23,7 @@ package resources import ( + "context" "strings" "time" @@ -95,7 +96,7 @@ func (r *Resources) EnsureServices(cachedStatus inspectorInterface.Inspector) er }, } - if _, err := svcs.Create(s); err != nil { + if _, err := svcs.Create(context.Background(), s, metav1.CreateOptions{}); err != nil { if !k8sutil.IsConflict(err) { return err } @@ -120,7 +121,7 @@ func (r *Resources) EnsureServices(cachedStatus inspectorInterface.Inspector) er if !equality.Semantic.DeepDerivative(*spec, s.Spec) { s.Spec = *spec - if _, err := svcs.Update(s); err != nil { + if _, err := svcs.Update(context.Background(), s, metav1.UpdateOptions{}); err != nil { return err } @@ -271,7 +272,7 @@ func (r *Resources) ensureExternalAccessServices(cachedStatus inspectorInterface } } if updateExternalAccessService && !createExternalAccessService && !deleteExternalAccessService { - if _, err := svcs.Update(existing); err != nil { + if _, err := svcs.Update(context.Background(), existing, metav1.UpdateOptions{}); err != nil { log.Debug().Err(err).Msgf("Failed to update %s external access service", title) return errors.WithStack(err) } @@ -285,7 +286,7 @@ func (r *Resources) ensureExternalAccessServices(cachedStatus inspectorInterface if deleteExternalAccessService { log.Info().Str("service", eaServiceName).Msgf("Removing obsolete %s external access service", title) - if err := svcs.Delete(eaServiceName, &metav1.DeleteOptions{}); err != nil { + if err := svcs.Delete(context.Background(), eaServiceName, metav1.DeleteOptions{}); err != nil { log.Debug().Err(err).Msgf("Failed to remove %s external access service", title) return errors.WithStack(err) } diff --git a/pkg/deployment/server_api.go b/pkg/deployment/server_api.go index 8c8d444b3..bf1194e3b 100644 --- a/pkg/deployment/server_api.go +++ b/pkg/deployment/server_api.go @@ -23,6 +23,7 @@ package deployment import ( + "context" "sort" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -192,7 +193,7 @@ func (d *Deployment) StorageClasses() []string { func (d *Deployment) DatabaseURL() string { eaSvcName := k8sutil.CreateDatabaseExternalAccessServiceName(d.Name()) ns := d.apiObject.Namespace - svc, err := d.deps.KubeCli.CoreV1().Services(ns).Get(eaSvcName, metav1.GetOptions{}) + svc, err := d.deps.KubeCli.CoreV1().Services(ns).Get(context.Background(), eaSvcName, metav1.GetOptions{}) if err != nil { return "" } @@ -201,7 +202,7 @@ func (d *Deployment) DatabaseURL() string { scheme = "http" } nodeFetcher := func() (v1.NodeList, error) { - result, err := d.deps.KubeCli.CoreV1().Nodes().List(metav1.ListOptions{}) + result, err := d.deps.KubeCli.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{}) if err != nil { return v1.NodeList{}, errors.WithStack(err) } diff --git a/pkg/deployment/server_member_api.go b/pkg/deployment/server_member_api.go index 14ab50363..0fda8af98 100644 --- a/pkg/deployment/server_member_api.go +++ b/pkg/deployment/server_member_api.go @@ -23,6 +23,8 @@ package deployment import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -62,7 +64,7 @@ func (m member) PVCName() string { func (m member) PVName() string { if status, found := m.status(); found && status.PersistentVolumeClaimName != "" { pvcs := m.d.deps.KubeCli.CoreV1().PersistentVolumeClaims(m.d.Namespace()) - if pvc, err := pvcs.Get(status.PersistentVolumeClaimName, metav1.GetOptions{}); err == nil { + if pvc, err := pvcs.Get(context.Background(), status.PersistentVolumeClaimName, metav1.GetOptions{}); err == nil { return pvc.Spec.VolumeName } } diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 9e0c8c550..de391518f 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -103,7 +103,7 @@ func NewForConfig(c *rest.Config) (*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") + 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) } diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 8ec04ee19..a6b8ce080 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -38,7 +38,7 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) + var localSchemeBuilder = runtime.SchemeBuilder{ backupv1.AddToScheme, databasev1.AddToScheme, diff --git a/pkg/generated/clientset/versioned/typed/backup/v1/arangobackup.go b/pkg/generated/clientset/versioned/typed/backup/v1/arangobackup.go index 674b8a10a..810d48bbc 100644 --- a/pkg/generated/clientset/versioned/typed/backup/v1/arangobackup.go +++ b/pkg/generated/clientset/versioned/typed/backup/v1/arangobackup.go @@ -23,6 +23,7 @@ package v1 import ( + "context" "time" v1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" @@ -41,15 +42,15 @@ type ArangoBackupsGetter interface { // ArangoBackupInterface has methods to work with ArangoBackup resources. type ArangoBackupInterface interface { - Create(*v1.ArangoBackup) (*v1.ArangoBackup, error) - Update(*v1.ArangoBackup) (*v1.ArangoBackup, error) - UpdateStatus(*v1.ArangoBackup) (*v1.ArangoBackup, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ArangoBackup, error) - List(opts metav1.ListOptions) (*v1.ArangoBackupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoBackup, err error) + Create(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.CreateOptions) (*v1.ArangoBackup, error) + Update(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.UpdateOptions) (*v1.ArangoBackup, error) + UpdateStatus(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.UpdateOptions) (*v1.ArangoBackup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ArangoBackup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ArangoBackupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoBackup, err error) ArangoBackupExpansion } @@ -68,20 +69,20 @@ func newArangoBackups(c *BackupV1Client, namespace string) *arangoBackups { } // Get takes name of the arangoBackup, and returns the corresponding arangoBackup object, and an error if there is any. -func (c *arangoBackups) Get(name string, options metav1.GetOptions) (result *v1.ArangoBackup, err error) { +func (c *arangoBackups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ArangoBackup, err error) { result = &v1.ArangoBackup{} err = c.client.Get(). Namespace(c.ns). Resource("arangobackups"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoBackups that match those selectors. -func (c *arangoBackups) List(opts metav1.ListOptions) (result *v1.ArangoBackupList, err error) { +func (c *arangoBackups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ArangoBackupList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoBackups) List(opts metav1.ListOptions) (result *v1.ArangoBackupLi Resource("arangobackups"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoBackups. -func (c *arangoBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *arangoBackups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,87 +110,90 @@ func (c *arangoBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("arangobackups"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoBackup and creates it. Returns the server's representation of the arangoBackup, and an error, if there is any. -func (c *arangoBackups) Create(arangoBackup *v1.ArangoBackup) (result *v1.ArangoBackup, err error) { +func (c *arangoBackups) Create(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.CreateOptions) (result *v1.ArangoBackup, err error) { result = &v1.ArangoBackup{} err = c.client.Post(). Namespace(c.ns). Resource("arangobackups"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackup). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoBackup and updates it. Returns the server's representation of the arangoBackup, and an error, if there is any. -func (c *arangoBackups) Update(arangoBackup *v1.ArangoBackup) (result *v1.ArangoBackup, err error) { +func (c *arangoBackups) Update(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.UpdateOptions) (result *v1.ArangoBackup, err error) { result = &v1.ArangoBackup{} err = c.client.Put(). Namespace(c.ns). Resource("arangobackups"). Name(arangoBackup.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackup). - 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 *arangoBackups) UpdateStatus(arangoBackup *v1.ArangoBackup) (result *v1.ArangoBackup, err error) { +func (c *arangoBackups) UpdateStatus(ctx context.Context, arangoBackup *v1.ArangoBackup, opts metav1.UpdateOptions) (result *v1.ArangoBackup, err error) { result = &v1.ArangoBackup{} err = c.client.Put(). Namespace(c.ns). Resource("arangobackups"). Name(arangoBackup.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackup). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoBackup and deletes it. Returns an error if one occurs. -func (c *arangoBackups) Delete(name string, options *metav1.DeleteOptions) error { +func (c *arangoBackups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangobackups"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoBackups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *arangoBackups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangobackups"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoBackup. -func (c *arangoBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoBackup, err error) { +func (c *arangoBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoBackup, err error) { result = &v1.ArangoBackup{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangobackups"). - 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/backup/v1/arangobackuppolicy.go b/pkg/generated/clientset/versioned/typed/backup/v1/arangobackuppolicy.go index 6dbd64e26..d4ef1b0c5 100644 --- a/pkg/generated/clientset/versioned/typed/backup/v1/arangobackuppolicy.go +++ b/pkg/generated/clientset/versioned/typed/backup/v1/arangobackuppolicy.go @@ -23,6 +23,7 @@ package v1 import ( + "context" "time" v1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" @@ -41,15 +42,15 @@ type ArangoBackupPoliciesGetter interface { // ArangoBackupPolicyInterface has methods to work with ArangoBackupPolicy resources. type ArangoBackupPolicyInterface interface { - Create(*v1.ArangoBackupPolicy) (*v1.ArangoBackupPolicy, error) - Update(*v1.ArangoBackupPolicy) (*v1.ArangoBackupPolicy, error) - UpdateStatus(*v1.ArangoBackupPolicy) (*v1.ArangoBackupPolicy, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ArangoBackupPolicy, error) - List(opts metav1.ListOptions) (*v1.ArangoBackupPolicyList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoBackupPolicy, err error) + Create(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.CreateOptions) (*v1.ArangoBackupPolicy, error) + Update(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.UpdateOptions) (*v1.ArangoBackupPolicy, error) + UpdateStatus(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.UpdateOptions) (*v1.ArangoBackupPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ArangoBackupPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ArangoBackupPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoBackupPolicy, err error) ArangoBackupPolicyExpansion } @@ -68,20 +69,20 @@ func newArangoBackupPolicies(c *BackupV1Client, namespace string) *arangoBackupP } // Get takes name of the arangoBackupPolicy, and returns the corresponding arangoBackupPolicy object, and an error if there is any. -func (c *arangoBackupPolicies) Get(name string, options metav1.GetOptions) (result *v1.ArangoBackupPolicy, err error) { +func (c *arangoBackupPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ArangoBackupPolicy, err error) { result = &v1.ArangoBackupPolicy{} err = c.client.Get(). Namespace(c.ns). Resource("arangobackuppolicies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoBackupPolicies that match those selectors. -func (c *arangoBackupPolicies) List(opts metav1.ListOptions) (result *v1.ArangoBackupPolicyList, err error) { +func (c *arangoBackupPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ArangoBackupPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoBackupPolicies) List(opts metav1.ListOptions) (result *v1.ArangoB Resource("arangobackuppolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoBackupPolicies. -func (c *arangoBackupPolicies) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *arangoBackupPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,87 +110,90 @@ func (c *arangoBackupPolicies) Watch(opts metav1.ListOptions) (watch.Interface, Resource("arangobackuppolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoBackupPolicy and creates it. Returns the server's representation of the arangoBackupPolicy, and an error, if there is any. -func (c *arangoBackupPolicies) Create(arangoBackupPolicy *v1.ArangoBackupPolicy) (result *v1.ArangoBackupPolicy, err error) { +func (c *arangoBackupPolicies) Create(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.CreateOptions) (result *v1.ArangoBackupPolicy, err error) { result = &v1.ArangoBackupPolicy{} err = c.client.Post(). Namespace(c.ns). Resource("arangobackuppolicies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackupPolicy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoBackupPolicy and updates it. Returns the server's representation of the arangoBackupPolicy, and an error, if there is any. -func (c *arangoBackupPolicies) Update(arangoBackupPolicy *v1.ArangoBackupPolicy) (result *v1.ArangoBackupPolicy, err error) { +func (c *arangoBackupPolicies) Update(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.UpdateOptions) (result *v1.ArangoBackupPolicy, err error) { result = &v1.ArangoBackupPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("arangobackuppolicies"). Name(arangoBackupPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackupPolicy). - 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 *arangoBackupPolicies) UpdateStatus(arangoBackupPolicy *v1.ArangoBackupPolicy) (result *v1.ArangoBackupPolicy, err error) { +func (c *arangoBackupPolicies) UpdateStatus(ctx context.Context, arangoBackupPolicy *v1.ArangoBackupPolicy, opts metav1.UpdateOptions) (result *v1.ArangoBackupPolicy, err error) { result = &v1.ArangoBackupPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("arangobackuppolicies"). Name(arangoBackupPolicy.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoBackupPolicy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoBackupPolicy and deletes it. Returns an error if one occurs. -func (c *arangoBackupPolicies) Delete(name string, options *metav1.DeleteOptions) error { +func (c *arangoBackupPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangobackuppolicies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoBackupPolicies) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *arangoBackupPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangobackuppolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoBackupPolicy. -func (c *arangoBackupPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoBackupPolicy, err error) { +func (c *arangoBackupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoBackupPolicy, err error) { result = &v1.ArangoBackupPolicy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangobackuppolicies"). - 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/backup/v1/fake/fake_arangobackup.go b/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackup.go index 205c26aea..033c404e2 100644 --- a/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackup.go +++ b/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackup.go @@ -23,6 +23,8 @@ package fake import ( + "context" + backupv1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangobackupsResource = schema.GroupVersionResource{Group: "backup.arangodb. var arangobackupsKind = schema.GroupVersionKind{Group: "backup.arangodb.com", Version: "v1", Kind: "ArangoBackup"} // Get takes name of the arangoBackup, and returns the corresponding arangoBackup object, and an error if there is any. -func (c *FakeArangoBackups) Get(name string, options v1.GetOptions) (result *backupv1.ArangoBackup, err error) { +func (c *FakeArangoBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *backupv1.ArangoBackup, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangobackupsResource, c.ns, name), &backupv1.ArangoBackup{}) @@ -54,7 +56,7 @@ func (c *FakeArangoBackups) Get(name string, options v1.GetOptions) (result *bac } // List takes label and field selectors, and returns the list of ArangoBackups that match those selectors. -func (c *FakeArangoBackups) List(opts v1.ListOptions) (result *backupv1.ArangoBackupList, err error) { +func (c *FakeArangoBackups) List(ctx context.Context, opts v1.ListOptions) (result *backupv1.ArangoBackupList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangobackupsResource, arangobackupsKind, c.ns, opts), &backupv1.ArangoBackupList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoBackups) List(opts v1.ListOptions) (result *backupv1.ArangoBa } // Watch returns a watch.Interface that watches the requested arangoBackups. -func (c *FakeArangoBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangobackupsResource, c.ns, opts)) } // Create takes the representation of a arangoBackup and creates it. Returns the server's representation of the arangoBackup, and an error, if there is any. -func (c *FakeArangoBackups) Create(arangoBackup *backupv1.ArangoBackup) (result *backupv1.ArangoBackup, err error) { +func (c *FakeArangoBackups) Create(ctx context.Context, arangoBackup *backupv1.ArangoBackup, opts v1.CreateOptions) (result *backupv1.ArangoBackup, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangobackupsResource, c.ns, arangoBackup), &backupv1.ArangoBackup{}) @@ -94,7 +96,7 @@ func (c *FakeArangoBackups) Create(arangoBackup *backupv1.ArangoBackup) (result } // Update takes the representation of a arangoBackup and updates it. Returns the server's representation of the arangoBackup, and an error, if there is any. -func (c *FakeArangoBackups) Update(arangoBackup *backupv1.ArangoBackup) (result *backupv1.ArangoBackup, err error) { +func (c *FakeArangoBackups) Update(ctx context.Context, arangoBackup *backupv1.ArangoBackup, opts v1.UpdateOptions) (result *backupv1.ArangoBackup, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangobackupsResource, c.ns, arangoBackup), &backupv1.ArangoBackup{}) @@ -106,7 +108,7 @@ func (c *FakeArangoBackups) Update(arangoBackup *backupv1.ArangoBackup) (result // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoBackups) UpdateStatus(arangoBackup *backupv1.ArangoBackup) (*backupv1.ArangoBackup, error) { +func (c *FakeArangoBackups) UpdateStatus(ctx context.Context, arangoBackup *backupv1.ArangoBackup, opts v1.UpdateOptions) (*backupv1.ArangoBackup, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangobackupsResource, "status", c.ns, arangoBackup), &backupv1.ArangoBackup{}) @@ -117,7 +119,7 @@ func (c *FakeArangoBackups) UpdateStatus(arangoBackup *backupv1.ArangoBackup) (* } // Delete takes name of the arangoBackup and deletes it. Returns an error if one occurs. -func (c *FakeArangoBackups) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangobackupsResource, c.ns, name), &backupv1.ArangoBackup{}) @@ -125,15 +127,15 @@ func (c *FakeArangoBackups) Delete(name string, options *v1.DeleteOptions) error } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangobackupsResource, c.ns, listOptions) +func (c *FakeArangoBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangobackupsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &backupv1.ArangoBackupList{}) return err } // Patch applies the patch and returns the patched arangoBackup. -func (c *FakeArangoBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *backupv1.ArangoBackup, err error) { +func (c *FakeArangoBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *backupv1.ArangoBackup, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangobackupsResource, c.ns, name, pt, data, subresources...), &backupv1.ArangoBackup{}) diff --git a/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackuppolicy.go b/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackuppolicy.go index 9b82041b0..9d3c243d2 100644 --- a/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackuppolicy.go +++ b/pkg/generated/clientset/versioned/typed/backup/v1/fake/fake_arangobackuppolicy.go @@ -23,6 +23,8 @@ package fake import ( + "context" + backupv1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangobackuppoliciesResource = schema.GroupVersionResource{Group: "backup.ar var arangobackuppoliciesKind = schema.GroupVersionKind{Group: "backup.arangodb.com", Version: "v1", Kind: "ArangoBackupPolicy"} // Get takes name of the arangoBackupPolicy, and returns the corresponding arangoBackupPolicy object, and an error if there is any. -func (c *FakeArangoBackupPolicies) Get(name string, options v1.GetOptions) (result *backupv1.ArangoBackupPolicy, err error) { +func (c *FakeArangoBackupPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *backupv1.ArangoBackupPolicy, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangobackuppoliciesResource, c.ns, name), &backupv1.ArangoBackupPolicy{}) @@ -54,7 +56,7 @@ func (c *FakeArangoBackupPolicies) Get(name string, options v1.GetOptions) (resu } // List takes label and field selectors, and returns the list of ArangoBackupPolicies that match those selectors. -func (c *FakeArangoBackupPolicies) List(opts v1.ListOptions) (result *backupv1.ArangoBackupPolicyList, err error) { +func (c *FakeArangoBackupPolicies) List(ctx context.Context, opts v1.ListOptions) (result *backupv1.ArangoBackupPolicyList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangobackuppoliciesResource, arangobackuppoliciesKind, c.ns, opts), &backupv1.ArangoBackupPolicyList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoBackupPolicies) List(opts v1.ListOptions) (result *backupv1.A } // Watch returns a watch.Interface that watches the requested arangoBackupPolicies. -func (c *FakeArangoBackupPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoBackupPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangobackuppoliciesResource, c.ns, opts)) } // Create takes the representation of a arangoBackupPolicy and creates it. Returns the server's representation of the arangoBackupPolicy, and an error, if there is any. -func (c *FakeArangoBackupPolicies) Create(arangoBackupPolicy *backupv1.ArangoBackupPolicy) (result *backupv1.ArangoBackupPolicy, err error) { +func (c *FakeArangoBackupPolicies) Create(ctx context.Context, arangoBackupPolicy *backupv1.ArangoBackupPolicy, opts v1.CreateOptions) (result *backupv1.ArangoBackupPolicy, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangobackuppoliciesResource, c.ns, arangoBackupPolicy), &backupv1.ArangoBackupPolicy{}) @@ -94,7 +96,7 @@ func (c *FakeArangoBackupPolicies) Create(arangoBackupPolicy *backupv1.ArangoBac } // Update takes the representation of a arangoBackupPolicy and updates it. Returns the server's representation of the arangoBackupPolicy, and an error, if there is any. -func (c *FakeArangoBackupPolicies) Update(arangoBackupPolicy *backupv1.ArangoBackupPolicy) (result *backupv1.ArangoBackupPolicy, err error) { +func (c *FakeArangoBackupPolicies) Update(ctx context.Context, arangoBackupPolicy *backupv1.ArangoBackupPolicy, opts v1.UpdateOptions) (result *backupv1.ArangoBackupPolicy, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangobackuppoliciesResource, c.ns, arangoBackupPolicy), &backupv1.ArangoBackupPolicy{}) @@ -106,7 +108,7 @@ func (c *FakeArangoBackupPolicies) Update(arangoBackupPolicy *backupv1.ArangoBac // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoBackupPolicies) UpdateStatus(arangoBackupPolicy *backupv1.ArangoBackupPolicy) (*backupv1.ArangoBackupPolicy, error) { +func (c *FakeArangoBackupPolicies) UpdateStatus(ctx context.Context, arangoBackupPolicy *backupv1.ArangoBackupPolicy, opts v1.UpdateOptions) (*backupv1.ArangoBackupPolicy, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangobackuppoliciesResource, "status", c.ns, arangoBackupPolicy), &backupv1.ArangoBackupPolicy{}) @@ -117,7 +119,7 @@ func (c *FakeArangoBackupPolicies) UpdateStatus(arangoBackupPolicy *backupv1.Ara } // Delete takes name of the arangoBackupPolicy and deletes it. Returns an error if one occurs. -func (c *FakeArangoBackupPolicies) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoBackupPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangobackuppoliciesResource, c.ns, name), &backupv1.ArangoBackupPolicy{}) @@ -125,15 +127,15 @@ func (c *FakeArangoBackupPolicies) Delete(name string, options *v1.DeleteOptions } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoBackupPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangobackuppoliciesResource, c.ns, listOptions) +func (c *FakeArangoBackupPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangobackuppoliciesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &backupv1.ArangoBackupPolicyList{}) return err } // Patch applies the patch and returns the patched arangoBackupPolicy. -func (c *FakeArangoBackupPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *backupv1.ArangoBackupPolicy, err error) { +func (c *FakeArangoBackupPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *backupv1.ArangoBackupPolicy, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangobackuppoliciesResource, c.ns, name, pt, data, subresources...), &backupv1.ArangoBackupPolicy{}) diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1/arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1/arangodeployment.go index 9c909cad5..09ef8494d 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1/arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1/arangodeployment.go @@ -23,6 +23,7 @@ package v1 import ( + "context" "time" v1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -41,15 +42,15 @@ type ArangoDeploymentsGetter interface { // ArangoDeploymentInterface has methods to work with ArangoDeployment resources. type ArangoDeploymentInterface interface { - Create(*v1.ArangoDeployment) (*v1.ArangoDeployment, error) - Update(*v1.ArangoDeployment) (*v1.ArangoDeployment, error) - UpdateStatus(*v1.ArangoDeployment) (*v1.ArangoDeployment, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ArangoDeployment, error) - List(opts metav1.ListOptions) (*v1.ArangoDeploymentList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoDeployment, err error) + Create(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.CreateOptions) (*v1.ArangoDeployment, error) + Update(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.UpdateOptions) (*v1.ArangoDeployment, error) + UpdateStatus(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.UpdateOptions) (*v1.ArangoDeployment, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ArangoDeployment, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ArangoDeploymentList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoDeployment, err error) ArangoDeploymentExpansion } @@ -68,20 +69,20 @@ func newArangoDeployments(c *DatabaseV1Client, namespace string) *arangoDeployme } // Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any. -func (c *arangoDeployments) Get(name string, options metav1.GetOptions) (result *v1.ArangoDeployment, err error) { +func (c *arangoDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ArangoDeployment, err error) { result = &v1.ArangoDeployment{} err = c.client.Get(). Namespace(c.ns). Resource("arangodeployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors. -func (c *arangoDeployments) List(opts metav1.ListOptions) (result *v1.ArangoDeploymentList, err error) { +func (c *arangoDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ArangoDeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoDeployments) List(opts metav1.ListOptions) (result *v1.ArangoDepl Resource("arangodeployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoDeployments. -func (c *arangoDeployments) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *arangoDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,87 +110,90 @@ func (c *arangoDeployments) Watch(opts metav1.ListOptions) (watch.Interface, err Resource("arangodeployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *arangoDeployments) Create(arangoDeployment *v1.ArangoDeployment) (result *v1.ArangoDeployment, err error) { +func (c *arangoDeployments) Create(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.CreateOptions) (result *v1.ArangoDeployment, err error) { result = &v1.ArangoDeployment{} err = c.client.Post(). Namespace(c.ns). Resource("arangodeployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *arangoDeployments) Update(arangoDeployment *v1.ArangoDeployment) (result *v1.ArangoDeployment, err error) { +func (c *arangoDeployments) Update(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.UpdateOptions) (result *v1.ArangoDeployment, err error) { result = &v1.ArangoDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeployments"). Name(arangoDeployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - 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 *arangoDeployments) UpdateStatus(arangoDeployment *v1.ArangoDeployment) (result *v1.ArangoDeployment, err error) { +func (c *arangoDeployments) UpdateStatus(ctx context.Context, arangoDeployment *v1.ArangoDeployment, opts metav1.UpdateOptions) (result *v1.ArangoDeployment, err error) { result = &v1.ArangoDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeployments"). Name(arangoDeployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs. -func (c *arangoDeployments) Delete(name string, options *metav1.DeleteOptions) error { +func (c *arangoDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangodeployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoDeployments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *arangoDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangodeployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoDeployment. -func (c *arangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoDeployment, err error) { +func (c *arangoDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoDeployment, err error) { result = &v1.ArangoDeployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangodeployments"). - 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/deployment/v1/arangomember.go b/pkg/generated/clientset/versioned/typed/deployment/v1/arangomember.go index 95f53170a..4b72fcd9f 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1/arangomember.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1/arangomember.go @@ -23,6 +23,7 @@ package v1 import ( + "context" "time" v1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -41,15 +42,15 @@ type ArangoMembersGetter interface { // ArangoMemberInterface has methods to work with ArangoMember resources. type ArangoMemberInterface interface { - Create(*v1.ArangoMember) (*v1.ArangoMember, error) - Update(*v1.ArangoMember) (*v1.ArangoMember, error) - UpdateStatus(*v1.ArangoMember) (*v1.ArangoMember, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ArangoMember, error) - List(opts metav1.ListOptions) (*v1.ArangoMemberList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoMember, err error) + Create(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.CreateOptions) (*v1.ArangoMember, error) + Update(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.UpdateOptions) (*v1.ArangoMember, error) + UpdateStatus(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.UpdateOptions) (*v1.ArangoMember, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ArangoMember, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ArangoMemberList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoMember, err error) ArangoMemberExpansion } @@ -68,20 +69,20 @@ func newArangoMembers(c *DatabaseV1Client, namespace string) *arangoMembers { } // Get takes name of the arangoMember, and returns the corresponding arangoMember object, and an error if there is any. -func (c *arangoMembers) Get(name string, options metav1.GetOptions) (result *v1.ArangoMember, err error) { +func (c *arangoMembers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ArangoMember, err error) { result = &v1.ArangoMember{} err = c.client.Get(). Namespace(c.ns). Resource("arangomembers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoMembers that match those selectors. -func (c *arangoMembers) List(opts metav1.ListOptions) (result *v1.ArangoMemberList, err error) { +func (c *arangoMembers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ArangoMemberList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoMembers) List(opts metav1.ListOptions) (result *v1.ArangoMemberLi Resource("arangomembers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoMembers. -func (c *arangoMembers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *arangoMembers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,87 +110,90 @@ func (c *arangoMembers) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("arangomembers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoMember and creates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *arangoMembers) Create(arangoMember *v1.ArangoMember) (result *v1.ArangoMember, err error) { +func (c *arangoMembers) Create(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.CreateOptions) (result *v1.ArangoMember, err error) { result = &v1.ArangoMember{} err = c.client.Post(). Namespace(c.ns). Resource("arangomembers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoMember and updates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *arangoMembers) Update(arangoMember *v1.ArangoMember) (result *v1.ArangoMember, err error) { +func (c *arangoMembers) Update(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.UpdateOptions) (result *v1.ArangoMember, err error) { result = &v1.ArangoMember{} err = c.client.Put(). Namespace(c.ns). Resource("arangomembers"). Name(arangoMember.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - 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 *arangoMembers) UpdateStatus(arangoMember *v1.ArangoMember) (result *v1.ArangoMember, err error) { +func (c *arangoMembers) UpdateStatus(ctx context.Context, arangoMember *v1.ArangoMember, opts metav1.UpdateOptions) (result *v1.ArangoMember, err error) { result = &v1.ArangoMember{} err = c.client.Put(). Namespace(c.ns). Resource("arangomembers"). Name(arangoMember.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoMember and deletes it. Returns an error if one occurs. -func (c *arangoMembers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *arangoMembers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangomembers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoMembers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *arangoMembers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangomembers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoMember. -func (c *arangoMembers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoMember, err error) { +func (c *arangoMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoMember, err error) { result = &v1.ArangoMember{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangomembers"). - 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/deployment/v1/fake/fake_arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangodeployment.go index 7e2f3679e..3c51a7693 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangodeployment.go @@ -23,6 +23,8 @@ package fake import ( + "context" + deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangodeploymentsResource = schema.GroupVersionResource{Group: "database.ara var arangodeploymentsKind = schema.GroupVersionKind{Group: "database.arangodb.com", Version: "v1", Kind: "ArangoDeployment"} // Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any. -func (c *FakeArangoDeployments) Get(name string, options v1.GetOptions) (result *deploymentv1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *deploymentv1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangodeploymentsResource, c.ns, name), &deploymentv1.ArangoDeployment{}) @@ -54,7 +56,7 @@ func (c *FakeArangoDeployments) Get(name string, options v1.GetOptions) (result } // List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors. -func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *deploymentv1.ArangoDeploymentList, err error) { +func (c *FakeArangoDeployments) List(ctx context.Context, opts v1.ListOptions) (result *deploymentv1.ArangoDeploymentList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangodeploymentsResource, arangodeploymentsKind, c.ns, opts), &deploymentv1.ArangoDeploymentList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *deploymentv1. } // Watch returns a watch.Interface that watches the requested arangoDeployments. -func (c *FakeArangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangodeploymentsResource, c.ns, opts)) } // Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *FakeArangoDeployments) Create(arangoDeployment *deploymentv1.ArangoDeployment) (result *deploymentv1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Create(ctx context.Context, arangoDeployment *deploymentv1.ArangoDeployment, opts v1.CreateOptions) (result *deploymentv1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangodeploymentsResource, c.ns, arangoDeployment), &deploymentv1.ArangoDeployment{}) @@ -94,7 +96,7 @@ func (c *FakeArangoDeployments) Create(arangoDeployment *deploymentv1.ArangoDepl } // Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *FakeArangoDeployments) Update(arangoDeployment *deploymentv1.ArangoDeployment) (result *deploymentv1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Update(ctx context.Context, arangoDeployment *deploymentv1.ArangoDeployment, opts v1.UpdateOptions) (result *deploymentv1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangodeploymentsResource, c.ns, arangoDeployment), &deploymentv1.ArangoDeployment{}) @@ -106,7 +108,7 @@ func (c *FakeArangoDeployments) Update(arangoDeployment *deploymentv1.ArangoDepl // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoDeployments) UpdateStatus(arangoDeployment *deploymentv1.ArangoDeployment) (*deploymentv1.ArangoDeployment, error) { +func (c *FakeArangoDeployments) UpdateStatus(ctx context.Context, arangoDeployment *deploymentv1.ArangoDeployment, opts v1.UpdateOptions) (*deploymentv1.ArangoDeployment, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangodeploymentsResource, "status", c.ns, arangoDeployment), &deploymentv1.ArangoDeployment{}) @@ -117,7 +119,7 @@ func (c *FakeArangoDeployments) UpdateStatus(arangoDeployment *deploymentv1.Aran } // Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs. -func (c *FakeArangoDeployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangodeploymentsResource, c.ns, name), &deploymentv1.ArangoDeployment{}) @@ -125,15 +127,15 @@ func (c *FakeArangoDeployments) Delete(name string, options *v1.DeleteOptions) e } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangodeploymentsResource, c.ns, listOptions) +func (c *FakeArangoDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangodeploymentsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &deploymentv1.ArangoDeploymentList{}) return err } // Patch applies the patch and returns the patched arangoDeployment. -func (c *FakeArangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *deploymentv1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *deploymentv1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangodeploymentsResource, c.ns, name, pt, data, subresources...), &deploymentv1.ArangoDeployment{}) diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangomember.go b/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangomember.go index 08f910f5f..6cbb02d91 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangomember.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1/fake/fake_arangomember.go @@ -23,6 +23,8 @@ package fake import ( + "context" + deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangomembersResource = schema.GroupVersionResource{Group: "database.arangod var arangomembersKind = schema.GroupVersionKind{Group: "database.arangodb.com", Version: "v1", Kind: "ArangoMember"} // Get takes name of the arangoMember, and returns the corresponding arangoMember object, and an error if there is any. -func (c *FakeArangoMembers) Get(name string, options v1.GetOptions) (result *deploymentv1.ArangoMember, err error) { +func (c *FakeArangoMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *deploymentv1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangomembersResource, c.ns, name), &deploymentv1.ArangoMember{}) @@ -54,7 +56,7 @@ func (c *FakeArangoMembers) Get(name string, options v1.GetOptions) (result *dep } // List takes label and field selectors, and returns the list of ArangoMembers that match those selectors. -func (c *FakeArangoMembers) List(opts v1.ListOptions) (result *deploymentv1.ArangoMemberList, err error) { +func (c *FakeArangoMembers) List(ctx context.Context, opts v1.ListOptions) (result *deploymentv1.ArangoMemberList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangomembersResource, arangomembersKind, c.ns, opts), &deploymentv1.ArangoMemberList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoMembers) List(opts v1.ListOptions) (result *deploymentv1.Aran } // Watch returns a watch.Interface that watches the requested arangoMembers. -func (c *FakeArangoMembers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoMembers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangomembersResource, c.ns, opts)) } // Create takes the representation of a arangoMember and creates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *FakeArangoMembers) Create(arangoMember *deploymentv1.ArangoMember) (result *deploymentv1.ArangoMember, err error) { +func (c *FakeArangoMembers) Create(ctx context.Context, arangoMember *deploymentv1.ArangoMember, opts v1.CreateOptions) (result *deploymentv1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangomembersResource, c.ns, arangoMember), &deploymentv1.ArangoMember{}) @@ -94,7 +96,7 @@ func (c *FakeArangoMembers) Create(arangoMember *deploymentv1.ArangoMember) (res } // Update takes the representation of a arangoMember and updates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *FakeArangoMembers) Update(arangoMember *deploymentv1.ArangoMember) (result *deploymentv1.ArangoMember, err error) { +func (c *FakeArangoMembers) Update(ctx context.Context, arangoMember *deploymentv1.ArangoMember, opts v1.UpdateOptions) (result *deploymentv1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangomembersResource, c.ns, arangoMember), &deploymentv1.ArangoMember{}) @@ -106,7 +108,7 @@ func (c *FakeArangoMembers) Update(arangoMember *deploymentv1.ArangoMember) (res // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoMembers) UpdateStatus(arangoMember *deploymentv1.ArangoMember) (*deploymentv1.ArangoMember, error) { +func (c *FakeArangoMembers) UpdateStatus(ctx context.Context, arangoMember *deploymentv1.ArangoMember, opts v1.UpdateOptions) (*deploymentv1.ArangoMember, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangomembersResource, "status", c.ns, arangoMember), &deploymentv1.ArangoMember{}) @@ -117,7 +119,7 @@ func (c *FakeArangoMembers) UpdateStatus(arangoMember *deploymentv1.ArangoMember } // Delete takes name of the arangoMember and deletes it. Returns an error if one occurs. -func (c *FakeArangoMembers) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangomembersResource, c.ns, name), &deploymentv1.ArangoMember{}) @@ -125,15 +127,15 @@ func (c *FakeArangoMembers) Delete(name string, options *v1.DeleteOptions) error } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoMembers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangomembersResource, c.ns, listOptions) +func (c *FakeArangoMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangomembersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &deploymentv1.ArangoMemberList{}) return err } // Patch applies the patch and returns the patched arangoMember. -func (c *FakeArangoMembers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *deploymentv1.ArangoMember, err error) { +func (c *FakeArangoMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *deploymentv1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangomembersResource, c.ns, name, pt, data, subresources...), &deploymentv1.ArangoMember{}) diff --git a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangodeployment.go index c5c360dee..1de40b12a 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangodeployment.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" "time" v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" @@ -41,15 +42,15 @@ type ArangoDeploymentsGetter interface { // ArangoDeploymentInterface has methods to work with ArangoDeployment resources. type ArangoDeploymentInterface interface { - Create(*v2alpha1.ArangoDeployment) (*v2alpha1.ArangoDeployment, error) - Update(*v2alpha1.ArangoDeployment) (*v2alpha1.ArangoDeployment, error) - UpdateStatus(*v2alpha1.ArangoDeployment) (*v2alpha1.ArangoDeployment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2alpha1.ArangoDeployment, error) - List(opts v1.ListOptions) (*v2alpha1.ArangoDeploymentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeployment, err error) + Create(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.CreateOptions) (*v2alpha1.ArangoDeployment, error) + Update(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (*v2alpha1.ArangoDeployment, error) + UpdateStatus(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (*v2alpha1.ArangoDeployment, 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) (*v2alpha1.ArangoDeployment, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.ArangoDeploymentList, 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 *v2alpha1.ArangoDeployment, err error) ArangoDeploymentExpansion } @@ -68,20 +69,20 @@ func newArangoDeployments(c *DatabaseV2alpha1Client, namespace string) *arangoDe } // Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any. -func (c *arangoDeployments) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoDeployment, err error) { +func (c *arangoDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoDeployment, err error) { result = &v2alpha1.ArangoDeployment{} err = c.client.Get(). Namespace(c.ns). Resource("arangodeployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors. -func (c *arangoDeployments) List(opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentList, err error) { +func (c *arangoDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoDeployments) List(opts v1.ListOptions) (result *v2alpha1.ArangoDe Resource("arangodeployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoDeployments. -func (c *arangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *arangoDeployments) 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 @@ -109,87 +110,90 @@ func (c *arangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) Resource("arangodeployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *arangoDeployments) Create(arangoDeployment *v2alpha1.ArangoDeployment) (result *v2alpha1.ArangoDeployment, err error) { +func (c *arangoDeployments) Create(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.CreateOptions) (result *v2alpha1.ArangoDeployment, err error) { result = &v2alpha1.ArangoDeployment{} err = c.client.Post(). Namespace(c.ns). Resource("arangodeployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *arangoDeployments) Update(arangoDeployment *v2alpha1.ArangoDeployment) (result *v2alpha1.ArangoDeployment, err error) { +func (c *arangoDeployments) Update(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeployment, err error) { result = &v2alpha1.ArangoDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeployments"). Name(arangoDeployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - 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 *arangoDeployments) UpdateStatus(arangoDeployment *v2alpha1.ArangoDeployment) (result *v2alpha1.ArangoDeployment, err error) { +func (c *arangoDeployments) UpdateStatus(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeployment, err error) { result = &v2alpha1.ArangoDeployment{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeployments"). Name(arangoDeployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs. -func (c *arangoDeployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *arangoDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangodeployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *arangoDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangodeployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoDeployment. -func (c *arangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeployment, err error) { +func (c *arangoDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoDeployment, err error) { result = &v2alpha1.ArangoDeployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangodeployments"). - 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/deployment/v2alpha1/arangomember.go b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangomember.go index db93eae54..13772743d 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangomember.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/arangomember.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" "time" v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" @@ -41,15 +42,15 @@ type ArangoMembersGetter interface { // ArangoMemberInterface has methods to work with ArangoMember resources. type ArangoMemberInterface interface { - Create(*v2alpha1.ArangoMember) (*v2alpha1.ArangoMember, error) - Update(*v2alpha1.ArangoMember) (*v2alpha1.ArangoMember, error) - UpdateStatus(*v2alpha1.ArangoMember) (*v2alpha1.ArangoMember, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2alpha1.ArangoMember, error) - List(opts v1.ListOptions) (*v2alpha1.ArangoMemberList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoMember, err error) + Create(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.CreateOptions) (*v2alpha1.ArangoMember, error) + Update(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (*v2alpha1.ArangoMember, error) + UpdateStatus(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (*v2alpha1.ArangoMember, 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) (*v2alpha1.ArangoMember, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.ArangoMemberList, 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 *v2alpha1.ArangoMember, err error) ArangoMemberExpansion } @@ -68,20 +69,20 @@ func newArangoMembers(c *DatabaseV2alpha1Client, namespace string) *arangoMember } // Get takes name of the arangoMember, and returns the corresponding arangoMember object, and an error if there is any. -func (c *arangoMembers) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoMember, err error) { +func (c *arangoMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoMember, err error) { result = &v2alpha1.ArangoMember{} err = c.client.Get(). Namespace(c.ns). Resource("arangomembers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoMembers that match those selectors. -func (c *arangoMembers) List(opts v1.ListOptions) (result *v2alpha1.ArangoMemberList, err error) { +func (c *arangoMembers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoMemberList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoMembers) List(opts v1.ListOptions) (result *v2alpha1.ArangoMember Resource("arangomembers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoMembers. -func (c *arangoMembers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *arangoMembers) 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 @@ -109,87 +110,90 @@ func (c *arangoMembers) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("arangomembers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoMember and creates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *arangoMembers) Create(arangoMember *v2alpha1.ArangoMember) (result *v2alpha1.ArangoMember, err error) { +func (c *arangoMembers) Create(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.CreateOptions) (result *v2alpha1.ArangoMember, err error) { result = &v2alpha1.ArangoMember{} err = c.client.Post(). Namespace(c.ns). Resource("arangomembers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoMember and updates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *arangoMembers) Update(arangoMember *v2alpha1.ArangoMember) (result *v2alpha1.ArangoMember, err error) { +func (c *arangoMembers) Update(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (result *v2alpha1.ArangoMember, err error) { result = &v2alpha1.ArangoMember{} err = c.client.Put(). Namespace(c.ns). Resource("arangomembers"). Name(arangoMember.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - 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 *arangoMembers) UpdateStatus(arangoMember *v2alpha1.ArangoMember) (result *v2alpha1.ArangoMember, err error) { +func (c *arangoMembers) UpdateStatus(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (result *v2alpha1.ArangoMember, err error) { result = &v2alpha1.ArangoMember{} err = c.client.Put(). Namespace(c.ns). Resource("arangomembers"). Name(arangoMember.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoMember). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoMember and deletes it. Returns an error if one occurs. -func (c *arangoMembers) Delete(name string, options *v1.DeleteOptions) error { +func (c *arangoMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangomembers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoMembers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *arangoMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangomembers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoMember. -func (c *arangoMembers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoMember, err error) { +func (c *arangoMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoMember, err error) { result = &v2alpha1.ArangoMember{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangomembers"). - 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/deployment/v2alpha1/fake/fake_arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangodeployment.go index 65931a53b..760f090a2 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangodeployment.go @@ -23,6 +23,8 @@ package fake import ( + "context" + v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangodeploymentsResource = schema.GroupVersionResource{Group: "database.ara var arangodeploymentsKind = schema.GroupVersionKind{Group: "database.arangodb.com", Version: "v2alpha1", Kind: "ArangoDeployment"} // Get takes name of the arangoDeployment, and returns the corresponding arangoDeployment object, and an error if there is any. -func (c *FakeArangoDeployments) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangodeploymentsResource, c.ns, name), &v2alpha1.ArangoDeployment{}) @@ -54,7 +56,7 @@ func (c *FakeArangoDeployments) Get(name string, options v1.GetOptions) (result } // List takes label and field selectors, and returns the list of ArangoDeployments that match those selectors. -func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentList, err error) { +func (c *FakeArangoDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangodeploymentsResource, arangodeploymentsKind, c.ns, opts), &v2alpha1.ArangoDeploymentList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *v2alpha1.Aran } // Watch returns a watch.Interface that watches the requested arangoDeployments. -func (c *FakeArangoDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangodeploymentsResource, c.ns, opts)) } // Create takes the representation of a arangoDeployment and creates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *FakeArangoDeployments) Create(arangoDeployment *v2alpha1.ArangoDeployment) (result *v2alpha1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Create(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.CreateOptions) (result *v2alpha1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangodeploymentsResource, c.ns, arangoDeployment), &v2alpha1.ArangoDeployment{}) @@ -94,7 +96,7 @@ func (c *FakeArangoDeployments) Create(arangoDeployment *v2alpha1.ArangoDeployme } // Update takes the representation of a arangoDeployment and updates it. Returns the server's representation of the arangoDeployment, and an error, if there is any. -func (c *FakeArangoDeployments) Update(arangoDeployment *v2alpha1.ArangoDeployment) (result *v2alpha1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Update(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangodeploymentsResource, c.ns, arangoDeployment), &v2alpha1.ArangoDeployment{}) @@ -106,7 +108,7 @@ func (c *FakeArangoDeployments) Update(arangoDeployment *v2alpha1.ArangoDeployme // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoDeployments) UpdateStatus(arangoDeployment *v2alpha1.ArangoDeployment) (*v2alpha1.ArangoDeployment, error) { +func (c *FakeArangoDeployments) UpdateStatus(ctx context.Context, arangoDeployment *v2alpha1.ArangoDeployment, opts v1.UpdateOptions) (*v2alpha1.ArangoDeployment, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangodeploymentsResource, "status", c.ns, arangoDeployment), &v2alpha1.ArangoDeployment{}) @@ -117,7 +119,7 @@ func (c *FakeArangoDeployments) UpdateStatus(arangoDeployment *v2alpha1.ArangoDe } // Delete takes name of the arangoDeployment and deletes it. Returns an error if one occurs. -func (c *FakeArangoDeployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangodeploymentsResource, c.ns, name), &v2alpha1.ArangoDeployment{}) @@ -125,15 +127,15 @@ func (c *FakeArangoDeployments) Delete(name string, options *v1.DeleteOptions) e } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangodeploymentsResource, c.ns, listOptions) +func (c *FakeArangoDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangodeploymentsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.ArangoDeploymentList{}) return err } // Patch applies the patch and returns the patched arangoDeployment. -func (c *FakeArangoDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeployment, err error) { +func (c *FakeArangoDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoDeployment, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangodeploymentsResource, c.ns, name, pt, data, subresources...), &v2alpha1.ArangoDeployment{}) diff --git a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangomember.go b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangomember.go index f639b0acf..b6f6e0a4a 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangomember.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v2alpha1/fake/fake_arangomember.go @@ -23,6 +23,8 @@ package fake import ( + "context" + v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangomembersResource = schema.GroupVersionResource{Group: "database.arangod var arangomembersKind = schema.GroupVersionKind{Group: "database.arangodb.com", Version: "v2alpha1", Kind: "ArangoMember"} // Get takes name of the arangoMember, and returns the corresponding arangoMember object, and an error if there is any. -func (c *FakeArangoMembers) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoMember, err error) { +func (c *FakeArangoMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangomembersResource, c.ns, name), &v2alpha1.ArangoMember{}) @@ -54,7 +56,7 @@ func (c *FakeArangoMembers) Get(name string, options v1.GetOptions) (result *v2a } // List takes label and field selectors, and returns the list of ArangoMembers that match those selectors. -func (c *FakeArangoMembers) List(opts v1.ListOptions) (result *v2alpha1.ArangoMemberList, err error) { +func (c *FakeArangoMembers) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoMemberList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangomembersResource, arangomembersKind, c.ns, opts), &v2alpha1.ArangoMemberList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoMembers) List(opts v1.ListOptions) (result *v2alpha1.ArangoMe } // Watch returns a watch.Interface that watches the requested arangoMembers. -func (c *FakeArangoMembers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoMembers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangomembersResource, c.ns, opts)) } // Create takes the representation of a arangoMember and creates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *FakeArangoMembers) Create(arangoMember *v2alpha1.ArangoMember) (result *v2alpha1.ArangoMember, err error) { +func (c *FakeArangoMembers) Create(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.CreateOptions) (result *v2alpha1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangomembersResource, c.ns, arangoMember), &v2alpha1.ArangoMember{}) @@ -94,7 +96,7 @@ func (c *FakeArangoMembers) Create(arangoMember *v2alpha1.ArangoMember) (result } // Update takes the representation of a arangoMember and updates it. Returns the server's representation of the arangoMember, and an error, if there is any. -func (c *FakeArangoMembers) Update(arangoMember *v2alpha1.ArangoMember) (result *v2alpha1.ArangoMember, err error) { +func (c *FakeArangoMembers) Update(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (result *v2alpha1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangomembersResource, c.ns, arangoMember), &v2alpha1.ArangoMember{}) @@ -106,7 +108,7 @@ func (c *FakeArangoMembers) Update(arangoMember *v2alpha1.ArangoMember) (result // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoMembers) UpdateStatus(arangoMember *v2alpha1.ArangoMember) (*v2alpha1.ArangoMember, error) { +func (c *FakeArangoMembers) UpdateStatus(ctx context.Context, arangoMember *v2alpha1.ArangoMember, opts v1.UpdateOptions) (*v2alpha1.ArangoMember, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangomembersResource, "status", c.ns, arangoMember), &v2alpha1.ArangoMember{}) @@ -117,7 +119,7 @@ func (c *FakeArangoMembers) UpdateStatus(arangoMember *v2alpha1.ArangoMember) (* } // Delete takes name of the arangoMember and deletes it. Returns an error if one occurs. -func (c *FakeArangoMembers) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangomembersResource, c.ns, name), &v2alpha1.ArangoMember{}) @@ -125,15 +127,15 @@ func (c *FakeArangoMembers) Delete(name string, options *v1.DeleteOptions) error } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoMembers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangomembersResource, c.ns, listOptions) +func (c *FakeArangoMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangomembersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.ArangoMemberList{}) return err } // Patch applies the patch and returns the patched arangoMember. -func (c *FakeArangoMembers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoMember, err error) { +func (c *FakeArangoMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoMember, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangomembersResource, c.ns, name, pt, data, subresources...), &v2alpha1.ArangoMember{}) diff --git a/pkg/generated/clientset/versioned/typed/replication/v1/arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v1/arangodeploymentreplication.go index f7fbacf3e..69d049deb 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1/arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1/arangodeploymentreplication.go @@ -23,6 +23,7 @@ package v1 import ( + "context" "time" v1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" @@ -41,15 +42,15 @@ type ArangoDeploymentReplicationsGetter interface { // ArangoDeploymentReplicationInterface has methods to work with ArangoDeploymentReplication resources. type ArangoDeploymentReplicationInterface interface { - Create(*v1.ArangoDeploymentReplication) (*v1.ArangoDeploymentReplication, error) - Update(*v1.ArangoDeploymentReplication) (*v1.ArangoDeploymentReplication, error) - UpdateStatus(*v1.ArangoDeploymentReplication) (*v1.ArangoDeploymentReplication, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ArangoDeploymentReplication, error) - List(opts metav1.ListOptions) (*v1.ArangoDeploymentReplicationList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoDeploymentReplication, err error) + Create(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.CreateOptions) (*v1.ArangoDeploymentReplication, error) + Update(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.UpdateOptions) (*v1.ArangoDeploymentReplication, error) + UpdateStatus(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.UpdateOptions) (*v1.ArangoDeploymentReplication, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ArangoDeploymentReplication, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ArangoDeploymentReplicationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoDeploymentReplication, err error) ArangoDeploymentReplicationExpansion } @@ -68,20 +69,20 @@ func newArangoDeploymentReplications(c *ReplicationV1Client, namespace string) * } // Get takes name of the arangoDeploymentReplication, and returns the corresponding arangoDeploymentReplication object, and an error if there is any. -func (c *arangoDeploymentReplications) Get(name string, options metav1.GetOptions) (result *v1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ArangoDeploymentReplication, err error) { result = &v1.ArangoDeploymentReplication{} err = c.client.Get(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoDeploymentReplications that match those selectors. -func (c *arangoDeploymentReplications) List(opts metav1.ListOptions) (result *v1.ArangoDeploymentReplicationList, err error) { +func (c *arangoDeploymentReplications) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ArangoDeploymentReplicationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoDeploymentReplications) List(opts metav1.ListOptions) (result *v1 Resource("arangodeploymentreplications"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoDeploymentReplications. -func (c *arangoDeploymentReplications) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *arangoDeploymentReplications) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,87 +110,90 @@ func (c *arangoDeploymentReplications) Watch(opts metav1.ListOptions) (watch.Int Resource("arangodeploymentreplications"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoDeploymentReplication and creates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *arangoDeploymentReplications) Create(arangoDeploymentReplication *v1.ArangoDeploymentReplication) (result *v1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Create(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.CreateOptions) (result *v1.ArangoDeploymentReplication, err error) { result = &v1.ArangoDeploymentReplication{} err = c.client.Post(). Namespace(c.ns). Resource("arangodeploymentreplications"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoDeploymentReplication and updates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *arangoDeploymentReplications) Update(arangoDeploymentReplication *v1.ArangoDeploymentReplication) (result *v1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Update(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.UpdateOptions) (result *v1.ArangoDeploymentReplication, err error) { result = &v1.ArangoDeploymentReplication{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(arangoDeploymentReplication.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - 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 *arangoDeploymentReplications) UpdateStatus(arangoDeploymentReplication *v1.ArangoDeploymentReplication) (result *v1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) UpdateStatus(ctx context.Context, arangoDeploymentReplication *v1.ArangoDeploymentReplication, opts metav1.UpdateOptions) (result *v1.ArangoDeploymentReplication, err error) { result = &v1.ArangoDeploymentReplication{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(arangoDeploymentReplication.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoDeploymentReplication and deletes it. Returns an error if one occurs. -func (c *arangoDeploymentReplications) Delete(name string, options *metav1.DeleteOptions) error { +func (c *arangoDeploymentReplications) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoDeploymentReplications) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *arangoDeploymentReplications) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangodeploymentreplications"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoDeploymentReplication. -func (c *arangoDeploymentReplications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ArangoDeploymentReplication, err error) { result = &v1.ArangoDeploymentReplication{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangodeploymentreplications"). - 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/replication/v1/fake/fake_arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v1/fake/fake_arangodeploymentreplication.go index 9c238b0ae..9f66ce819 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1/fake/fake_arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1/fake/fake_arangodeploymentreplication.go @@ -23,6 +23,8 @@ package fake import ( + "context" + replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangodeploymentreplicationsResource = schema.GroupVersionResource{Group: "r var arangodeploymentreplicationsKind = schema.GroupVersionKind{Group: "replication.database.arangodb.com", Version: "v1", Kind: "ArangoDeploymentReplication"} // Get takes name of the arangoDeploymentReplication, and returns the corresponding arangoDeploymentReplication object, and an error if there is any. -func (c *FakeArangoDeploymentReplications) Get(name string, options v1.GetOptions) (result *replicationv1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Get(ctx context.Context, name string, options v1.GetOptions) (result *replicationv1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangodeploymentreplicationsResource, c.ns, name), &replicationv1.ArangoDeploymentReplication{}) @@ -54,7 +56,7 @@ func (c *FakeArangoDeploymentReplications) Get(name string, options v1.GetOption } // List takes label and field selectors, and returns the list of ArangoDeploymentReplications that match those selectors. -func (c *FakeArangoDeploymentReplications) List(opts v1.ListOptions) (result *replicationv1.ArangoDeploymentReplicationList, err error) { +func (c *FakeArangoDeploymentReplications) List(ctx context.Context, opts v1.ListOptions) (result *replicationv1.ArangoDeploymentReplicationList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangodeploymentreplicationsResource, arangodeploymentreplicationsKind, c.ns, opts), &replicationv1.ArangoDeploymentReplicationList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoDeploymentReplications) List(opts v1.ListOptions) (result *re } // Watch returns a watch.Interface that watches the requested arangoDeploymentReplications. -func (c *FakeArangoDeploymentReplications) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoDeploymentReplications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangodeploymentreplicationsResource, c.ns, opts)) } // Create takes the representation of a arangoDeploymentReplication and creates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *FakeArangoDeploymentReplications) Create(arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication) (result *replicationv1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Create(ctx context.Context, arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication, opts v1.CreateOptions) (result *replicationv1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangodeploymentreplicationsResource, c.ns, arangoDeploymentReplication), &replicationv1.ArangoDeploymentReplication{}) @@ -94,7 +96,7 @@ func (c *FakeArangoDeploymentReplications) Create(arangoDeploymentReplication *r } // Update takes the representation of a arangoDeploymentReplication and updates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *FakeArangoDeploymentReplications) Update(arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication) (result *replicationv1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Update(ctx context.Context, arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication, opts v1.UpdateOptions) (result *replicationv1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangodeploymentreplicationsResource, c.ns, arangoDeploymentReplication), &replicationv1.ArangoDeploymentReplication{}) @@ -106,7 +108,7 @@ func (c *FakeArangoDeploymentReplications) Update(arangoDeploymentReplication *r // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoDeploymentReplications) UpdateStatus(arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication) (*replicationv1.ArangoDeploymentReplication, error) { +func (c *FakeArangoDeploymentReplications) UpdateStatus(ctx context.Context, arangoDeploymentReplication *replicationv1.ArangoDeploymentReplication, opts v1.UpdateOptions) (*replicationv1.ArangoDeploymentReplication, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangodeploymentreplicationsResource, "status", c.ns, arangoDeploymentReplication), &replicationv1.ArangoDeploymentReplication{}) @@ -117,7 +119,7 @@ func (c *FakeArangoDeploymentReplications) UpdateStatus(arangoDeploymentReplicat } // Delete takes name of the arangoDeploymentReplication and deletes it. Returns an error if one occurs. -func (c *FakeArangoDeploymentReplications) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoDeploymentReplications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangodeploymentreplicationsResource, c.ns, name), &replicationv1.ArangoDeploymentReplication{}) @@ -125,15 +127,15 @@ func (c *FakeArangoDeploymentReplications) Delete(name string, options *v1.Delet } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoDeploymentReplications) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangodeploymentreplicationsResource, c.ns, listOptions) +func (c *FakeArangoDeploymentReplications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangodeploymentreplicationsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &replicationv1.ArangoDeploymentReplicationList{}) return err } // Patch applies the patch and returns the patched arangoDeploymentReplication. -func (c *FakeArangoDeploymentReplications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *replicationv1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *replicationv1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangodeploymentreplicationsResource, c.ns, name, pt, data, subresources...), &replicationv1.ArangoDeploymentReplication{}) diff --git a/pkg/generated/clientset/versioned/typed/replication/v2alpha1/arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v2alpha1/arangodeploymentreplication.go index d887da973..c82ddfc17 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v2alpha1/arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v2alpha1/arangodeploymentreplication.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" "time" v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" @@ -41,15 +42,15 @@ type ArangoDeploymentReplicationsGetter interface { // ArangoDeploymentReplicationInterface has methods to work with ArangoDeploymentReplication resources. type ArangoDeploymentReplicationInterface interface { - Create(*v2alpha1.ArangoDeploymentReplication) (*v2alpha1.ArangoDeploymentReplication, error) - Update(*v2alpha1.ArangoDeploymentReplication) (*v2alpha1.ArangoDeploymentReplication, error) - UpdateStatus(*v2alpha1.ArangoDeploymentReplication) (*v2alpha1.ArangoDeploymentReplication, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2alpha1.ArangoDeploymentReplication, error) - List(opts v1.ListOptions) (*v2alpha1.ArangoDeploymentReplicationList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeploymentReplication, err error) + Create(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.CreateOptions) (*v2alpha1.ArangoDeploymentReplication, error) + Update(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (*v2alpha1.ArangoDeploymentReplication, error) + UpdateStatus(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (*v2alpha1.ArangoDeploymentReplication, 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) (*v2alpha1.ArangoDeploymentReplication, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.ArangoDeploymentReplicationList, 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 *v2alpha1.ArangoDeploymentReplication, err error) ArangoDeploymentReplicationExpansion } @@ -68,20 +69,20 @@ func newArangoDeploymentReplications(c *ReplicationV2alpha1Client, namespace str } // Get takes name of the arangoDeploymentReplication, and returns the corresponding arangoDeploymentReplication object, and an error if there is any. -func (c *arangoDeploymentReplications) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { result = &v2alpha1.ArangoDeploymentReplication{} err = c.client.Get(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoDeploymentReplications that match those selectors. -func (c *arangoDeploymentReplications) List(opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentReplicationList, err error) { +func (c *arangoDeploymentReplications) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentReplicationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *arangoDeploymentReplications) List(opts v1.ListOptions) (result *v2alph Resource("arangodeploymentreplications"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoDeploymentReplications. -func (c *arangoDeploymentReplications) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *arangoDeploymentReplications) 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 @@ -109,87 +110,90 @@ func (c *arangoDeploymentReplications) Watch(opts v1.ListOptions) (watch.Interfa Resource("arangodeploymentreplications"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoDeploymentReplication and creates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *arangoDeploymentReplications) Create(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Create(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.CreateOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { result = &v2alpha1.ArangoDeploymentReplication{} err = c.client.Post(). Namespace(c.ns). Resource("arangodeploymentreplications"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoDeploymentReplication and updates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *arangoDeploymentReplications) Update(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Update(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { result = &v2alpha1.ArangoDeploymentReplication{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(arangoDeploymentReplication.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - 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 *arangoDeploymentReplications) UpdateStatus(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) UpdateStatus(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { result = &v2alpha1.ArangoDeploymentReplication{} err = c.client.Put(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(arangoDeploymentReplication.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoDeploymentReplication). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoDeploymentReplication and deletes it. Returns an error if one occurs. -func (c *arangoDeploymentReplications) Delete(name string, options *v1.DeleteOptions) error { +func (c *arangoDeploymentReplications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("arangodeploymentreplications"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoDeploymentReplications) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *arangoDeploymentReplications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("arangodeploymentreplications"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoDeploymentReplication. -func (c *arangoDeploymentReplications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *arangoDeploymentReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoDeploymentReplication, err error) { result = &v2alpha1.ArangoDeploymentReplication{} err = c.client.Patch(pt). Namespace(c.ns). Resource("arangodeploymentreplications"). - 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/replication/v2alpha1/fake/fake_arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v2alpha1/fake/fake_arangodeploymentreplication.go index 4d70028d1..c04f8e856 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v2alpha1/fake/fake_arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v2alpha1/fake/fake_arangodeploymentreplication.go @@ -23,6 +23,8 @@ package fake import ( + "context" + v2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -43,7 +45,7 @@ var arangodeploymentreplicationsResource = schema.GroupVersionResource{Group: "r var arangodeploymentreplicationsKind = schema.GroupVersionKind{Group: "replication.database.arangodb.com", Version: "v2alpha1", Kind: "ArangoDeploymentReplication"} // Get takes name of the arangoDeploymentReplication, and returns the corresponding arangoDeploymentReplication object, and an error if there is any. -func (c *FakeArangoDeploymentReplications) Get(name string, options v1.GetOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(arangodeploymentreplicationsResource, c.ns, name), &v2alpha1.ArangoDeploymentReplication{}) @@ -54,7 +56,7 @@ func (c *FakeArangoDeploymentReplications) Get(name string, options v1.GetOption } // List takes label and field selectors, and returns the list of ArangoDeploymentReplications that match those selectors. -func (c *FakeArangoDeploymentReplications) List(opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentReplicationList, err error) { +func (c *FakeArangoDeploymentReplications) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.ArangoDeploymentReplicationList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(arangodeploymentreplicationsResource, arangodeploymentreplicationsKind, c.ns, opts), &v2alpha1.ArangoDeploymentReplicationList{}) @@ -76,14 +78,14 @@ func (c *FakeArangoDeploymentReplications) List(opts v1.ListOptions) (result *v2 } // Watch returns a watch.Interface that watches the requested arangoDeploymentReplications. -func (c *FakeArangoDeploymentReplications) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoDeploymentReplications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(arangodeploymentreplicationsResource, c.ns, opts)) } // Create takes the representation of a arangoDeploymentReplication and creates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *FakeArangoDeploymentReplications) Create(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Create(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.CreateOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(arangodeploymentreplicationsResource, c.ns, arangoDeploymentReplication), &v2alpha1.ArangoDeploymentReplication{}) @@ -94,7 +96,7 @@ func (c *FakeArangoDeploymentReplications) Create(arangoDeploymentReplication *v } // Update takes the representation of a arangoDeploymentReplication and updates it. Returns the server's representation of the arangoDeploymentReplication, and an error, if there is any. -func (c *FakeArangoDeploymentReplications) Update(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Update(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (result *v2alpha1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(arangodeploymentreplicationsResource, c.ns, arangoDeploymentReplication), &v2alpha1.ArangoDeploymentReplication{}) @@ -106,7 +108,7 @@ func (c *FakeArangoDeploymentReplications) Update(arangoDeploymentReplication *v // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoDeploymentReplications) UpdateStatus(arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication) (*v2alpha1.ArangoDeploymentReplication, error) { +func (c *FakeArangoDeploymentReplications) UpdateStatus(ctx context.Context, arangoDeploymentReplication *v2alpha1.ArangoDeploymentReplication, opts v1.UpdateOptions) (*v2alpha1.ArangoDeploymentReplication, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(arangodeploymentreplicationsResource, "status", c.ns, arangoDeploymentReplication), &v2alpha1.ArangoDeploymentReplication{}) @@ -117,7 +119,7 @@ func (c *FakeArangoDeploymentReplications) UpdateStatus(arangoDeploymentReplicat } // Delete takes name of the arangoDeploymentReplication and deletes it. Returns an error if one occurs. -func (c *FakeArangoDeploymentReplications) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoDeploymentReplications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(arangodeploymentreplicationsResource, c.ns, name), &v2alpha1.ArangoDeploymentReplication{}) @@ -125,15 +127,15 @@ func (c *FakeArangoDeploymentReplications) Delete(name string, options *v1.Delet } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoDeploymentReplications) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(arangodeploymentreplicationsResource, c.ns, listOptions) +func (c *FakeArangoDeploymentReplications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(arangodeploymentreplicationsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v2alpha1.ArangoDeploymentReplicationList{}) return err } // Patch applies the patch and returns the patched arangoDeploymentReplication. -func (c *FakeArangoDeploymentReplications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.ArangoDeploymentReplication, err error) { +func (c *FakeArangoDeploymentReplications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.ArangoDeploymentReplication, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(arangodeploymentreplicationsResource, c.ns, name, pt, data, subresources...), &v2alpha1.ArangoDeploymentReplication{}) diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go index 4e3c7c153..76a6bd0c2 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go @@ -23,6 +23,7 @@ package v1alpha import ( + "context" "time" v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" @@ -41,15 +42,15 @@ type ArangoLocalStoragesGetter interface { // ArangoLocalStorageInterface has methods to work with ArangoLocalStorage resources. type ArangoLocalStorageInterface interface { - Create(*v1alpha.ArangoLocalStorage) (*v1alpha.ArangoLocalStorage, error) - Update(*v1alpha.ArangoLocalStorage) (*v1alpha.ArangoLocalStorage, error) - UpdateStatus(*v1alpha.ArangoLocalStorage) (*v1alpha.ArangoLocalStorage, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha.ArangoLocalStorage, error) - List(opts v1.ListOptions) (*v1alpha.ArangoLocalStorageList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoLocalStorage, err error) + Create(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.CreateOptions) (*v1alpha.ArangoLocalStorage, error) + Update(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (*v1alpha.ArangoLocalStorage, error) + UpdateStatus(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (*v1alpha.ArangoLocalStorage, 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) (*v1alpha.ArangoLocalStorage, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha.ArangoLocalStorageList, 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 *v1alpha.ArangoLocalStorage, err error) ArangoLocalStorageExpansion } @@ -66,19 +67,19 @@ func newArangoLocalStorages(c *StorageV1alphaClient) *arangoLocalStorages { } // Get takes name of the arangoLocalStorage, and returns the corresponding arangoLocalStorage object, and an error if there is any. -func (c *arangoLocalStorages) Get(name string, options v1.GetOptions) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *arangoLocalStorages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha.ArangoLocalStorage, err error) { result = &v1alpha.ArangoLocalStorage{} err = c.client.Get(). Resource("arangolocalstorages"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ArangoLocalStorages that match those selectors. -func (c *arangoLocalStorages) List(opts v1.ListOptions) (result *v1alpha.ArangoLocalStorageList, err error) { +func (c *arangoLocalStorages) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha.ArangoLocalStorageList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *arangoLocalStorages) List(opts v1.ListOptions) (result *v1alpha.ArangoL Resource("arangolocalstorages"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested arangoLocalStorages. -func (c *arangoLocalStorages) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *arangoLocalStorages) 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 @@ -104,81 +105,84 @@ func (c *arangoLocalStorages) Watch(opts v1.ListOptions) (watch.Interface, error Resource("arangolocalstorages"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a arangoLocalStorage and creates it. Returns the server's representation of the arangoLocalStorage, and an error, if there is any. -func (c *arangoLocalStorages) Create(arangoLocalStorage *v1alpha.ArangoLocalStorage) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *arangoLocalStorages) Create(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.CreateOptions) (result *v1alpha.ArangoLocalStorage, err error) { result = &v1alpha.ArangoLocalStorage{} err = c.client.Post(). Resource("arangolocalstorages"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoLocalStorage). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a arangoLocalStorage and updates it. Returns the server's representation of the arangoLocalStorage, and an error, if there is any. -func (c *arangoLocalStorages) Update(arangoLocalStorage *v1alpha.ArangoLocalStorage) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *arangoLocalStorages) Update(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (result *v1alpha.ArangoLocalStorage, err error) { result = &v1alpha.ArangoLocalStorage{} err = c.client.Put(). Resource("arangolocalstorages"). Name(arangoLocalStorage.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoLocalStorage). - 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 *arangoLocalStorages) UpdateStatus(arangoLocalStorage *v1alpha.ArangoLocalStorage) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *arangoLocalStorages) UpdateStatus(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (result *v1alpha.ArangoLocalStorage, err error) { result = &v1alpha.ArangoLocalStorage{} err = c.client.Put(). Resource("arangolocalstorages"). Name(arangoLocalStorage.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(arangoLocalStorage). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the arangoLocalStorage and deletes it. Returns an error if one occurs. -func (c *arangoLocalStorages) Delete(name string, options *v1.DeleteOptions) error { +func (c *arangoLocalStorages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("arangolocalstorages"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *arangoLocalStorages) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *arangoLocalStorages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("arangolocalstorages"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched arangoLocalStorage. -func (c *arangoLocalStorages) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *arangoLocalStorages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha.ArangoLocalStorage, err error) { result = &v1alpha.ArangoLocalStorage{} err = c.client.Patch(pt). Resource("arangolocalstorages"). - 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/storage/v1alpha/fake/fake_arangolocalstorage.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go index 62ad68b43..a9ef8fc67 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go @@ -23,6 +23,8 @@ package fake import ( + "context" + v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -42,7 +44,7 @@ var arangolocalstoragesResource = schema.GroupVersionResource{Group: "storage.ar var arangolocalstoragesKind = schema.GroupVersionKind{Group: "storage.arangodb.com", Version: "v1alpha", Kind: "ArangoLocalStorage"} // Get takes name of the arangoLocalStorage, and returns the corresponding arangoLocalStorage object, and an error if there is any. -func (c *FakeArangoLocalStorages) Get(name string, options v1.GetOptions) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *FakeArangoLocalStorages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha.ArangoLocalStorage, err error) { obj, err := c.Fake. Invokes(testing.NewRootGetAction(arangolocalstoragesResource, name), &v1alpha.ArangoLocalStorage{}) if obj == nil { @@ -52,7 +54,7 @@ func (c *FakeArangoLocalStorages) Get(name string, options v1.GetOptions) (resul } // List takes label and field selectors, and returns the list of ArangoLocalStorages that match those selectors. -func (c *FakeArangoLocalStorages) List(opts v1.ListOptions) (result *v1alpha.ArangoLocalStorageList, err error) { +func (c *FakeArangoLocalStorages) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha.ArangoLocalStorageList, err error) { obj, err := c.Fake. Invokes(testing.NewRootListAction(arangolocalstoragesResource, arangolocalstoragesKind, opts), &v1alpha.ArangoLocalStorageList{}) if obj == nil { @@ -73,13 +75,13 @@ func (c *FakeArangoLocalStorages) List(opts v1.ListOptions) (result *v1alpha.Ara } // Watch returns a watch.Interface that watches the requested arangoLocalStorages. -func (c *FakeArangoLocalStorages) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeArangoLocalStorages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(arangolocalstoragesResource, opts)) } // Create takes the representation of a arangoLocalStorage and creates it. Returns the server's representation of the arangoLocalStorage, and an error, if there is any. -func (c *FakeArangoLocalStorages) Create(arangoLocalStorage *v1alpha.ArangoLocalStorage) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *FakeArangoLocalStorages) Create(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.CreateOptions) (result *v1alpha.ArangoLocalStorage, err error) { obj, err := c.Fake. Invokes(testing.NewRootCreateAction(arangolocalstoragesResource, arangoLocalStorage), &v1alpha.ArangoLocalStorage{}) if obj == nil { @@ -89,7 +91,7 @@ func (c *FakeArangoLocalStorages) Create(arangoLocalStorage *v1alpha.ArangoLocal } // Update takes the representation of a arangoLocalStorage and updates it. Returns the server's representation of the arangoLocalStorage, and an error, if there is any. -func (c *FakeArangoLocalStorages) Update(arangoLocalStorage *v1alpha.ArangoLocalStorage) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *FakeArangoLocalStorages) Update(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (result *v1alpha.ArangoLocalStorage, err error) { obj, err := c.Fake. Invokes(testing.NewRootUpdateAction(arangolocalstoragesResource, arangoLocalStorage), &v1alpha.ArangoLocalStorage{}) if obj == nil { @@ -100,7 +102,7 @@ func (c *FakeArangoLocalStorages) Update(arangoLocalStorage *v1alpha.ArangoLocal // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeArangoLocalStorages) UpdateStatus(arangoLocalStorage *v1alpha.ArangoLocalStorage) (*v1alpha.ArangoLocalStorage, error) { +func (c *FakeArangoLocalStorages) UpdateStatus(ctx context.Context, arangoLocalStorage *v1alpha.ArangoLocalStorage, opts v1.UpdateOptions) (*v1alpha.ArangoLocalStorage, error) { obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceAction(arangolocalstoragesResource, "status", arangoLocalStorage), &v1alpha.ArangoLocalStorage{}) if obj == nil { @@ -110,22 +112,22 @@ func (c *FakeArangoLocalStorages) UpdateStatus(arangoLocalStorage *v1alpha.Arang } // Delete takes name of the arangoLocalStorage and deletes it. Returns an error if one occurs. -func (c *FakeArangoLocalStorages) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeArangoLocalStorages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(arangolocalstoragesResource, name), &v1alpha.ArangoLocalStorage{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeArangoLocalStorages) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(arangolocalstoragesResource, listOptions) +func (c *FakeArangoLocalStorages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(arangolocalstoragesResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha.ArangoLocalStorageList{}) return err } // Patch applies the patch and returns the patched arangoLocalStorage. -func (c *FakeArangoLocalStorages) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha.ArangoLocalStorage, err error) { +func (c *FakeArangoLocalStorages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha.ArangoLocalStorage, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(arangolocalstoragesResource, name, pt, data, subresources...), &v1alpha.ArangoLocalStorage{}) if obj == nil { diff --git a/pkg/generated/informers/externalversions/backup/v1/arangobackup.go b/pkg/generated/informers/externalversions/backup/v1/arangobackup.go index 45b104c4f..8dc5557e8 100644 --- a/pkg/generated/informers/externalversions/backup/v1/arangobackup.go +++ b/pkg/generated/informers/externalversions/backup/v1/arangobackup.go @@ -23,6 +23,7 @@ package v1 import ( + "context" time "time" backupv1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" @@ -65,13 +66,13 @@ func NewFilteredArangoBackupInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.BackupV1().ArangoBackups(namespace).List(options) + return client.BackupV1().ArangoBackups(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BackupV1().ArangoBackups(namespace).Watch(options) + return client.BackupV1().ArangoBackups(namespace).Watch(context.TODO(), options) }, }, &backupv1.ArangoBackup{}, diff --git a/pkg/generated/informers/externalversions/backup/v1/arangobackuppolicy.go b/pkg/generated/informers/externalversions/backup/v1/arangobackuppolicy.go index 0102f0b0f..f5e65a0bd 100644 --- a/pkg/generated/informers/externalversions/backup/v1/arangobackuppolicy.go +++ b/pkg/generated/informers/externalversions/backup/v1/arangobackuppolicy.go @@ -23,6 +23,7 @@ package v1 import ( + "context" time "time" backupv1 "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1" @@ -65,13 +66,13 @@ func NewFilteredArangoBackupPolicyInformer(client versioned.Interface, namespace if tweakListOptions != nil { tweakListOptions(&options) } - return client.BackupV1().ArangoBackupPolicies(namespace).List(options) + return client.BackupV1().ArangoBackupPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BackupV1().ArangoBackupPolicies(namespace).Watch(options) + return client.BackupV1().ArangoBackupPolicies(namespace).Watch(context.TODO(), options) }, }, &backupv1.ArangoBackupPolicy{}, diff --git a/pkg/generated/informers/externalversions/deployment/v1/arangodeployment.go b/pkg/generated/informers/externalversions/deployment/v1/arangodeployment.go index 1159ce4b4..00fcbed9d 100644 --- a/pkg/generated/informers/externalversions/deployment/v1/arangodeployment.go +++ b/pkg/generated/informers/externalversions/deployment/v1/arangodeployment.go @@ -23,6 +23,7 @@ package v1 import ( + "context" time "time" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -65,13 +66,13 @@ func NewFilteredArangoDeploymentInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV1().ArangoDeployments(namespace).List(options) + return client.DatabaseV1().ArangoDeployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV1().ArangoDeployments(namespace).Watch(options) + return client.DatabaseV1().ArangoDeployments(namespace).Watch(context.TODO(), options) }, }, &deploymentv1.ArangoDeployment{}, diff --git a/pkg/generated/informers/externalversions/deployment/v1/arangomember.go b/pkg/generated/informers/externalversions/deployment/v1/arangomember.go index 82e355cd4..a436aa3d3 100644 --- a/pkg/generated/informers/externalversions/deployment/v1/arangomember.go +++ b/pkg/generated/informers/externalversions/deployment/v1/arangomember.go @@ -23,6 +23,7 @@ package v1 import ( + "context" time "time" deploymentv1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -65,13 +66,13 @@ func NewFilteredArangoMemberInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV1().ArangoMembers(namespace).List(options) + return client.DatabaseV1().ArangoMembers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV1().ArangoMembers(namespace).Watch(options) + return client.DatabaseV1().ArangoMembers(namespace).Watch(context.TODO(), options) }, }, &deploymentv1.ArangoMember{}, diff --git a/pkg/generated/informers/externalversions/deployment/v2alpha1/arangodeployment.go b/pkg/generated/informers/externalversions/deployment/v2alpha1/arangodeployment.go index eb27436d9..ee2278f2a 100644 --- a/pkg/generated/informers/externalversions/deployment/v2alpha1/arangodeployment.go +++ b/pkg/generated/informers/externalversions/deployment/v2alpha1/arangodeployment.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" time "time" deploymentv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" @@ -65,13 +66,13 @@ func NewFilteredArangoDeploymentInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV2alpha1().ArangoDeployments(namespace).List(options) + return client.DatabaseV2alpha1().ArangoDeployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV2alpha1().ArangoDeployments(namespace).Watch(options) + return client.DatabaseV2alpha1().ArangoDeployments(namespace).Watch(context.TODO(), options) }, }, &deploymentv2alpha1.ArangoDeployment{}, diff --git a/pkg/generated/informers/externalversions/deployment/v2alpha1/arangomember.go b/pkg/generated/informers/externalversions/deployment/v2alpha1/arangomember.go index fae37046f..1d11b8044 100644 --- a/pkg/generated/informers/externalversions/deployment/v2alpha1/arangomember.go +++ b/pkg/generated/informers/externalversions/deployment/v2alpha1/arangomember.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" time "time" deploymentv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v2alpha1" @@ -65,13 +66,13 @@ func NewFilteredArangoMemberInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV2alpha1().ArangoMembers(namespace).List(options) + return client.DatabaseV2alpha1().ArangoMembers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DatabaseV2alpha1().ArangoMembers(namespace).Watch(options) + return client.DatabaseV2alpha1().ArangoMembers(namespace).Watch(context.TODO(), options) }, }, &deploymentv2alpha1.ArangoMember{}, diff --git a/pkg/generated/informers/externalversions/replication/v1/arangodeploymentreplication.go b/pkg/generated/informers/externalversions/replication/v1/arangodeploymentreplication.go index d0bb785fa..bbcacabeb 100644 --- a/pkg/generated/informers/externalversions/replication/v1/arangodeploymentreplication.go +++ b/pkg/generated/informers/externalversions/replication/v1/arangodeploymentreplication.go @@ -23,6 +23,7 @@ package v1 import ( + "context" time "time" replicationv1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1" @@ -65,13 +66,13 @@ func NewFilteredArangoDeploymentReplicationInformer(client versioned.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.ReplicationV1().ArangoDeploymentReplications(namespace).List(options) + return client.ReplicationV1().ArangoDeploymentReplications(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ReplicationV1().ArangoDeploymentReplications(namespace).Watch(options) + return client.ReplicationV1().ArangoDeploymentReplications(namespace).Watch(context.TODO(), options) }, }, &replicationv1.ArangoDeploymentReplication{}, diff --git a/pkg/generated/informers/externalversions/replication/v2alpha1/arangodeploymentreplication.go b/pkg/generated/informers/externalversions/replication/v2alpha1/arangodeploymentreplication.go index 38d251d56..302cb3228 100644 --- a/pkg/generated/informers/externalversions/replication/v2alpha1/arangodeploymentreplication.go +++ b/pkg/generated/informers/externalversions/replication/v2alpha1/arangodeploymentreplication.go @@ -23,6 +23,7 @@ package v2alpha1 import ( + "context" time "time" replicationv2alpha1 "github.com/arangodb/kube-arangodb/pkg/apis/replication/v2alpha1" @@ -65,13 +66,13 @@ func NewFilteredArangoDeploymentReplicationInformer(client versioned.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.ReplicationV2alpha1().ArangoDeploymentReplications(namespace).List(options) + return client.ReplicationV2alpha1().ArangoDeploymentReplications(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ReplicationV2alpha1().ArangoDeploymentReplications(namespace).Watch(options) + return client.ReplicationV2alpha1().ArangoDeploymentReplications(namespace).Watch(context.TODO(), options) }, }, &replicationv2alpha1.ArangoDeploymentReplication{}, diff --git a/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go b/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go index 1683b36ef..abbb22de9 100644 --- a/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go @@ -23,6 +23,7 @@ package v1alpha import ( + "context" time "time" storagev1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" @@ -64,13 +65,13 @@ func NewFilteredArangoLocalStorageInformer(client versioned.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha().ArangoLocalStorages().List(options) + return client.StorageV1alpha().ArangoLocalStorages().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha().ArangoLocalStorages().Watch(options) + return client.StorageV1alpha().ArangoLocalStorages().Watch(context.TODO(), options) }, }, &storagev1alpha.ArangoLocalStorage{}, diff --git a/pkg/generated/listers/backup/v1/arangobackup.go b/pkg/generated/listers/backup/v1/arangobackup.go index 745db3377..3468b086b 100644 --- a/pkg/generated/listers/backup/v1/arangobackup.go +++ b/pkg/generated/listers/backup/v1/arangobackup.go @@ -30,8 +30,10 @@ import ( ) // ArangoBackupLister helps list ArangoBackups. +// All objects returned here must be treated as read-only. type ArangoBackupLister interface { // List lists all ArangoBackups in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoBackup, err error) // ArangoBackups returns an object that can list and get ArangoBackups. ArangoBackups(namespace string) ArangoBackupNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoBackupLister) ArangoBackups(namespace string) ArangoBackupNamespa } // ArangoBackupNamespaceLister helps list and get ArangoBackups. +// All objects returned here must be treated as read-only. type ArangoBackupNamespaceLister interface { // List lists all ArangoBackups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoBackup, err error) // Get retrieves the ArangoBackup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.ArangoBackup, error) ArangoBackupNamespaceListerExpansion } diff --git a/pkg/generated/listers/backup/v1/arangobackuppolicy.go b/pkg/generated/listers/backup/v1/arangobackuppolicy.go index 199b6eb69..094dedcfc 100644 --- a/pkg/generated/listers/backup/v1/arangobackuppolicy.go +++ b/pkg/generated/listers/backup/v1/arangobackuppolicy.go @@ -30,8 +30,10 @@ import ( ) // ArangoBackupPolicyLister helps list ArangoBackupPolicies. +// All objects returned here must be treated as read-only. type ArangoBackupPolicyLister interface { // List lists all ArangoBackupPolicies in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoBackupPolicy, err error) // ArangoBackupPolicies returns an object that can list and get ArangoBackupPolicies. ArangoBackupPolicies(namespace string) ArangoBackupPolicyNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoBackupPolicyLister) ArangoBackupPolicies(namespace string) Arango } // ArangoBackupPolicyNamespaceLister helps list and get ArangoBackupPolicies. +// All objects returned here must be treated as read-only. type ArangoBackupPolicyNamespaceLister interface { // List lists all ArangoBackupPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoBackupPolicy, err error) // Get retrieves the ArangoBackupPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.ArangoBackupPolicy, error) ArangoBackupPolicyNamespaceListerExpansion } diff --git a/pkg/generated/listers/deployment/v1/arangodeployment.go b/pkg/generated/listers/deployment/v1/arangodeployment.go index 288ca418b..00e4d55df 100644 --- a/pkg/generated/listers/deployment/v1/arangodeployment.go +++ b/pkg/generated/listers/deployment/v1/arangodeployment.go @@ -30,8 +30,10 @@ import ( ) // ArangoDeploymentLister helps list ArangoDeployments. +// All objects returned here must be treated as read-only. type ArangoDeploymentLister interface { // List lists all ArangoDeployments in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoDeployment, err error) // ArangoDeployments returns an object that can list and get ArangoDeployments. ArangoDeployments(namespace string) ArangoDeploymentNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoDeploymentLister) ArangoDeployments(namespace string) ArangoDeplo } // ArangoDeploymentNamespaceLister helps list and get ArangoDeployments. +// All objects returned here must be treated as read-only. type ArangoDeploymentNamespaceLister interface { // List lists all ArangoDeployments in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoDeployment, err error) // Get retrieves the ArangoDeployment from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.ArangoDeployment, error) ArangoDeploymentNamespaceListerExpansion } diff --git a/pkg/generated/listers/deployment/v1/arangomember.go b/pkg/generated/listers/deployment/v1/arangomember.go index b686ec6ed..c27a57bdf 100644 --- a/pkg/generated/listers/deployment/v1/arangomember.go +++ b/pkg/generated/listers/deployment/v1/arangomember.go @@ -30,8 +30,10 @@ import ( ) // ArangoMemberLister helps list ArangoMembers. +// All objects returned here must be treated as read-only. type ArangoMemberLister interface { // List lists all ArangoMembers in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoMember, err error) // ArangoMembers returns an object that can list and get ArangoMembers. ArangoMembers(namespace string) ArangoMemberNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoMemberLister) ArangoMembers(namespace string) ArangoMemberNamespa } // ArangoMemberNamespaceLister helps list and get ArangoMembers. +// All objects returned here must be treated as read-only. type ArangoMemberNamespaceLister interface { // List lists all ArangoMembers in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoMember, err error) // Get retrieves the ArangoMember from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.ArangoMember, error) ArangoMemberNamespaceListerExpansion } diff --git a/pkg/generated/listers/deployment/v2alpha1/arangodeployment.go b/pkg/generated/listers/deployment/v2alpha1/arangodeployment.go index a15adf825..12c10079c 100644 --- a/pkg/generated/listers/deployment/v2alpha1/arangodeployment.go +++ b/pkg/generated/listers/deployment/v2alpha1/arangodeployment.go @@ -30,8 +30,10 @@ import ( ) // ArangoDeploymentLister helps list ArangoDeployments. +// All objects returned here must be treated as read-only. type ArangoDeploymentLister interface { // List lists all ArangoDeployments in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoDeployment, err error) // ArangoDeployments returns an object that can list and get ArangoDeployments. ArangoDeployments(namespace string) ArangoDeploymentNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoDeploymentLister) ArangoDeployments(namespace string) ArangoDeplo } // ArangoDeploymentNamespaceLister helps list and get ArangoDeployments. +// All objects returned here must be treated as read-only. type ArangoDeploymentNamespaceLister interface { // List lists all ArangoDeployments in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoDeployment, err error) // Get retrieves the ArangoDeployment from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v2alpha1.ArangoDeployment, error) ArangoDeploymentNamespaceListerExpansion } diff --git a/pkg/generated/listers/deployment/v2alpha1/arangomember.go b/pkg/generated/listers/deployment/v2alpha1/arangomember.go index 71d700da2..62e712e2c 100644 --- a/pkg/generated/listers/deployment/v2alpha1/arangomember.go +++ b/pkg/generated/listers/deployment/v2alpha1/arangomember.go @@ -30,8 +30,10 @@ import ( ) // ArangoMemberLister helps list ArangoMembers. +// All objects returned here must be treated as read-only. type ArangoMemberLister interface { // List lists all ArangoMembers in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoMember, err error) // ArangoMembers returns an object that can list and get ArangoMembers. ArangoMembers(namespace string) ArangoMemberNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoMemberLister) ArangoMembers(namespace string) ArangoMemberNamespa } // ArangoMemberNamespaceLister helps list and get ArangoMembers. +// All objects returned here must be treated as read-only. type ArangoMemberNamespaceLister interface { // List lists all ArangoMembers in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoMember, err error) // Get retrieves the ArangoMember from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v2alpha1.ArangoMember, error) ArangoMemberNamespaceListerExpansion } diff --git a/pkg/generated/listers/replication/v1/arangodeploymentreplication.go b/pkg/generated/listers/replication/v1/arangodeploymentreplication.go index a6f035cd6..eda39aae8 100644 --- a/pkg/generated/listers/replication/v1/arangodeploymentreplication.go +++ b/pkg/generated/listers/replication/v1/arangodeploymentreplication.go @@ -30,8 +30,10 @@ import ( ) // ArangoDeploymentReplicationLister helps list ArangoDeploymentReplications. +// All objects returned here must be treated as read-only. type ArangoDeploymentReplicationLister interface { // List lists all ArangoDeploymentReplications in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoDeploymentReplication, err error) // ArangoDeploymentReplications returns an object that can list and get ArangoDeploymentReplications. ArangoDeploymentReplications(namespace string) ArangoDeploymentReplicationNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoDeploymentReplicationLister) ArangoDeploymentReplications(namespa } // ArangoDeploymentReplicationNamespaceLister helps list and get ArangoDeploymentReplications. +// All objects returned here must be treated as read-only. type ArangoDeploymentReplicationNamespaceLister interface { // List lists all ArangoDeploymentReplications in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.ArangoDeploymentReplication, err error) // Get retrieves the ArangoDeploymentReplication from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.ArangoDeploymentReplication, error) ArangoDeploymentReplicationNamespaceListerExpansion } diff --git a/pkg/generated/listers/replication/v2alpha1/arangodeploymentreplication.go b/pkg/generated/listers/replication/v2alpha1/arangodeploymentreplication.go index 1c90a9e07..a2dc6f85b 100644 --- a/pkg/generated/listers/replication/v2alpha1/arangodeploymentreplication.go +++ b/pkg/generated/listers/replication/v2alpha1/arangodeploymentreplication.go @@ -30,8 +30,10 @@ import ( ) // ArangoDeploymentReplicationLister helps list ArangoDeploymentReplications. +// All objects returned here must be treated as read-only. type ArangoDeploymentReplicationLister interface { // List lists all ArangoDeploymentReplications in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoDeploymentReplication, err error) // ArangoDeploymentReplications returns an object that can list and get ArangoDeploymentReplications. ArangoDeploymentReplications(namespace string) ArangoDeploymentReplicationNamespaceLister @@ -62,10 +64,13 @@ func (s *arangoDeploymentReplicationLister) ArangoDeploymentReplications(namespa } // ArangoDeploymentReplicationNamespaceLister helps list and get ArangoDeploymentReplications. +// All objects returned here must be treated as read-only. type ArangoDeploymentReplicationNamespaceLister interface { // List lists all ArangoDeploymentReplications in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v2alpha1.ArangoDeploymentReplication, err error) // Get retrieves the ArangoDeploymentReplication from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v2alpha1.ArangoDeploymentReplication, error) ArangoDeploymentReplicationNamespaceListerExpansion } diff --git a/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go b/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go index 8ada94b46..06ecb8bc2 100644 --- a/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go @@ -30,10 +30,13 @@ import ( ) // ArangoLocalStorageLister helps list ArangoLocalStorages. +// All objects returned here must be treated as read-only. type ArangoLocalStorageLister interface { // List lists all ArangoLocalStorages in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha.ArangoLocalStorage, err error) // Get retrieves the ArangoLocalStorage from the index for a given name. + // Objects returned here must be treated as read-only. Get(name string) (*v1alpha.ArangoLocalStorage, error) ArangoLocalStorageListerExpansion } diff --git a/pkg/operator/crd.go b/pkg/operator/crd.go index e7d778476..c2dcdb81b 100644 --- a/pkg/operator/crd.go +++ b/pkg/operator/crd.go @@ -23,6 +23,8 @@ package operator import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/apis/backup" "github.com/arangodb/kube-arangodb/pkg/apis/deployment" "github.com/arangodb/kube-arangodb/pkg/apis/replication" @@ -41,7 +43,7 @@ func (o *Operator) waitForCRD(enableDeployment, enableDeploymentReplication, ena if enableDeployment { log.Debug().Msg("Waiting for ArangoDeployment CRD to be ready") if err := crd.WaitReady(func() error { - _, err := o.CRCli.DatabaseV1().ArangoDeployments(o.Namespace).List(meta.ListOptions{}) + _, err := o.CRCli.DatabaseV1().ArangoDeployments(o.Namespace).List(context.Background(), meta.ListOptions{}) return err }); err != nil { return errors.WithStack(err) @@ -51,7 +53,7 @@ func (o *Operator) waitForCRD(enableDeployment, enableDeploymentReplication, ena if enableDeploymentReplication { log.Debug().Msg("Waiting for ArangoDeploymentReplication CRD to be ready") if err := crd.WaitReady(func() error { - _, err := o.CRCli.ReplicationV1().ArangoDeploymentReplications(o.Namespace).List(meta.ListOptions{}) + _, err := o.CRCli.ReplicationV1().ArangoDeploymentReplications(o.Namespace).List(context.Background(), meta.ListOptions{}) return err }); err != nil { return errors.WithStack(err) @@ -61,7 +63,7 @@ func (o *Operator) waitForCRD(enableDeployment, enableDeploymentReplication, ena if enableBackup { log.Debug().Msg("Wait for ArangoBackup CRD to be ready") if err := crd.WaitReady(func() error { - _, err := o.CRCli.BackupV1().ArangoBackups(o.Namespace).List(meta.ListOptions{}) + _, err := o.CRCli.BackupV1().ArangoBackups(o.Namespace).List(context.Background(), meta.ListOptions{}) return err }); err != nil { return errors.WithStack(err) diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 6276d7084..f02621f94 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -29,7 +29,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/operator/scope" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "github.com/arangodb/kube-arangodb/pkg/backup/operator/event" "github.com/arangodb/kube-arangodb/pkg/util/constants" diff --git a/pkg/operator/operator_leader.go b/pkg/operator/operator_leader.go index f11eb31d8..fea1d997a 100644 --- a/pkg/operator/operator_leader.go +++ b/pkg/operator/operator_leader.go @@ -127,7 +127,7 @@ func (o *Operator) getLeaderElectionEventTarget(log zerolog.Logger) runtime.Obje kubecli := o.Dependencies.KubeCli pods := kubecli.CoreV1().Pods(ns) log = log.With().Str("pod-name", o.Config.PodName).Logger() - pod, err := pods.Get(o.Config.PodName, metav1.GetOptions{}) + pod, err := pods.Get(context.Background(), o.Config.PodName, metav1.GetOptions{}) if err != nil { log.Error().Err(err).Msg("Cannot find Pod containing this operator") return nil @@ -161,7 +161,7 @@ func (o *Operator) setRoleLabel(log zerolog.Logger, label, role string) error { pods := kubecli.CoreV1().Pods(ns) log = log.With().Str("pod-name", o.Config.PodName).Logger() op := func() error { - pod, err := pods.Get(o.Config.PodName, metav1.GetOptions{}) + pod, err := pods.Get(context.Background(), o.Config.PodName, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { log.Error().Err(err).Msg("Pod not found, so we cannot set its role label") return retry.Permanent(errors.WithStack(err)) @@ -174,7 +174,7 @@ func (o *Operator) setRoleLabel(log zerolog.Logger, label, role string) error { } labels[label] = role pod.ObjectMeta.SetLabels(labels) - if _, err := pods.Update(pod); k8sutil.IsConflict(err) { + if _, err := pods.Update(context.Background(), pod, metav1.UpdateOptions{}); k8sutil.IsConflict(err) { // Retry it return errors.WithStack(err) } else if err != nil { diff --git a/pkg/operator/server_discovery_api.go b/pkg/operator/server_discovery_api.go index e745a109f..ec201cb85 100644 --- a/pkg/operator/server_discovery_api.go +++ b/pkg/operator/server_discovery_api.go @@ -23,6 +23,7 @@ package operator import ( + "context" "sort" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -53,7 +54,7 @@ func (o *Operator) FindOtherOperators() []server.OperatorReference { log := o.log var result []server.OperatorReference - namespaces, err := o.Dependencies.KubeCli.CoreV1().Namespaces().List(metav1.ListOptions{}) + namespaces, err := o.Dependencies.KubeCli.CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{}) if err != nil { log.Warn().Err(err).Msg("Failed to list namespaces") } else { @@ -95,7 +96,7 @@ func (o *Operator) FindOtherOperators() []server.OperatorReference { func (o *Operator) findOtherOperatorsInNamespace(log zerolog.Logger, namespace string, typePred func(server.OperatorType) bool) []server.OperatorReference { log = log.With().Str("namespace", namespace).Logger() var result []server.OperatorReference - services, err := o.Dependencies.KubeCli.CoreV1().Services(namespace).List(metav1.ListOptions{}) + services, err := o.Dependencies.KubeCli.CoreV1().Services(namespace).List(context.Background(), metav1.ListOptions{}) if err != nil { log.Debug().Err(err).Msg("Failed to list services") return nil @@ -104,7 +105,7 @@ func (o *Operator) findOtherOperatorsInNamespace(log zerolog.Logger, namespace s if o.Scope.IsNamespaced() { return v1.NodeList{}, nil } - result, err := o.Dependencies.KubeCli.CoreV1().Nodes().List(metav1.ListOptions{}) + result, err := o.Dependencies.KubeCli.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{}) if err != nil { return v1.NodeList{}, errors.WithStack(err) } diff --git a/pkg/replication/deployment_replication.go b/pkg/replication/deployment_replication.go index 39e477fd3..126adb093 100644 --- a/pkg/replication/deployment_replication.go +++ b/pkg/replication/deployment_replication.go @@ -23,6 +23,7 @@ package replication import ( + "context" "reflect" "sync/atomic" "time" @@ -194,7 +195,7 @@ func (dr *DeploymentReplication) handleArangoDeploymentReplicationUpdatedEvent(e repls := dr.deps.CRCli.ReplicationV1().ArangoDeploymentReplications(dr.apiObject.GetNamespace()) // Get the most recent version of the deployment replication from the API server - current, err := repls.Get(dr.apiObject.GetName(), metav1.GetOptions{}) + current, err := repls.Get(context.Background(), dr.apiObject.GetName(), metav1.GetOptions{}) if err != nil { log.Debug().Err(err).Msg("Failed to get current version of deployment replication from API server") if k8sutil.IsNotFound(err) { @@ -258,7 +259,7 @@ func (dr *DeploymentReplication) updateCRStatus() error { for { attempt++ update.Status = dr.status - newAPIObject, err := repls.Update(update) + newAPIObject, err := repls.Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object dr.apiObject = newAPIObject @@ -268,7 +269,7 @@ func (dr *DeploymentReplication) updateCRStatus() error { // API object may have been changed already, // Reload api object and try again var current *api.ArangoDeploymentReplication - current, err = repls.Get(update.GetName(), metav1.GetOptions{}) + current, err = repls.Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -295,7 +296,7 @@ func (dr *DeploymentReplication) updateCRSpec(newSpec api.DeploymentReplicationS attempt++ update.Spec = newSpec update.Status = dr.status - newAPIObject, err := repls.Update(update) + newAPIObject, err := repls.Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object dr.apiObject = newAPIObject @@ -305,7 +306,7 @@ func (dr *DeploymentReplication) updateCRSpec(newSpec api.DeploymentReplicationS // API object may have been changed already, // Reload api object and try again var current *api.ArangoDeploymentReplication - current, err = repls.Get(update.GetName(), metav1.GetOptions{}) + current, err = repls.Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -346,7 +347,7 @@ func (dr *DeploymentReplication) reportFailedStatus() { return errors.WithStack(err) } - depl, err := repls.Get(dr.apiObject.Name, metav1.GetOptions{}) + depl, err := repls.Get(context.Background(), dr.apiObject.Name, metav1.GetOptions{}) if err != nil { // Update (PUT) will return conflict even if object is deleted since we have UID set in object. // Because it will check UID first and return something like: diff --git a/pkg/replication/finalizers.go b/pkg/replication/finalizers.go index c5dc9c321..005277dba 100644 --- a/pkg/replication/finalizers.go +++ b/pkg/replication/finalizers.go @@ -101,7 +101,7 @@ func (dr *DeploymentReplication) inspectFinalizerDeplReplStopSync(ctx context.Co abort := dr.status.CancelFailures > maxCancelFailures depls := dr.deps.CRCli.DatabaseV1().ArangoDeployments(p.GetNamespace()) if name := p.Spec.Source.GetDeploymentName(); name != "" { - depl, err := depls.Get(name, metav1.GetOptions{}) + depl, err := depls.Get(context.Background(), name, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { log.Debug().Msg("Source deployment is gone. Abort enabled") abort = true @@ -117,7 +117,7 @@ func (dr *DeploymentReplication) inspectFinalizerDeplReplStopSync(ctx context.Co // Inspect deployment deletion state in destination cleanupSource := false if name := p.Spec.Destination.GetDeploymentName(); name != "" { - depl, err := depls.Get(name, metav1.GetOptions{}) + depl, err := depls.Get(context.Background(), name, metav1.GetOptions{}) if k8sutil.IsNotFound(err) { log.Debug().Msg("Destination deployment is gone. Source cleanup enabled") cleanupSource = true @@ -170,7 +170,7 @@ func (dr *DeploymentReplication) inspectFinalizerDeplReplStopSync(ctx context.Co func removeDeploymentReplicationFinalizers(log zerolog.Logger, crcli versioned.Interface, p *api.ArangoDeploymentReplication, finalizers []string, ignoreNotFound bool) error { repls := crcli.ReplicationV1().ArangoDeploymentReplications(p.GetNamespace()) getFunc := func() (metav1.Object, error) { - result, err := repls.Get(p.GetName(), metav1.GetOptions{}) + result, err := repls.Get(context.Background(), p.GetName(), metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } @@ -178,7 +178,7 @@ func removeDeploymentReplicationFinalizers(log zerolog.Logger, crcli versioned.I } updateFunc := func(updated metav1.Object) error { updatedRepl := updated.(*api.ArangoDeploymentReplication) - result, err := repls.Update(updatedRepl) + result, err := repls.Update(context.Background(), updatedRepl, metav1.UpdateOptions{}) if err != nil { return errors.WithStack(err) } diff --git a/pkg/replication/sync_client.go b/pkg/replication/sync_client.go index 74495bccb..d5dfc1bf5 100644 --- a/pkg/replication/sync_client.go +++ b/pkg/replication/sync_client.go @@ -23,6 +23,7 @@ package replication import ( + "context" "net" "strconv" @@ -108,7 +109,7 @@ func (dr *DeploymentReplication) createArangoSyncEndpoint(epSpec api.EndpointSpe if epSpec.HasDeploymentName() { deploymentName := epSpec.GetDeploymentName() depls := dr.deps.CRCli.DatabaseV1().ArangoDeployments(dr.apiObject.GetNamespace()) - depl, err := depls.Get(deploymentName, metav1.GetOptions{}) + depl, err := depls.Get(context.Background(), deploymentName, metav1.GetOptions{}) if err != nil { dr.deps.Log.Debug().Err(err).Str("deployment", deploymentName).Msg("Failed to get deployment") return nil, errors.WithStack(err) @@ -167,7 +168,7 @@ func (dr *DeploymentReplication) getEndpointSecretNames(epSpec api.EndpointSpec) if epSpec.HasDeploymentName() { deploymentName := epSpec.GetDeploymentName() depls := dr.deps.CRCli.DatabaseV1().ArangoDeployments(dr.apiObject.GetNamespace()) - depl, err := depls.Get(deploymentName, metav1.GetOptions{}) + depl, err := depls.Get(context.Background(), deploymentName, metav1.GetOptions{}) if err != nil { dr.deps.Log.Debug().Err(err).Str("deployment", deploymentName).Msg("Failed to get deployment") return "", "", "", "", errors.WithStack(err) diff --git a/pkg/server/auth.go b/pkg/server/auth.go index 0a40a976b..1634c869f 100644 --- a/pkg/server/auth.go +++ b/pkg/server/auth.go @@ -23,6 +23,7 @@ package server import ( + "context" "net/http" "strings" "sync" @@ -99,7 +100,7 @@ func (s *serverAuthentication) fetchAdminSecret() (string, string, error) { if s.adminSecretName == "" { return "", "", errors.WithStack(errors.Newf("No admin secret name specified")) } - secret, err := s.secrets.Get(s.adminSecretName, metav1.GetOptions{}) + secret, err := s.secrets.Get(context.Background(), s.adminSecretName, metav1.GetOptions{}) if err != nil { return "", "", errors.WithStack(err) } diff --git a/pkg/server/server.go b/pkg/server/server.go index 7c016feb0..1c0841a42 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -23,6 +23,7 @@ package server import ( + "context" "crypto/tls" "net/http" "strings" @@ -105,7 +106,7 @@ func NewServer(cli corev1.CoreV1Interface, cfg Config, deps Dependencies) (*Serv var cert, key string if cfg.TLSSecretName != "" && cfg.TLSSecretNamespace != "" { // Load TLS certificate from secret - s, err := cli.Secrets(cfg.TLSSecretNamespace).Get(cfg.TLSSecretName, metav1.GetOptions{}) + s, err := cli.Secrets(cfg.TLSSecretNamespace).Get(context.Background(), cfg.TLSSecretName, metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } diff --git a/pkg/storage/clients.go b/pkg/storage/clients.go index ddac151dd..bb0eee92e 100644 --- a/pkg/storage/clients.go +++ b/pkg/storage/clients.go @@ -39,7 +39,7 @@ func (ls *LocalStorage) createProvisionerClients() ([]provisioner.API, error) { // Find provisioner endpoints ns := ls.apiObject.GetNamespace() listOptions := k8sutil.LocalStorageListOpt(ls.apiObject.GetName(), roleProvisioner) - items, err := ls.deps.KubeCli.CoreV1().Endpoints(ns).List(listOptions) + items, err := ls.deps.KubeCli.CoreV1().Endpoints(ns).List(context.Background(), listOptions) if err != nil { return nil, errors.WithStack(err) } diff --git a/pkg/storage/daemon_set.go b/pkg/storage/daemon_set.go index bd214f387..80e839288 100644 --- a/pkg/storage/daemon_set.go +++ b/pkg/storage/daemon_set.go @@ -23,6 +23,7 @@ package storage import ( + "context" "fmt" "strconv" @@ -128,7 +129,7 @@ func (ls *LocalStorage) ensureDaemonSet(apiObject *api.ArangoLocalStorage) error // Attach DS to ArangoLocalStorage ds.SetOwnerReferences(append(ds.GetOwnerReferences(), apiObject.AsOwner())) // Create DS - if _, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Create(ds); err != nil { + if _, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Create(context.Background(), ds, meta.CreateOptions{}); err != nil { if k8sutil.IsAlreadyExists(err) { // Already exists, update it } else { @@ -146,14 +147,14 @@ func (ls *LocalStorage) ensureDaemonSet(apiObject *api.ArangoLocalStorage) error attempt++ // Load current DS - current, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Get(ds.GetName(), meta.GetOptions{}) + current, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Get(context.Background(), ds.GetName(), meta.GetOptions{}) if err != nil { return errors.WithStack(err) } // Update it current.Spec = dsSpec - if _, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Update(current); k8sutil.IsConflict(err) && attempt < 10 { + if _, err := ls.deps.KubeCli.AppsV1().DaemonSets(ns).Update(context.Background(), current, meta.UpdateOptions{}); k8sutil.IsConflict(err) && attempt < 10 { // Failed to update, try again continue } else if err != nil { diff --git a/pkg/storage/image.go b/pkg/storage/image.go index 4df805efc..aeba6a6fb 100644 --- a/pkg/storage/image.go +++ b/pkg/storage/image.go @@ -23,6 +23,8 @@ package storage import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,7 +35,7 @@ func (l *LocalStorage) getMyImage() (string, v1.PullPolicy, error) { log := l.deps.Log ns := l.config.Namespace - p, err := l.deps.KubeCli.CoreV1().Pods(ns).Get(l.config.PodName, metav1.GetOptions{}) + p, err := l.deps.KubeCli.CoreV1().Pods(ns).Get(context.Background(), l.config.PodName, metav1.GetOptions{}) if err != nil { log.Debug().Err(err).Str("pod-name", l.config.PodName).Msg("Failed to get my own pod") return "", "", errors.WithStack(err) diff --git a/pkg/storage/local_storage.go b/pkg/storage/local_storage.go index 29a00dd17..a811d3a48 100644 --- a/pkg/storage/local_storage.go +++ b/pkg/storage/local_storage.go @@ -296,7 +296,7 @@ func (ls *LocalStorage) handleArangoLocalStorageUpdatedEvent(event *localStorage log := ls.deps.Log.With().Str("localStorage", event.LocalStorage.GetName()).Logger() // Get the most recent version of the local storage from the API server - current, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(ls.apiObject.GetName(), metav1.GetOptions{}) + current, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(context.Background(), ls.apiObject.GetName(), metav1.GetOptions{}) if err != nil { log.Debug().Err(err).Msg("Failed to get current version of local storage from API server") if k8sutil.IsNotFound(err) { @@ -358,7 +358,7 @@ func (ls *LocalStorage) updateCRStatus() error { for { attempt++ update.Status = ls.status - newAPIObject, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Update(update) + newAPIObject, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object ls.apiObject = newAPIObject @@ -368,7 +368,7 @@ func (ls *LocalStorage) updateCRStatus() error { // API object may have been changed already, // Reload api object and try again var current *api.ArangoLocalStorage - current, err = ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(update.GetName(), metav1.GetOptions{}) + current, err = ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -392,7 +392,7 @@ func (ls *LocalStorage) updateCRSpec(newSpec api.LocalStorageSpec) error { attempt++ update.Spec = newSpec update.Status = ls.status - newAPIObject, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Update(update) + newAPIObject, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Update(context.Background(), update, metav1.UpdateOptions{}) if err == nil { // Update internal object ls.apiObject = newAPIObject @@ -402,7 +402,7 @@ func (ls *LocalStorage) updateCRSpec(newSpec api.LocalStorageSpec) error { // API object may have been changed already, // Reload api object and try again var current *api.ArangoLocalStorage - current, err = ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(update.GetName(), metav1.GetOptions{}) + current, err = ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(context.Background(), update.GetName(), metav1.GetOptions{}) if err == nil { update = current.DeepCopy() continue @@ -441,7 +441,7 @@ func (ls *LocalStorage) reportFailedStatus() { return errors.WithStack(err) } - depl, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(ls.apiObject.Name, metav1.GetOptions{}) + depl, err := ls.deps.StorageCRCli.StorageV1alpha().ArangoLocalStorages().Get(context.Background(), ls.apiObject.Name, metav1.GetOptions{}) if err != nil { // Update (PUT) will return conflict even if object is deleted since we have UID set in object. // Because it will check UID first and return something like: diff --git a/pkg/storage/pv_cleanup.go b/pkg/storage/pv_cleanup.go index 9bbdc5fe0..5c0d86a3b 100644 --- a/pkg/storage/pv_cleanup.go +++ b/pkg/storage/pv_cleanup.go @@ -161,7 +161,7 @@ func (c *pvCleaner) clean(pv v1.PersistentVolume) error { } // Remove persistent volume - if err := c.cli.CoreV1().PersistentVolumes().Delete(pv.GetName(), &metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { + if err := c.cli.CoreV1().PersistentVolumes().Delete(context.Background(), pv.GetName(), metav1.DeleteOptions{}); err != nil && !k8sutil.IsNotFound(err) { log.Debug().Err(err). Str("name", pv.GetName()). Msg("Failed to remove PersistentVolume") diff --git a/pkg/storage/pv_creator.go b/pkg/storage/pv_creator.go index d42957b66..abb262e0c 100644 --- a/pkg/storage/pv_creator.go +++ b/pkg/storage/pv_creator.go @@ -188,7 +188,7 @@ func (ls *LocalStorage) createPV(ctx context.Context, apiObject *api.ArangoLocal } // Attach PV to ArangoLocalStorage pv.SetOwnerReferences(append(pv.GetOwnerReferences(), apiObject.AsOwner())) - if _, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().Create(pv); err != nil { + if _, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().Create(context.Background(), pv, metav1.CreateOptions{}); err != nil { log.Error().Err(err).Msg("Failed to create PersistentVolume") continue } @@ -200,7 +200,7 @@ func (ls *LocalStorage) createPV(ctx context.Context, apiObject *api.ArangoLocal // Bind claim to volume if err := ls.bindClaimToVolume(claim, pv.GetName()); err != nil { // Try to delete the PV now - if err := ls.deps.KubeCli.CoreV1().PersistentVolumes().Delete(pv.GetName(), &metav1.DeleteOptions{}); err != nil { + if err := ls.deps.KubeCli.CoreV1().PersistentVolumes().Delete(context.Background(), pv.GetName(), metav1.DeleteOptions{}); err != nil { log.Error().Err(err).Msg("Failed to delete PV after binding PVC failed") } return errors.WithStack(err) @@ -272,7 +272,7 @@ func getDeploymentInfo(pvc v1.PersistentVolumeClaim) (string, string, bool) { // filterAllowedNodes returns those clients that do not yet have a volume for the given deployment name & role. func (ls *LocalStorage) filterAllowedNodes(clients map[string]provisioner.API, deploymentName, role string) ([]provisioner.API, error) { // Find all PVs for given deployment & role - list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(metav1.ListOptions{ + list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{ LabelSelector: fmt.Sprintf("%s=%s,%s=%s", k8sutil.LabelKeyArangoDeployment, deploymentName, k8sutil.LabelKeyRole, role), }) if err != nil { @@ -303,7 +303,7 @@ func (ls *LocalStorage) bindClaimToVolume(claim v1.PersistentVolumeClaim, volume time.Sleep(time.Millisecond * time.Duration(10*attempt)) // Fetch latest version of claim - updated, err := pvcs.Get(claim.GetName(), metav1.GetOptions{}) + updated, err := pvcs.Get(context.Background(), claim.GetName(), metav1.GetOptions{}) if k8sutil.IsNotFound(err) { return errors.WithStack(err) } else if err != nil { @@ -322,7 +322,7 @@ func (ls *LocalStorage) bindClaimToVolume(claim v1.PersistentVolumeClaim, volume // Try to bind updated.Spec.VolumeName = volumeName - if _, err := pvcs.Update(updated); k8sutil.IsConflict(err) { + if _, err := pvcs.Update(context.Background(), updated, metav1.UpdateOptions{}); k8sutil.IsConflict(err) { // Claim modified already, retry log.Debug().Err(err).Msg("PersistentVolumeClaim has been modified. Retrying.") } else if err != nil { diff --git a/pkg/storage/pv_inspector.go b/pkg/storage/pv_inspector.go index d7d559e2e..b966f5292 100644 --- a/pkg/storage/pv_inspector.go +++ b/pkg/storage/pv_inspector.go @@ -23,6 +23,7 @@ package storage import ( + "context" "time" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -36,7 +37,7 @@ import ( // Returns the number of available PV's. func (ls *LocalStorage) inspectPVs() (int, error) { log := ls.deps.Log - list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(metav1.ListOptions{}) + list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) if err != nil { return 0, errors.WithStack(err) } diff --git a/pkg/storage/pvc_inspector.go b/pkg/storage/pvc_inspector.go index 9cc12a766..cd10170fd 100644 --- a/pkg/storage/pvc_inspector.go +++ b/pkg/storage/pvc_inspector.go @@ -23,6 +23,8 @@ package storage import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,7 +35,7 @@ import ( // Returns the PVC's that need a volume. func (ls *LocalStorage) inspectPVCs() ([]v1.PersistentVolumeClaim, error) { ns := ls.apiObject.GetNamespace() - list, err := ls.deps.KubeCli.CoreV1().PersistentVolumeClaims(ns).List(metav1.ListOptions{}) + list, err := ls.deps.KubeCli.CoreV1().PersistentVolumeClaims(ns).List(context.Background(), metav1.ListOptions{}) if err != nil { return nil, errors.WithStack(err) } diff --git a/pkg/storage/server_api.go b/pkg/storage/server_api.go index e2402832e..4c6d16969 100644 --- a/pkg/storage/server_api.go +++ b/pkg/storage/server_api.go @@ -23,6 +23,7 @@ package storage import ( + "context" "sort" api "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" @@ -64,7 +65,7 @@ func (ls *LocalStorage) StorageClassIsDefault() bool { // Volumes returns all volumes created by the local storage resource func (ls *LocalStorage) Volumes() []server.Volume { - list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(metav1.ListOptions{}) + list, err := ls.deps.KubeCli.CoreV1().PersistentVolumes().List(context.Background(), metav1.ListOptions{}) if err != nil { ls.deps.Log.Error().Err(err).Msg("Failed to list persistent volumes") return nil diff --git a/pkg/storage/service.go b/pkg/storage/service.go index 3614d60c6..f9baaf4f4 100644 --- a/pkg/storage/service.go +++ b/pkg/storage/service.go @@ -23,6 +23,8 @@ package storage import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -54,7 +56,7 @@ func (ls *LocalStorage) ensureProvisionerService(apiObject *api.ArangoLocalStora } svc.SetOwnerReferences(append(svc.GetOwnerReferences(), apiObject.AsOwner())) ns := ls.config.Namespace - if _, err := ls.deps.KubeCli.CoreV1().Services(ns).Create(svc); err != nil && !k8sutil.IsAlreadyExists(err) { + if _, err := ls.deps.KubeCli.CoreV1().Services(ns).Create(context.Background(), svc, metav1.CreateOptions{}); err != nil && !k8sutil.IsAlreadyExists(err) { return errors.WithStack(err) } return nil diff --git a/pkg/storage/storage_class.go b/pkg/storage/storage_class.go index d37dc60db..5f61aa14f 100644 --- a/pkg/storage/storage_class.go +++ b/pkg/storage/storage_class.go @@ -23,6 +23,8 @@ package storage import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/storage/v1" @@ -54,7 +56,7 @@ func (l *LocalStorage) ensureStorageClass(apiObject *api.ArangoLocalStorage) err // Note: We do not attach the StorageClass to the apiObject (OwnerRef) because many // ArangoLocalStorage resource may use the same StorageClass. cli := l.deps.KubeCli.StorageV1() - if _, err := cli.StorageClasses().Create(sc); k8sutil.IsAlreadyExists(err) { + if _, err := cli.StorageClasses().Create(context.Background(), sc, metav1.CreateOptions{}); k8sutil.IsAlreadyExists(err) { log.Debug(). Str("storageclass", sc.GetName()). Msg("StorageClass already exists") @@ -71,7 +73,7 @@ func (l *LocalStorage) ensureStorageClass(apiObject *api.ArangoLocalStorage) err if apiObject.Spec.StorageClass.IsDefault { // UnMark current default (if any) - list, err := cli.StorageClasses().List(metav1.ListOptions{}) + list, err := cli.StorageClasses().List(context.Background(), metav1.ListOptions{}) if err != nil { log.Debug().Err(err).Msg("Listing StorageClasses failed") return errors.WithStack(err) diff --git a/pkg/util/crd/crd.go b/pkg/util/crd/crd.go index a381c5b9a..df1aa8486 100644 --- a/pkg/util/crd/crd.go +++ b/pkg/util/crd/crd.go @@ -23,6 +23,7 @@ package crd import ( + "context" "time" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -45,7 +46,7 @@ func WaitReady(check func() error) error { // WaitCRDReady waits for a custom resource definition with given name to be ready. func WaitCRDReady(clientset apiextensionsclient.Interface, crdName string) error { op := func() error { - crd, err := clientset.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crdName, metav1.GetOptions{}) + crd, err := clientset.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.Background(), crdName, metav1.GetOptions{}) if err != nil { return errors.WithStack(err) } diff --git a/pkg/util/k8sutil/annotations.go b/pkg/util/k8sutil/annotations.go index 7e1d0d94d..628361442 100644 --- a/pkg/util/k8sutil/annotations.go +++ b/pkg/util/k8sutil/annotations.go @@ -23,6 +23,8 @@ package k8sutil import ( + "context" + core "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -79,7 +81,7 @@ func IsChildResource(kind, name, namespace string, resource meta.Object) bool { } func GetSecretsForParent(client typedCore.SecretInterface, kind, name, namespace string) ([]*core.Secret, error) { - secrets, err := client.List(meta.ListOptions{}) + secrets, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } @@ -100,7 +102,7 @@ func GetSecretsForParent(client typedCore.SecretInterface, kind, name, namespace } func GetPDBForParent(client policyTyped.PodDisruptionBudgetInterface, kind, name, namespace string) ([]*policy.PodDisruptionBudget, error) { - pdbs, err := client.List(meta.ListOptions{}) + pdbs, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } @@ -121,7 +123,7 @@ func GetPDBForParent(client policyTyped.PodDisruptionBudgetInterface, kind, name } func GetPVCForParent(client typedCore.PersistentVolumeClaimInterface, kind, name, namespace string) ([]*core.PersistentVolumeClaim, error) { - pvcs, err := client.List(meta.ListOptions{}) + pvcs, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } @@ -142,7 +144,7 @@ func GetPVCForParent(client typedCore.PersistentVolumeClaimInterface, kind, name } func GetServicesForParent(client typedCore.ServiceInterface, kind, name, namespace string) ([]*core.Service, error) { - services, err := client.List(meta.ListOptions{}) + services, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } @@ -163,7 +165,7 @@ func GetServicesForParent(client typedCore.ServiceInterface, kind, name, namespa } func GetServiceAccountsForParent(client typedCore.ServiceAccountInterface, kind, name, namespace string) ([]*core.ServiceAccount, error) { - serviceAccounts, err := client.List(meta.ListOptions{}) + serviceAccounts, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } @@ -184,7 +186,7 @@ func GetServiceAccountsForParent(client typedCore.ServiceAccountInterface, kind, } func GetPodsForParent(client typedCore.PodInterface, kind, name, namespace string) ([]*core.Pod, error) { - podList, err := client.List(meta.ListOptions{}) + podList, err := client.List(context.Background(), meta.ListOptions{}) if err != nil { return nil, err } diff --git a/pkg/util/k8sutil/client.go b/pkg/util/k8sutil/client.go index 2afe7ed55..8d4b0f617 100644 --- a/pkg/util/k8sutil/client.go +++ b/pkg/util/k8sutil/client.go @@ -28,7 +28,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/errors" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "github.com/arangodb/kube-arangodb/pkg/util" "k8s.io/client-go/tools/clientcmd" diff --git a/pkg/util/k8sutil/finalizers.go b/pkg/util/k8sutil/finalizers.go index 455a0861c..bc88d7c08 100644 --- a/pkg/util/k8sutil/finalizers.go +++ b/pkg/util/k8sutil/finalizers.go @@ -23,6 +23,8 @@ package k8sutil import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" "github.com/rs/zerolog" v1 "k8s.io/api/core/v1" @@ -38,7 +40,7 @@ const ( func RemovePodFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.Pod, finalizers []string, ignoreNotFound bool) error { pods := kubecli.CoreV1().Pods(p.GetNamespace()) getFunc := func() (metav1.Object, error) { - result, err := pods.Get(p.GetName(), metav1.GetOptions{}) + result, err := pods.Get(context.Background(), p.GetName(), metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } @@ -46,7 +48,7 @@ func RemovePodFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1 } updateFunc := func(updated metav1.Object) error { updatedPod := updated.(*v1.Pod) - result, err := pods.Update(updatedPod) + result, err := pods.Update(context.Background(), updatedPod, metav1.UpdateOptions{}) if err != nil { return errors.WithStack(err) } @@ -63,7 +65,7 @@ func RemovePodFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1 func RemovePVCFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1.PersistentVolumeClaim, finalizers []string, ignoreNotFound bool) error { pvcs := kubecli.CoreV1().PersistentVolumeClaims(p.GetNamespace()) getFunc := func() (metav1.Object, error) { - result, err := pvcs.Get(p.GetName(), metav1.GetOptions{}) + result, err := pvcs.Get(context.Background(), p.GetName(), metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } @@ -71,7 +73,7 @@ func RemovePVCFinalizers(log zerolog.Logger, kubecli kubernetes.Interface, p *v1 } updateFunc := func(updated metav1.Object) error { updatedPVC := updated.(*v1.PersistentVolumeClaim) - result, err := pvcs.Update(updatedPVC) + result, err := pvcs.Update(context.Background(), updatedPVC, metav1.UpdateOptions{}) if err != nil { return errors.WithStack(err) } diff --git a/pkg/util/k8sutil/inspector/inspector.go b/pkg/util/k8sutil/inspector/inspector.go index 23f641c6f..a111d78d5 100644 --- a/pkg/util/k8sutil/inspector/inspector.go +++ b/pkg/util/k8sutil/inspector/inspector.go @@ -32,7 +32,7 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/service" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/serviceaccount" "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector/servicemonitor" - monitoringClient "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" + monitoringClient "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/typed/monitoring/v1" "k8s.io/client-go/kubernetes" ) diff --git a/pkg/util/k8sutil/inspector/secret/secret.go b/pkg/util/k8sutil/inspector/secret/secret.go index cf63569f9..81c05d605 100644 --- a/pkg/util/k8sutil/inspector/secret/secret.go +++ b/pkg/util/k8sutil/inspector/secret/secret.go @@ -22,6 +22,8 @@ package secret import ( + "context" + core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -35,7 +37,7 @@ type Inspector interface { // ReadInterface has methods to work with Secret resources with ReadOnly mode. type ReadInterface interface { - Get(name string, options meta.GetOptions) (*core.Secret, error) + Get(ctx context.Context, name string, opts meta.GetOptions) (*core.Secret, error) } type Filter func(pod *core.Secret) bool diff --git a/pkg/util/k8sutil/inspector/servicemonitor/sm.go b/pkg/util/k8sutil/inspector/servicemonitor/sm.go index 811c28da4..2c0824204 100644 --- a/pkg/util/k8sutil/inspector/servicemonitor/sm.go +++ b/pkg/util/k8sutil/inspector/servicemonitor/sm.go @@ -22,7 +22,7 @@ package servicemonitor -import monitoring "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" +import monitoring "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" type Inspector interface { ServiceMonitor(name string) (*monitoring.ServiceMonitor, bool) diff --git a/pkg/util/k8sutil/owner.go b/pkg/util/k8sutil/owner.go index 759f1a201..56042e133 100644 --- a/pkg/util/k8sutil/owner.go +++ b/pkg/util/k8sutil/owner.go @@ -23,6 +23,8 @@ package k8sutil import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" @@ -37,7 +39,7 @@ func GetPodOwner(kubecli kubernetes.Interface, pod *v1.Pod, ns string) (*appsv1. for _, ref := range pod.GetOwnerReferences() { if ref.Kind == "ReplicaSet" { rSets := kubecli.AppsV1().ReplicaSets(pod.GetNamespace()) - rSet, err := rSets.Get(ref.Name, metav1.GetOptions{}) + rSet, err := rSets.Get(context.Background(), ref.Name, metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } @@ -53,7 +55,7 @@ func GetReplicaSetOwner(kubecli kubernetes.Interface, rSet *appsv1.ReplicaSet, n for _, ref := range rSet.GetOwnerReferences() { if ref.Kind == "Deployment" { depls := kubecli.AppsV1().Deployments(rSet.GetNamespace()) - depl, err := depls.Get(ref.Name, metav1.GetOptions{}) + depl, err := depls.Get(context.Background(), ref.Name, metav1.GetOptions{}) if err != nil { return nil, errors.WithStack(err) } diff --git a/pkg/util/k8sutil/pods.go b/pkg/util/k8sutil/pods.go index af43c3ade..37da41bdb 100644 --- a/pkg/util/k8sutil/pods.go +++ b/pkg/util/k8sutil/pods.go @@ -23,6 +23,7 @@ package k8sutil import ( + "context" "crypto/sha256" "fmt" "path/filepath" @@ -408,7 +409,7 @@ func GetPodSpecChecksum(podSpec core.PodSpec) (string, error) { func CreatePod(kubecli kubernetes.Interface, pod *core.Pod, ns string, owner metav1.OwnerReference) (types.UID, error) { AddOwnerRefToObject(pod.GetObjectMeta(), &owner) - if pod, err := kubecli.CoreV1().Pods(ns).Create(pod); err != nil && !IsAlreadyExists(err) { + if pod, err := kubecli.CoreV1().Pods(ns).Create(context.Background(), pod, metav1.CreateOptions{}); err != nil && !IsAlreadyExists(err) { return "", errors.WithStack(err) } else { return pod.UID, nil diff --git a/pkg/util/k8sutil/pvc.go b/pkg/util/k8sutil/pvc.go index 6b235274d..c203ff93d 100644 --- a/pkg/util/k8sutil/pvc.go +++ b/pkg/util/k8sutil/pvc.go @@ -23,6 +23,7 @@ package k8sutil import ( + "context" "strconv" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -35,8 +36,8 @@ import ( // PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. type PersistentVolumeClaimInterface interface { - Create(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) - Get(name string, options metav1.GetOptions) (*v1.PersistentVolumeClaim, error) + Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (*v1.PersistentVolumeClaim, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error) } // IsPersistentVolumeClaimMarkedForDeletion returns true if the pvc has been marked for deletion. @@ -112,7 +113,7 @@ func CreatePersistentVolumeClaim(pvcs PersistentVolumeClaimInterface, pvcName, d pvc.Spec.StorageClassName = &storageClassName } AddOwnerRefToObject(pvc.GetObjectMeta(), &owner) - if _, err := pvcs.Create(pvc); err != nil && !IsAlreadyExists(err) { + if _, err := pvcs.Create(context.Background(), pvc, metav1.CreateOptions{}); err != nil && !IsAlreadyExists(err) { return errors.WithStack(err) } return nil diff --git a/pkg/util/k8sutil/pvc_cache.go b/pkg/util/k8sutil/pvc_cache.go deleted file mode 100644 index 2f966bda0..000000000 --- a/pkg/util/k8sutil/pvc_cache.go +++ /dev/null @@ -1,76 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2020 ArangoDB GmbH, Cologne, Germany -// -// 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. -// -// Copyright holder is ArangoDB GmbH, Cologne, Germany -// -// Author Ewout Prangsma -// - -package k8sutil - -import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - v1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" -) - -// pvcsCache implements a cached version of a PersistentVolumeClaimInterface. -// It is NOT go-routine safe. -type pvcsCache struct { - cli corev1.PersistentVolumeClaimInterface - cache []v1.PersistentVolumeClaim -} - -// NewPersistentVolumeClaimCache creates a cached version of the given PersistentVolumeClaimInterface. -func NewPersistentVolumeClaimCache(cli corev1.PersistentVolumeClaimInterface) PersistentVolumeClaimInterface { - return &pvcsCache{cli: cli} -} - -var ( - pvcGroupResource = schema.GroupResource{ - Group: v1.GroupName, - Resource: "PersistentVolumeClaim", - } -) - -func (sc *pvcsCache) Create(s *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) { - sc.cache = nil - result, err := sc.cli.Create(s) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil -} - -func (sc *pvcsCache) Get(name string, options metav1.GetOptions) (*v1.PersistentVolumeClaim, error) { - if sc.cache == nil { - list, err := sc.cli.List(metav1.ListOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - sc.cache = list.Items - } - for _, s := range sc.cache { - if s.GetName() == name { - return &s, nil - } - } - return nil, errors.WithStack(apierrors.NewNotFound(pvcGroupResource, name)) -} diff --git a/pkg/util/k8sutil/secrets.go b/pkg/util/k8sutil/secrets.go index 930bee96b..1bb219a70 100644 --- a/pkg/util/k8sutil/secrets.go +++ b/pkg/util/k8sutil/secrets.go @@ -23,6 +23,8 @@ package k8sutil import ( + "context" + "github.com/arangodb/kube-arangodb/pkg/util/errors" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,17 +36,17 @@ import ( // SecretInterface has methods to work with Secret resources. type SecretInterface interface { - Get(name string, options meta.GetOptions) (*core.Secret, error) - Create(*core.Secret) (*core.Secret, error) - Update(*core.Secret) (*core.Secret, error) - Delete(name string, options *meta.DeleteOptions) error - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*core.Secret, error) + Create(ctx context.Context, secret *core.Secret, opts meta.CreateOptions) (*core.Secret, error) + Update(ctx context.Context, secret *core.Secret, opts meta.UpdateOptions) (*core.Secret, error) + Delete(ctx context.Context, name string, opts meta.DeleteOptions) error + Get(ctx context.Context, name string, opts meta.GetOptions) (*core.Secret, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts meta.PatchOptions, subresources ...string) (result *core.Secret, err error) } // ValidateEncryptionKeySecret checks that a secret with given name in given namespace // exists and it contains a 'key' data field of exactly 32 bytes. func ValidateEncryptionKeySecret(secrets SecretInterface, secretName string) error { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return errors.WithStack(err) } @@ -77,7 +79,7 @@ func CreateEncryptionKeySecret(secrets SecretInterface, secretName string, key [ constants.SecretEncryptionKey: key, }, } - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -87,7 +89,7 @@ func CreateEncryptionKeySecret(secrets SecretInterface, secretName string, key [ // ValidateCACertificateSecret checks that a secret with given name in given namespace // exists and it contains a 'ca.crt' data field. func ValidateCACertificateSecret(secrets SecretInterface, secretName string) error { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return errors.WithStack(err) } @@ -105,7 +107,7 @@ func ValidateCACertificateSecret(secrets SecretInterface, secretName string) err // an error is returned. // Returns: certificate, error func GetCACertficateSecret(secrets SecretInterface, secretName string) (string, error) { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return "", errors.WithStack(err) } @@ -123,7 +125,7 @@ func GetCACertficateSecret(secrets SecretInterface, secretName string) (string, // an error is returned. // Returns: certificate, private-key, isOwnedByDeployment, error func GetCASecret(secrets SecretInterface, secretName string, ownerRef *meta.OwnerReference) (string, string, bool, error) { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return "", "", false, errors.WithStack(err) } @@ -166,7 +168,7 @@ func CreateCASecret(secrets SecretInterface, secretName string, certificate, key } // Attach secret to owner AddOwnerRefToObject(secret, ownerRef) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -177,7 +179,7 @@ func CreateCASecret(secrets SecretInterface, secretName string, certificate, key // in the format ArangoDB accepts it for its `--ssl.keyfile` option. // Returns: keyfile (pem encoded), error func GetTLSKeyfileSecret(secrets SecretInterface, secretName string) (string, error) { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return "", errors.WithStack(err) } @@ -207,7 +209,7 @@ func CreateTLSKeyfileSecret(secrets SecretInterface, secretName string, keyfile } // Attach secret to owner AddOwnerRefToObject(secret, ownerRef) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -217,7 +219,7 @@ func CreateTLSKeyfileSecret(secrets SecretInterface, secretName string, keyfile // ValidateTokenSecret checks that a secret with given name in given namespace // exists and it contains a 'token' data field. func ValidateTokenSecret(secrets SecretInterface, secretName string) error { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return errors.WithStack(err) } @@ -235,7 +237,7 @@ func ValidateTokenFromSecret(s *core.Secret) error { // GetTokenSecret loads the token secret from a Secret with given name. func GetTokenSecret(secrets SecretInterface, secretName string) (string, error) { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return "", errors.WithStack(err) } @@ -266,7 +268,7 @@ func CreateTokenSecret(secrets SecretInterface, secretName, token string, ownerR } // Attach secret to owner AddOwnerRefToObject(secret, ownerRef) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -323,7 +325,7 @@ func CreateBasicAuthSecret(secrets SecretInterface, secretName, username, passwo } // Attach secret to owner AddOwnerRefToObject(secret, ownerRef) - if _, err := secrets.Create(secret); err != nil { + if _, err := secrets.Create(context.Background(), secret, meta.CreateOptions{}); err != nil { // Failed to create secret return errors.WithStack(err) } @@ -336,7 +338,7 @@ func CreateBasicAuthSecret(secrets SecretInterface, secretName, username, passwo // an error is returned. // Returns: username, password, error func GetBasicAuthSecret(secrets SecretInterface, secretName string) (string, string, error) { - s, err := secrets.Get(secretName, meta.GetOptions{}) + s, err := secrets.Get(context.Background(), secretName, meta.GetOptions{}) if err != nil { return "", "", errors.WithStack(err) } diff --git a/pkg/util/k8sutil/secrets_cache.go b/pkg/util/k8sutil/secrets_cache.go deleted file mode 100644 index b3a84a47e..000000000 --- a/pkg/util/k8sutil/secrets_cache.go +++ /dev/null @@ -1,94 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2020 ArangoDB GmbH, Cologne, Germany -// -// 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. -// -// Copyright holder is ArangoDB GmbH, Cologne, Germany -// -// Author Ewout Prangsma -// - -package k8sutil - -import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - v1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" -) - -// secretsCache implements a cached version of a SecretInterface. -// It is NOT go-routine safe. -type secretsCache struct { - cli corev1.SecretInterface - cache []v1.Secret -} - -func (sc *secretsCache) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*v1.Secret, error) { - return nil, errors.Newf("Not implemented") -} - -// NewSecretCache creates a cached version of the given SecretInterface. -func NewSecretCache(cli corev1.SecretInterface) SecretInterface { - return &secretsCache{cli: cli} -} - -var ( - secretGroupResource = schema.GroupResource{ - Group: v1.GroupName, - Resource: "Secret", - } -) - -func (sc *secretsCache) Create(s *v1.Secret) (*v1.Secret, error) { - sc.cache = nil - result, err := sc.cli.Create(s) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil -} - -func (sc *secretsCache) Update(s *v1.Secret) (*v1.Secret, error) { - return sc.Update(s) -} - -func (sc *secretsCache) Delete(name string, options *metav1.DeleteOptions) error { - sc.cache = nil - err := sc.cli.Delete(name, options) - if err != nil { - return errors.WithStack(err) - } - return nil -} - -func (sc *secretsCache) Get(name string, options metav1.GetOptions) (*v1.Secret, error) { - if sc.cache == nil { - list, err := sc.cli.List(metav1.ListOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - sc.cache = list.Items - } - for _, s := range sc.cache { - if s.GetName() == name { - return &s, nil - } - } - return nil, errors.WithStack(apierrors.NewNotFound(secretGroupResource, name)) -} diff --git a/pkg/util/k8sutil/secrets_test.go b/pkg/util/k8sutil/secrets_test.go deleted file mode 100644 index 445cc5288..000000000 --- a/pkg/util/k8sutil/secrets_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2020 ArangoDB GmbH, Cologne, Germany -// -// 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. -// -// Copyright holder is ArangoDB GmbH, Cologne, Germany -// -// Author Ewout Prangsma -// - -package k8sutil - -import ( - "testing" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - apierrors "k8s.io/apimachinery/pkg/api/errors" - - "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/mocks" -) - -// TestValidateEncryptionKeySecret tests ValidateEncryptionKeySecret. -func TestValidateEncryptionKeySecret(t *testing.T) { - cli := mocks.NewCore() - secrets := cli.Secrets("ns") - - // Prepare mock - m := mocks.AsMock(secrets) - m.On("Get", "good", mock.Anything).Return(&v1.Secret{ - Data: map[string][]byte{ - "key": make([]byte, 32), - }, - }, nil) - m.On("Get", "no-key", mock.Anything).Return(&v1.Secret{ - Data: map[string][]byte{ - "foo": make([]byte, 32), - }, - }, nil) - m.On("Get", "short-key", mock.Anything).Return(&v1.Secret{ - Data: map[string][]byte{ - "key": make([]byte, 31), - }, - }, nil) - m.On("Get", "notfound", mock.Anything).Return(nil, apierrors.NewNotFound(schema.GroupResource{}, "notfound")) - - assert.NoError(t, ValidateEncryptionKeySecret(secrets, "good")) - assert.Error(t, ValidateEncryptionKeySecret(secrets, "no-key")) - assert.Error(t, ValidateEncryptionKeySecret(secrets, "short-key")) - assert.True(t, IsNotFound(ValidateEncryptionKeySecret(secrets, "notfound"))) -} - -// TestCreateEncryptionKeySecret tests CreateEncryptionKeySecret -func TestCreateEncryptionKeySecret(t *testing.T) { - cli := mocks.NewCore() - secrets := cli.Secrets("ns") - - // Prepare mock - m := mocks.AsMock(cli.Secrets("ns")) - m.On("Create", mock.Anything).Run(func(arg mock.Arguments) { - s := arg.Get(0).(*v1.Secret) - if s.GetName() == "good" { - assert.Equal(t, make([]byte, 32), s.Data["key"]) - } else { - assert.Fail(t, "Unexpected secret named '%s'", s.GetName()) - } - }).Return(nil, nil) - - key := make([]byte, 32) - assert.NoError(t, CreateEncryptionKeySecret(secrets, "good", key)) - key = make([]byte, 31) - assert.Error(t, CreateEncryptionKeySecret(secrets, "short-key", key)) -} - -// TestGetTokenSecret tests GetTokenSecret. -func TestGetTokenSecret(t *testing.T) { - cli := mocks.NewCore() - secrets := cli.Secrets("ns") - - // Prepare mock - m := mocks.AsMock(cli.Secrets("ns")) - m.On("Get", "good", mock.Anything).Return(&v1.Secret{ - Data: map[string][]byte{ - "token": []byte("foo"), - }, - }, nil) - m.On("Get", "no-token", mock.Anything).Return(&v1.Secret{ - Data: map[string][]byte{ - "foo": make([]byte, 13), - }, - }, nil) - m.On("Get", "notfound", mock.Anything).Return(nil, apierrors.NewNotFound(schema.GroupResource{}, "notfound")) - - token, err := GetTokenSecret(secrets, "good") - assert.NoError(t, err) - assert.Equal(t, token, "foo") - _, err = GetTokenSecret(secrets, "no-token") - assert.Error(t, err) - _, err = GetTokenSecret(secrets, "notfound") - assert.True(t, IsNotFound(err)) -} - -// TestCreateTokenSecret tests CreateTokenSecret -func TestCreateTokenSecret(t *testing.T) { - cli := mocks.NewCore() - secrets := cli.Secrets("ns") - - // Prepare mock - m := mocks.AsMock(cli.Secrets("ns")) - m.On("Create", mock.Anything).Run(func(arg mock.Arguments) { - s := arg.Get(0).(*v1.Secret) - if s.GetName() == "good" { - assert.Equal(t, []byte("token"), s.Data["token"]) - } else if s.GetName() == "with-owner" { - assert.Len(t, s.GetOwnerReferences(), 1) - } else { - assert.Fail(t, "Unexpected secret named '%s'", s.GetName()) - } - }).Return(nil, nil) - - assert.NoError(t, CreateTokenSecret(secrets, "good", "token", nil)) - assert.NoError(t, CreateTokenSecret(secrets, "with-owner", "token", &metav1.OwnerReference{})) -} diff --git a/pkg/util/k8sutil/services.go b/pkg/util/k8sutil/services.go index 007d3046b..ddd1f1ab2 100644 --- a/pkg/util/k8sutil/services.go +++ b/pkg/util/k8sutil/services.go @@ -23,6 +23,7 @@ package k8sutil import ( + "context" "math/rand" "net" "strconv" @@ -32,16 +33,16 @@ import ( "github.com/arangodb/kube-arangodb/pkg/util/errors" - v1 "k8s.io/api/core/v1" + core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ServiceInterface has methods to work with Service resources. type ServiceInterface interface { - Create(*v1.Service) (*v1.Service, error) - Update(*v1.Service) (*v1.Service, error) - Delete(name string, options *metav1.DeleteOptions) error - Get(name string, options metav1.GetOptions) (*v1.Service, error) + Create(ctx context.Context, service *core.Service, opts metav1.CreateOptions) (*core.Service, error) + Update(ctx context.Context, service *core.Service, opts metav1.UpdateOptions) (*core.Service, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*core.Service, error) } // CreateHeadlessServiceName returns the name of the headless service for the given @@ -85,17 +86,17 @@ func CreateExporterService(cachedStatus service.Inspector, svcs ServiceInterface return svcName, false, nil } - svc := &v1.Service{ + svc := &core.Service{ ObjectMeta: metav1.ObjectMeta{ Name: svcName, Labels: LabelsForExporterService(deploymentName), }, - Spec: v1.ServiceSpec{ - ClusterIP: v1.ClusterIPNone, - Ports: []v1.ServicePort{ - v1.ServicePort{ + Spec: core.ServiceSpec{ + ClusterIP: core.ClusterIPNone, + Ports: []core.ServicePort{ + core.ServicePort{ Name: "exporter", - Protocol: v1.ProtocolTCP, + Protocol: core.ProtocolTCP, Port: ArangoExporterPort, }, }, @@ -103,7 +104,7 @@ func CreateExporterService(cachedStatus service.Inspector, svcs ServiceInterface }, } AddOwnerRefToObject(svc.GetObjectMeta(), &owner) - if _, err := svcs.Create(svc); IsAlreadyExists(err) { + if _, err := svcs.Create(context.Background(), svc, metav1.CreateOptions{}); IsAlreadyExists(err) { return svcName, false, nil } else if err != nil { return svcName, false, errors.WithStack(err) @@ -119,15 +120,15 @@ func CreateExporterService(cachedStatus service.Inspector, svcs ServiceInterface func CreateHeadlessService(svcs ServiceInterface, deployment metav1.Object, owner metav1.OwnerReference) (string, bool, error) { deploymentName := deployment.GetName() svcName := CreateHeadlessServiceName(deploymentName) - ports := []v1.ServicePort{ - v1.ServicePort{ + ports := []core.ServicePort{ + core.ServicePort{ Name: "server", - Protocol: v1.ProtocolTCP, + Protocol: core.ProtocolTCP, Port: ArangoPort, }, } publishNotReadyAddresses := true - serviceType := v1.ServiceTypeClusterIP + serviceType := core.ServiceTypeClusterIP newlyCreated, err := createService(svcs, svcName, deploymentName, deployment.GetNamespace(), ClusterIPNone, "", serviceType, ports, "", nil, publishNotReadyAddresses, owner) if err != nil { return "", false, errors.WithStack(err) @@ -142,10 +143,10 @@ func CreateHeadlessService(svcs ServiceInterface, deployment metav1.Object, owne func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object, single bool, owner metav1.OwnerReference) (string, bool, error) { deploymentName := deployment.GetName() svcName := CreateDatabaseClientServiceName(deploymentName) - ports := []v1.ServicePort{ - v1.ServicePort{ + ports := []core.ServicePort{ + core.ServicePort{ Name: "server", - Protocol: v1.ProtocolTCP, + Protocol: core.ProtocolTCP, Port: ArangoPort, }, } @@ -155,7 +156,7 @@ func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object } else { role = "coordinator" } - serviceType := v1.ServiceTypeClusterIP + serviceType := core.ServiceTypeClusterIP publishNotReadyAddresses := false newlyCreated, err := createService(svcs, svcName, deploymentName, deployment.GetNamespace(), "", role, serviceType, ports, "", nil, publishNotReadyAddresses, owner) if err != nil { @@ -168,12 +169,12 @@ func CreateDatabaseClientService(svcs ServiceInterface, deployment metav1.Object // If the service already exists, nil is returned. // If another error occurs, that error is returned. // The returned bool is true if the service is created, or false when the service already existed. -func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, deployment metav1.Object, serviceType v1.ServiceType, port, nodePort int, loadBalancerIP string, loadBalancerSourceRanges []string, owner metav1.OwnerReference) (string, bool, error) { +func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, deployment metav1.Object, serviceType core.ServiceType, port, nodePort int, loadBalancerIP string, loadBalancerSourceRanges []string, owner metav1.OwnerReference) (string, bool, error) { deploymentName := deployment.GetName() - ports := []v1.ServicePort{ - v1.ServicePort{ + ports := []core.ServicePort{ + core.ServicePort{ Name: "server", - Protocol: v1.ProtocolTCP, + Protocol: core.ProtocolTCP, Port: int32(port), NodePort: int32(nodePort), }, @@ -190,16 +191,16 @@ func CreateExternalAccessService(svcs ServiceInterface, svcName, role string, de // If the service already exists, nil is returned. // If another error occurs, that error is returned. // The returned bool is true if the service is created, or false when the service already existed. -func createService(svcs ServiceInterface, svcName, deploymentName, ns, clusterIP, role string, serviceType v1.ServiceType, - ports []v1.ServicePort, loadBalancerIP string, loadBalancerSourceRanges []string, publishNotReadyAddresses bool, owner metav1.OwnerReference) (bool, error) { +func createService(svcs ServiceInterface, svcName, deploymentName, ns, clusterIP, role string, serviceType core.ServiceType, + ports []core.ServicePort, loadBalancerIP string, loadBalancerSourceRanges []string, publishNotReadyAddresses bool, owner metav1.OwnerReference) (bool, error) { labels := LabelsForDeployment(deploymentName, role) - svc := &v1.Service{ + svc := &core.Service{ ObjectMeta: metav1.ObjectMeta{ Name: svcName, Labels: labels, Annotations: map[string]string{}, }, - Spec: v1.ServiceSpec{ + Spec: core.ServiceSpec{ Type: serviceType, Ports: ports, Selector: labels, @@ -210,7 +211,7 @@ func createService(svcs ServiceInterface, svcName, deploymentName, ns, clusterIP }, } AddOwnerRefToObject(svc.GetObjectMeta(), &owner) - if _, err := svcs.Create(svc); IsAlreadyExists(err) { + if _, err := svcs.Create(context.Background(), svc, metav1.CreateOptions{}); IsAlreadyExists(err) { return false, nil } else if err != nil { return false, errors.WithStack(err) @@ -219,7 +220,7 @@ func createService(svcs ServiceInterface, svcName, deploymentName, ns, clusterIP } // CreateServiceURL creates a URL used to reach the given service. -func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.ServicePort) bool, nodeFetcher func() (v1.NodeList, error)) (string, error) { +func CreateServiceURL(svc core.Service, scheme string, portPredicate func(core.ServicePort) bool, nodeFetcher func() (core.NodeList, error)) (string, error) { var port int32 var nodePort int32 portFound := false @@ -237,7 +238,7 @@ func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.Servi var host string switch svc.Spec.Type { - case v1.ServiceTypeLoadBalancer: + case core.ServiceTypeLoadBalancer: for _, x := range svc.Status.LoadBalancer.Ingress { if x.IP != "" { host = x.IP @@ -250,7 +251,7 @@ func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.Servi if host == "" { host = svc.Spec.LoadBalancerIP } - case v1.ServiceTypeNodePort: + case core.ServiceTypeNodePort: if nodePort > 0 { port = nodePort } @@ -265,7 +266,7 @@ func CreateServiceURL(svc v1.Service, scheme string, portPredicate func(v1.Servi if len(node.Status.Addresses) > 0 { host = node.Status.Addresses[0].Address } - case v1.ServiceTypeClusterIP: + case core.ServiceTypeClusterIP: if svc.Spec.ClusterIP != "None" { host = svc.Spec.ClusterIP } diff --git a/pkg/util/k8sutil/services_cache.go b/pkg/util/k8sutil/services_cache.go deleted file mode 100644 index 259656c0d..000000000 --- a/pkg/util/k8sutil/services_cache.go +++ /dev/null @@ -1,93 +0,0 @@ -// -// DISCLAIMER -// -// Copyright 2020 ArangoDB GmbH, Cologne, Germany -// -// 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. -// -// Copyright holder is ArangoDB GmbH, Cologne, Germany -// -// Author Ewout Prangsma -// - -package k8sutil - -import ( - "github.com/arangodb/kube-arangodb/pkg/util/errors" - v1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" - corev1 "k8s.io/client-go/kubernetes/typed/core/v1" -) - -// servicesCache implements a cached version of a ServiceInterface. -// It is NOT go-routine safe. -type servicesCache struct { - cli corev1.ServiceInterface - cache []v1.Service -} - -// NewServiceCache creates a cached version of the given ServiceInterface. -func NewServiceCache(cli corev1.ServiceInterface) ServiceInterface { - return &servicesCache{cli: cli} -} - -var ( - serviceGroupResource = schema.GroupResource{ - Group: v1.GroupName, - Resource: "Service", - } -) - -func (sc *servicesCache) Create(s *v1.Service) (*v1.Service, error) { - sc.cache = nil - result, err := sc.cli.Create(s) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil -} - -func (sc *servicesCache) Update(s *v1.Service) (*v1.Service, error) { - sc.cache = nil - result, err := sc.cli.Update(s) - if err != nil { - return nil, errors.WithStack(err) - } - return result, nil -} - -func (sc *servicesCache) Delete(name string, options *metav1.DeleteOptions) error { - sc.cache = nil - if err := sc.cli.Delete(name, options); err != nil { - return errors.WithStack(err) - } - return nil -} - -func (sc *servicesCache) Get(name string, options metav1.GetOptions) (*v1.Service, error) { - if sc.cache == nil { - list, err := sc.cli.List(metav1.ListOptions{}) - if err != nil { - return nil, errors.WithStack(err) - } - sc.cache = list.Items - } - for _, s := range sc.cache { - if s.GetName() == name { - return &s, nil - } - } - return nil, errors.WithStack(apierrors.NewNotFound(serviceGroupResource, name)) -} diff --git a/pkg/util/k8sutil/storageclass.go b/pkg/util/k8sutil/storageclass.go index 4d3e3c5bb..53589da36 100644 --- a/pkg/util/k8sutil/storageclass.go +++ b/pkg/util/k8sutil/storageclass.go @@ -23,6 +23,7 @@ package k8sutil import ( + "context" "strconv" "time" @@ -54,7 +55,7 @@ func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, i stcs := cli.StorageClasses() op := func() error { // Fetch current version of StorageClass - current, err := stcs.Get(name, metav1.GetOptions{}) + current, err := stcs.Get(context.Background(), name, metav1.GetOptions{}) if IsNotFound(err) { return retry.Permanent(errors.WithStack(err)) } else if err != nil { @@ -69,7 +70,7 @@ func PatchStorageClassIsDefault(cli storagev1.StorageV1Interface, name string, i current.SetAnnotations(ann) // Save StorageClass - if _, err := stcs.Update(current); IsConflict(err) { + if _, err := stcs.Update(context.Background(), current, metav1.UpdateOptions{}); IsConflict(err) { // StorageClass has been modified since we read it return errors.WithStack(err) } else if err != nil { diff --git a/pkg/util/k8sutil/storageclass_test.go b/pkg/util/k8sutil/storageclass_test.go index 179ce1da5..c795df747 100644 --- a/pkg/util/k8sutil/storageclass_test.go +++ b/pkg/util/k8sutil/storageclass_test.go @@ -23,6 +23,7 @@ package k8sutil import ( + "context" "testing" "github.com/arangodb/kube-arangodb/pkg/util/errors" @@ -162,12 +163,12 @@ func TestPatchStorageClassIsDefault(t *testing.T) { clientSet := fake.NewSimpleClientset() storageSet := clientSet.StorageV1() - _, err = storageSet.StorageClasses().Create(&v1.StorageClass{ + _, err = storageSet.StorageClasses().Create(context.Background(), &v1.StorageClass{ TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - }) + }, metav1.CreateOptions{}) require.NoError(t, err) if testCase.Reactor != nil { diff --git a/reboot.go b/reboot.go index 01063c967..7801e4ea9 100644 --- a/reboot.go +++ b/reboot.go @@ -123,14 +123,14 @@ func runVolumeInspector(ctx context.Context, kube kubernetes.Interface, ns, name }, } - _, err := kube.CoreV1().PersistentVolumeClaims(ns).Create(&pvcspec) + _, err := kube.CoreV1().PersistentVolumeClaims(ns).Create(context.Background(), &pvcspec, metav1.CreateOptions{}) if err != nil { return "", "", errors.Wrap(err, "failed to create pvc") } defer func() { if deletePVC { cliLog.Debug().Str("pvc-name", claimname).Msg("deleting pvc") - kube.CoreV1().PersistentVolumeClaims(ns).Delete(claimname, &metav1.DeleteOptions{}) + kube.CoreV1().PersistentVolumeClaims(ns).Delete(context.Background(), claimname, metav1.DeleteOptions{}) } }() @@ -181,13 +181,13 @@ func runVolumeInspector(ctx context.Context, kube kubernetes.Interface, ns, name }, } - _, err = kube.CoreV1().Pods(ns).Create(&podspec) + _, err = kube.CoreV1().Pods(ns).Create(context.Background(), &podspec, metav1.CreateOptions{}) if err != nil { return "", "", errors.Wrap(err, "failed to create pod") } - defer kube.CoreV1().Pods(ns).Delete(podname, &metav1.DeleteOptions{}) + defer kube.CoreV1().Pods(ns).Delete(context.Background(), podname, metav1.DeleteOptions{}) - podwatch, err := kube.CoreV1().Pods(ns).Watch(metav1.ListOptions{FieldSelector: fields.OneTermEqualSelector("metadata.name", podname).String()}) + podwatch, err := kube.CoreV1().Pods(ns).Watch(context.Background(), metav1.ListOptions{FieldSelector: fields.OneTermEqualSelector("metadata.name", podname).String()}) if err != nil { return "", "", errors.Wrap(err, "failed to watch for pod") } @@ -264,7 +264,7 @@ func doVolumeInspection(ctx context.Context, kube kubernetes.Interface, ns, name } func checkVolumeAvailable(kube kubernetes.Interface, vname string) (VolumeInfo, error) { - volume, err := kube.CoreV1().PersistentVolumes().Get(vname, metav1.GetOptions{}) + volume, err := kube.CoreV1().PersistentVolumes().Get(context.Background(), vname, metav1.GetOptions{}) if err != nil { return VolumeInfo{}, errors.Wrapf(err, "failed to GET volume %s", vname) } @@ -275,7 +275,7 @@ func checkVolumeAvailable(kube kubernetes.Interface, vname string) (VolumeInfo, case corev1.VolumeReleased: // we have to remove the claim reference volume.Spec.ClaimRef = nil - if _, err := kube.CoreV1().PersistentVolumes().Update(volume); err != nil { + if _, err := kube.CoreV1().PersistentVolumes().Update(context.Background(), volume, metav1.UpdateOptions{}); err != nil { return VolumeInfo{}, errors.Wrapf(err, "failed to remove claim reference") } default: @@ -306,7 +306,7 @@ func preflightChecks(kube kubernetes.Interface, volumes []string) (VolumeListInf } func getMyImage(kube kubernetes.Interface, ns, name string) (string, error) { - pod, err := kube.CoreV1().Pods(ns).Get(name, metav1.GetOptions{}) + pod, err := kube.CoreV1().Pods(ns).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { return "", err } @@ -367,7 +367,7 @@ func createArangoDeployment(cli acli.Interface, ns, deplname, arangoimage string }) } - if _, err := cli.DatabaseV1().ArangoDeployments(ns).Create(&depl); err != nil { + if _, err := cli.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), &depl, metav1.CreateOptions{}); err != nil { return errors.Wrap(err, "failed to create ArangoDeployment") } diff --git a/tests/annotations_test.go b/tests/annotations_test.go index 9dd0eb87b..3d575ccf7 100644 --- a/tests/annotations_test.go +++ b/tests/annotations_test.go @@ -23,6 +23,7 @@ package tests import ( + "context" "github.com/arangodb/kube-arangodb/pkg/util/collection" "testing" "time" @@ -42,13 +43,13 @@ import ( ) func addAnnotation(t *testing.T, kubeClient kubernetes.Interface, arangoClient versioned.Interface, depl *api.ArangoDeployment, annotations map[string]string) { - object, err := arangoClient.DatabaseV1().ArangoDeployments(depl.GetNamespace()).Get(depl.GetName(), meta.GetOptions{}) + object, err := arangoClient.DatabaseV1().ArangoDeployments(depl.GetNamespace()).Get(context.Background(), depl.GetName(), meta.GetOptions{}) require.NoError(t, err) object.Spec.Annotations = annotations object.Spec.Coordinators.Annotations = depl.Spec.Coordinators.Annotations - _, err = arangoClient.DatabaseV1().ArangoDeployments(depl.GetNamespace()).Update(object) + _, err = arangoClient.DatabaseV1().ArangoDeployments(depl.GetNamespace()).Update(context.Background(), object, meta.UpdateOptions{}) require.NoError(t, err) ensureAnnotations(t, kubeClient, object) @@ -196,7 +197,7 @@ func TestAnnotations(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - depl, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + depl, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, meta.CreateOptions{}) require.NoError(t, err) defer deferedCleanupDeployment(c, depl.GetName(), ns) diff --git a/tests/auth_test.go b/tests/auth_test.go index 88fb45401..5aa6c9fc7 100644 --- a/tests/auth_test.go +++ b/tests/auth_test.go @@ -24,6 +24,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" "time" @@ -51,7 +52,7 @@ func TestAuthenticationSingleDefaultSecret(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -107,7 +108,7 @@ func TestAuthenticationSingleCustomSecret(t *testing.T) { defer removeSecret(kubecli, depl.Spec.Authentication.GetJWTSecretName(), ns) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -151,7 +152,7 @@ func TestAuthenticationNoneSingle(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl,metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -189,7 +190,7 @@ func TestAuthenticationClusterDefaultSecret(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -244,7 +245,7 @@ func TestAuthenticationClusterCustomSecret(t *testing.T) { } // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl,metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -291,7 +292,7 @@ func TestAuthenticationNoneCluster(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl,metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/backup_test.go b/tests/backup_test.go index 9f32e9b80..a00594ba5 100644 --- a/tests/backup_test.go +++ b/tests/backup_test.go @@ -57,7 +57,7 @@ var backupAPIAvailable *bool func waitUntilBackup(ci versioned.Interface, name, ns string, predicate func(*backupApi.ArangoBackup, error) error, timeout ...time.Duration) (*backupApi.ArangoBackup, error) { var result *backupApi.ArangoBackup op := func() error { - obj, err := ci.BackupV1().ArangoBackups(ns).Get(name, metav1.GetOptions{}) + obj, err := ci.BackupV1().ArangoBackups(ns).Get(context.Background(), name, metav1.GetOptions{}) result = obj if predicate != nil { if err := predicate(obj, err); err != nil { @@ -237,7 +237,7 @@ func statBackupMeta(client driver.Client, backupID driver.BackupID) (bool, drive func ensureBackup(t *testing.T, deployment, ns string, deploymentClient versioned.Interface, predicate func(*backupApi.ArangoBackup, error) error, options *EnsureBackupOptions) (*backupApi.ArangoBackup, string, driver.BackupID) { backup := newBackup(fmt.Sprintf("my-backup-%s", uniuri.NewLen(4)), deployment, options) - _, err := deploymentClient.BackupV1().ArangoBackups(ns).Create(backup) + _, err := deploymentClient.BackupV1().ArangoBackups(ns).Create(context.Background(), backup, metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) name := backup.GetName() @@ -277,7 +277,7 @@ func newDownload(ID string) *backupApi.ArangoBackupSpecDownload { func timeoutWaitForBackups(t *testing.T, backupClient backupClient.ArangoBackupInterface, labels metav1.LabelSelector, size int) func() error { return func() error { - backups, err := backupClient.List(metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) + backups, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) if err != nil { return err } @@ -364,11 +364,11 @@ func TestBackupCluster(t *testing.T) { defer deferedCleanupDeployment(c, depl2.GetName(), ns) // Create deployment - apiObject, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) defer removeDeployment(deploymentClient, depl.GetName(), ns) require.NoError(t, err, "failed to create deployment: %s", err) - api2Object, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(depl2) + api2Object, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl2, metav1.CreateOptions{}) defer removeDeployment(deploymentClient, depl2.GetName(), ns) require.NoError(t, err, "failed to create deployment two: %s", err) @@ -407,9 +407,9 @@ func TestBackupCluster(t *testing.T) { backup.Labels = labels.MatchLabels - _, err := backupClient.Create(backup) + _, err := backupClient.Create(context.Background(), backup, metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) } } @@ -419,9 +419,9 @@ func TestBackupCluster(t *testing.T) { t.Run("create backup", func(t *testing.T) { backup := newBackup(fmt.Sprintf("my-backup-%s", uniuri.NewLen(4)), depl.GetName(), nil) - _, err := backupClient.Create(backup) + _, err := backupClient.Create(context.Background(), backup,metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsAvailable) require.NoError(t, err, "backup did not become available: %s", err) @@ -438,9 +438,9 @@ func TestBackupCluster(t *testing.T) { skipOrRemotePath(t) backup := newBackup(fmt.Sprintf("my-backup-%s", uniuri.NewLen(4)), depl.GetName(), nil) - _, err := backupClient.Create(backup) + _, err := backupClient.Create(context.Background(), backup,metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsReady) require.NoError(t, err, "backup did not become available: %s", err) @@ -456,12 +456,12 @@ func TestBackupCluster(t *testing.T) { t.Logf("Add upload") // add upload part - currentBackup, err := backupClient.Get(backup.Name, metav1.GetOptions{}) + currentBackup, err := backupClient.Get(context.Background(), backup.Name, metav1.GetOptions{}) require.NoError(t, err) currentBackup.Spec.Upload = newOperation() - _, err = backupClient.Update(currentBackup) + _, err = backupClient.Update(context.Background(), currentBackup, metav1.UpdateOptions{}) require.NoError(t, err) // After backup went thru uploading phase wait for finnish @@ -478,7 +478,7 @@ func TestBackupCluster(t *testing.T) { t.Run("create backup and delete", func(t *testing.T) { backup, name, id := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, nil) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // check that the backup is actually available found, meta, err := statBackupMeta(databaseClient, id) @@ -487,7 +487,7 @@ func TestBackupCluster(t *testing.T) { compareBackup(t, meta, backup) // now remove the backup - backupClient.Delete(name, &metav1.DeleteOptions{}) + backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) _, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsNotFound) require.NoError(t, err, "Backup test failed: %s", err) @@ -498,7 +498,7 @@ func TestBackupCluster(t *testing.T) { t.Run("remove backup locally", func(t *testing.T) { backup, name, id := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, nil) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // now remove the backup locally err := databaseClient.Backup().Delete(nil, id) @@ -521,7 +521,7 @@ func TestBackupCluster(t *testing.T) { // create a backup resource manually with that id var backup *backupApi.ArangoBackup err = timeout(3*time.Second, 2*time.Minute, func() error { - backups, err := backupClient.List(metav1.ListOptions{}) + backups, err := backupClient.List(context.Background(), metav1.ListOptions{}) if err != nil { return err } @@ -539,7 +539,7 @@ func TestBackupCluster(t *testing.T) { return interrupt{} }) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) // wait until the backup becomes available backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsAvailable) @@ -582,9 +582,9 @@ func TestBackupCluster(t *testing.T) { backup.Labels = labels.MatchLabels - _, err := backupClient.Create(backup) + _, err := backupClient.Create(context.Background(), backup,metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) } err = timeout(time.Second, 5*time.Minute, timeoutWaitForBackups(t, backupClient, labels, size)) @@ -592,7 +592,7 @@ func TestBackupCluster(t *testing.T) { require.NoError(t, err) // Get first backup - backups, err := backupClient.List(metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) + backups, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) require.NoError(t, err) require.Len(t, backups.Items, size) @@ -601,9 +601,9 @@ func TestBackupCluster(t *testing.T) { backup.Labels = labels.MatchLabels - _, err = backupClient.Create(backup) + _, err = backupClient.Create(context.Background(), backup,metav1.CreateOptions{}) require.NoError(t, err, "failed to create backup: %s", err) - defer backupClient.Delete(backup.GetName(), &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.GetName(), metav1.DeleteOptions{}) name := backup.Name @@ -670,7 +670,7 @@ func TestBackupCluster(t *testing.T) { }) // Assert that all of the backups are in valid state - backups, err = backupClient.List(metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) + backups, err = backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&labels)}) require.NoError(t, err) require.Len(t, backups.Items, size+1) @@ -700,7 +700,7 @@ func TestBackupCluster(t *testing.T) { // Now create a backup _, name, _ := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, nil) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // insert yet another document meta2, err := col.CreateDocument(ctx, &Book{Title: "Bad book title", Author: "Lars"}) @@ -805,7 +805,7 @@ func TestBackupCluster(t *testing.T) { // create backup with upload operation backup, name, _ := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Upload: newOperation()}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup will be uploaded backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsUploaded) @@ -823,7 +823,7 @@ func TestBackupCluster(t *testing.T) { // create backup with upload operation backup, name, _ := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Upload: newOperation()}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup will be uploaded backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsUploaded) @@ -836,12 +836,12 @@ func TestBackupCluster(t *testing.T) { require.True(t, *backup.Status.Backup.Uploaded) // Remove upload option - currentBackup, err := backupClient.Get(backup.Name, metav1.GetOptions{}) + currentBackup, err := backupClient.Get(context.Background(), backup.Name, metav1.GetOptions{}) require.NoError(t, err) currentBackup.Spec.Upload = nil - _, err = backupClient.Update(currentBackup) + _, err = backupClient.Update(context.Background(), currentBackup, metav1.UpdateOptions{}) require.NoError(t, err) // Wait for uploaded flag to disappear @@ -849,12 +849,12 @@ func TestBackupCluster(t *testing.T) { require.NoError(t, err, "backup did not become ready: %s", err) // Append again upload flag - currentBackup, err = backupClient.Get(backup.Name, metav1.GetOptions{}) + currentBackup, err = backupClient.Get(context.Background(), backup.Name, metav1.GetOptions{}) require.NoError(t, err) currentBackup.Spec.Upload = newOperation() - _, err = backupClient.Update(currentBackup) + _, err = backupClient.Update(context.Background(), currentBackup, metav1.UpdateOptions{}) require.NoError(t, err) // Wait for uploaded flag to appear @@ -868,7 +868,7 @@ func TestBackupCluster(t *testing.T) { // create backup with upload operation backup, name, id := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Upload: newOperation()}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup will be uploaded backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsUploaded) @@ -887,7 +887,7 @@ func TestBackupCluster(t *testing.T) { require.True(t, *backup.Status.Backup.Uploaded) // After all remove backup - backupClient.Delete(name, &metav1.DeleteOptions{}) + backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) _, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsNotFound) require.NoError(t, err, "Backup test failed: %s", err) @@ -897,7 +897,7 @@ func TestBackupCluster(t *testing.T) { // create backup with download operation backup, name, _ = ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Download: newDownload(string(id))}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup becomes ready backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsReady) @@ -921,7 +921,7 @@ func TestBackupCluster(t *testing.T) { // create backup with upload operation backup, name, id := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Upload: newOperation()}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup will be uploaded backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsUploaded) @@ -940,7 +940,7 @@ func TestBackupCluster(t *testing.T) { require.True(t, *backup.Status.Backup.Uploaded) // After all remove backup - backupClient.Delete(name, &metav1.DeleteOptions{}) + backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) _, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsNotFound) require.NoError(t, err, "Backup test failed: %s", err) @@ -950,7 +950,7 @@ func TestBackupCluster(t *testing.T) { // create backup with download operation backup, name, _ = ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Download: newDownload(string(id))}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup becomes ready backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsReady) @@ -969,12 +969,12 @@ func TestBackupCluster(t *testing.T) { require.True(t, *backup.Status.Backup.Downloaded) // Add again upload flag - currentBackup, err := backupClient.Get(backup.Name, metav1.GetOptions{}) + currentBackup, err := backupClient.Get(context.Background(), backup.Name, metav1.GetOptions{}) require.NoError(t, err) currentBackup.Spec.Upload = newOperation() - _, err = backupClient.Update(currentBackup) + _, err = backupClient.Update(context.Background(), currentBackup, metav1.UpdateOptions{}) require.NoError(t, err) // Wait for uploaded flag to appear @@ -1005,7 +1005,7 @@ func TestBackupCluster(t *testing.T) { // Now create a backup backup, name, id := ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Upload: newOperation()}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup becomes ready backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsUploaded) @@ -1025,13 +1025,13 @@ func TestBackupCluster(t *testing.T) { require.Equal(t, backupApi.ArangoBackupStateDeleted, backup.Status.State) // now remove the backup - backupClient.Delete(name, &metav1.DeleteOptions{}) + backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) _, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsNotFound) require.NoError(t, err, "Backup test failed: %s", err) // create backup with download operation backup, name, _ = ensureBackup(t, depl.GetName(), ns, deploymentClient, backupIsAvailable, &EnsureBackupOptions{Download: newDownload(string(id))}) - defer backupClient.Delete(name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), name, metav1.DeleteOptions{}) // wait until the backup becomes ready backup, err = waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsReady) @@ -1102,17 +1102,17 @@ func TestBackupCluster(t *testing.T) { }) policy := newBackupPolicy(depl.GetName(), "*/1 * * * *", deplLabels, nil) - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) require.NoError(t, err) require.Len(t, list.Items, 0, "unexpected matching ArangoBackup objects") - _, err = backupPolicyClient.Create(policy) + _, err = backupPolicyClient.Create(context.Background(), policy,metav1.CreateOptions{}) require.NoError(t, err) - defer backupPolicyClient.Delete(policy.Name, &metav1.DeleteOptions{}) + defer backupPolicyClient.Delete(context.Background(), policy.Name, metav1.DeleteOptions{}) // Wait until 2 backups are created err = timeout(5*time.Second, 5*time.Minute, func() error { - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) if err != nil { return err @@ -1129,16 +1129,16 @@ func TestBackupCluster(t *testing.T) { require.NoError(t, err) // Cleanup scheduler - backupPolicyClient.Delete(policy.Name, &metav1.DeleteOptions{}) + backupPolicyClient.Delete(context.Background(), policy.Name, metav1.DeleteOptions{}) - backups, err := backupClient.List(metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ + backups, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ MatchLabels: deplLabels, })}) require.NoError(t, err) for _, backup := range backups.Items { t.Run(fmt.Sprintf("deleting - %s", backup.Name), func(t *testing.T) { - defer backupClient.Delete(backup.Name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.Name, metav1.DeleteOptions{}) currentBackup, err := waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsAvailable) require.NoError(t, err, "backup did not become available: %s", err) @@ -1155,7 +1155,7 @@ func TestBackupCluster(t *testing.T) { // Cleanup err = timeout(time.Second, 2*time.Minute, func() error { - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) if err != nil { return err } @@ -1180,17 +1180,17 @@ func TestBackupCluster(t *testing.T) { }) policy := newBackupPolicy(depl.GetName(), "*/1 * * * *", labels, nil) - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) require.NoError(t, err) require.Len(t, list.Items, 0, "unexpected matching ArangoBackup objects") - _, err = backupPolicyClient.Create(policy) + _, err = backupPolicyClient.Create(context.Background(), policy,metav1.CreateOptions{}) require.NoError(t, err) - defer backupPolicyClient.Delete(policy.Name, &metav1.DeleteOptions{}) + defer backupPolicyClient.Delete(context.Background(), policy.Name, metav1.DeleteOptions{}) // Wait until 2 backups are created err = timeout(5*time.Second, 5*time.Minute, func() error { - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) if err != nil { return err @@ -1207,11 +1207,11 @@ func TestBackupCluster(t *testing.T) { require.NoError(t, err) // Cleanup scheduler - backupPolicyClient.Delete(policy.Name, &metav1.DeleteOptions{}) + backupPolicyClient.Delete(context.Background(), policy.Name, metav1.DeleteOptions{}) for _, deployment := range deployments { t.Run(fmt.Sprintf("deployment %s", deployment.Name), func(t *testing.T) { - backups, err := backupClient.List(metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ + backups, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: metav1.FormatLabelSelector(&metav1.LabelSelector{ MatchLabels: deployment.Labels, })}) require.NoError(t, err) @@ -1220,7 +1220,7 @@ func TestBackupCluster(t *testing.T) { for _, backup := range backups.Items { t.Run(fmt.Sprintf("deleting - %s", backup.Name), func(t *testing.T) { - defer backupClient.Delete(backup.Name, &metav1.DeleteOptions{}) + defer backupClient.Delete(context.Background(), backup.Name, metav1.DeleteOptions{}) currentBackup, err := waitUntilBackup(deploymentClient, backup.GetName(), ns, backupIsAvailable) require.NoError(t, err, "backup did not become available: %s", err) @@ -1239,7 +1239,7 @@ func TestBackupCluster(t *testing.T) { // Cleanup err = timeout(time.Second, 2*time.Minute, func() error { - list, err := backupClient.List(metav1.ListOptions{LabelSelector: selector}) + list, err := backupClient.List(context.Background(), metav1.ListOptions{LabelSelector: selector}) if err != nil { return err } diff --git a/tests/change_args_test.go b/tests/change_args_test.go index b6c7de952..28d256f90 100644 --- a/tests/change_args_test.go +++ b/tests/change_args_test.go @@ -51,7 +51,7 @@ func TestChangeArgsAgents(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeActiveFailover) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl,metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -91,7 +91,7 @@ func TestChangeArgsAgents(t *testing.T) { } pods := kubecli.CoreV1().Pods(ns) for _, m := range members.Agents { - pod, err := pods.Get(m.PodName, metav1.GetOptions{}) + pod, err := pods.Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -130,7 +130,7 @@ func TestChangeArgsDBServer(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeCluster) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -167,7 +167,7 @@ func TestChangeArgsDBServer(t *testing.T) { } pods := kubecli.CoreV1().Pods(ns) for _, m := range members.DBServers { - pod, err := pods.Get(m.PodName, metav1.GetOptions{}) + pod, err := pods.Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } diff --git a/tests/cursor_test.go b/tests/cursor_test.go index bfa0e0b0c..cd6532649 100644 --- a/tests/cursor_test.go +++ b/tests/cursor_test.go @@ -24,6 +24,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "reflect" "testing" "time" @@ -49,7 +50,7 @@ func TestCursorSingle(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeSingle) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -93,7 +94,7 @@ func TestCursorActiveFailover(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeActiveFailover) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -137,7 +138,7 @@ func TestCursorCluster(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeCluster) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/deployments_test.go b/tests/deployments_test.go index fb39e164d..04d3268fc 100644 --- a/tests/deployments_test.go +++ b/tests/deployments_test.go @@ -24,6 +24,7 @@ package tests import ( "context" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "github.com/dchest/uniuri" @@ -82,7 +83,7 @@ func deploymentSubTest(t *testing.T, mode api.DeploymentMode, engine api.Storage depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) require.NoError(t, err, fmt.Sprintf("Create deployment failed: %v", err)) defer deferedCleanupDeployment(c, depl.GetName(), ns) @@ -123,11 +124,11 @@ func TestMultiDeployment(t *testing.T) { depl2.Spec.SetDefaults(depl2.GetName()) // this must be last // Create deployments - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl1) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl1, metav1.CreateOptions{}) require.NoError(t, err, fmt.Sprintf("Deployment creation failed: %v", err)) defer deferedCleanupDeployment(c, depl1.GetName(), ns) - _, err = c.DatabaseV1().ArangoDeployments(ns).Create(depl2) + _, err = c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl2, metav1.CreateOptions{}) require.NoError(t, err, fmt.Sprintf("Deployment creation failed: %v", err)) defer deferedCleanupDeployment(c, depl2.GetName(), ns) diff --git a/tests/environments_test.go b/tests/environments_test.go index 999a5a65e..129f75014 100644 --- a/tests/environments_test.go +++ b/tests/environments_test.go @@ -22,6 +22,7 @@ package tests import ( + "context" "fmt" "strings" "testing" @@ -48,7 +49,7 @@ func TestEnvironmentProduction(t *testing.T) { ns := getNamespace(t) kubecli := mustNewKubeClient(t) - nodeList, err := kubecli.CoreV1().Nodes().List(metav1.ListOptions{}) + nodeList, err := kubecli.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{}) if err != nil { t.Fatalf("Unable to receive node list: %v", err) } @@ -75,7 +76,7 @@ func TestEnvironmentProduction(t *testing.T) { } // Create deployment - if _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl); err != nil { + if _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}); err != nil { // REVIEW - should the test already fail here t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/immutable_test.go b/tests/immutable_test.go index 5d342ac1b..47eed1524 100644 --- a/tests/immutable_test.go +++ b/tests/immutable_test.go @@ -26,6 +26,7 @@ package tests import ( "context" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "time" @@ -50,7 +51,7 @@ func TestImmutableFields(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/load_balancer_source_ranges_test.go b/tests/load_balancer_source_ranges_test.go index be43ff46f..7a2de6ada 100644 --- a/tests/load_balancer_source_ranges_test.go +++ b/tests/load_balancer_source_ranges_test.go @@ -54,7 +54,7 @@ func TestLoadBalancingSourceRanges(t *testing.T) { depl.Spec.ExternalAccess.LoadBalancerSourceRanges = append(depl.Spec.ExternalAccess.LoadBalancerSourceRanges, "1.2.3.0/24", "0.0.0.0/0") // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -90,7 +90,7 @@ func TestLoadBalancingSourceRanges(t *testing.T) { counter := 0 var foundExternalIP string for { - if svc, err := svcs.Get(eaServiceName, metav1.GetOptions{}); err == nil { + if svc, err := svcs.Get(context.Background(), eaServiceName, metav1.GetOptions{}); err == nil { spec := svc.Spec ranges := spec.LoadBalancerSourceRanges if len(ranges) != 2 { @@ -127,7 +127,7 @@ func TestLoadBalancingSourceRanges(t *testing.T) { counter = 0 for { time.Sleep(time.Second) - if svc, err := svcs.Get(eaServiceName, metav1.GetOptions{}); err == nil { + if svc, err := svcs.Get(context.Background(), eaServiceName, metav1.GetOptions{}); err == nil { spec := svc.Spec ranges := spec.LoadBalancerSourceRanges good := true diff --git a/tests/load_balancer_test.go b/tests/load_balancer_test.go index 641d478ef..2c6f6ff43 100644 --- a/tests/load_balancer_test.go +++ b/tests/load_balancer_test.go @@ -24,6 +24,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "reflect" "testing" "time" @@ -69,7 +70,7 @@ func loadBalancingCursorSubtest(t *testing.T, useVst bool) { depl.Spec.Mode = api.NewMode(api.DeploymentModeCluster) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/member_resilience_test.go b/tests/member_resilience_test.go index c148a3736..b205f1d5f 100644 --- a/tests/member_resilience_test.go +++ b/tests/member_resilience_test.go @@ -52,7 +52,7 @@ func TestMemberResilienceAgents(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -75,7 +75,7 @@ func TestMemberResilienceAgents(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -84,17 +84,17 @@ func TestMemberResilienceAgents(t *testing.T) { targetAgent := apiObject.Status.Members.Agents[0] for i := 0; i < 5; i++ { // Get current pod so we can compare UID later - originalPod, err := kubecli.CoreV1().Pods(ns).Get(targetAgent.PodName, metav1.GetOptions{}) + originalPod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetAgent.PodName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pod %s: %v", targetAgent.PodName, err) } - if err := kubecli.CoreV1().Pods(ns).Delete(targetAgent.PodName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().Pods(ns).Delete(context.Background(), targetAgent.PodName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pod %s: %v", targetAgent.PodName, err) } if i < 4 { // Wait for pod to return with different UID op := func() error { - pod, err := kubecli.CoreV1().Pods(ns).Get(targetAgent.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetAgent.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -109,7 +109,7 @@ func TestMemberResilienceAgents(t *testing.T) { } else { // Wait for member to be replaced op := func() error { - updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -153,7 +153,7 @@ func TestMemberResilienceCoordinators(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -176,7 +176,7 @@ func TestMemberResilienceCoordinators(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -185,17 +185,17 @@ func TestMemberResilienceCoordinators(t *testing.T) { targetCoordinator := apiObject.Status.Members.Coordinators[0] for i := 0; i < 5; i++ { // Get current pod so we can compare UID later - originalPod, err := kubecli.CoreV1().Pods(ns).Get(targetCoordinator.PodName, metav1.GetOptions{}) + originalPod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetCoordinator.PodName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pod %s: %v", targetCoordinator.PodName, err) } - if err := kubecli.CoreV1().Pods(ns).Delete(targetCoordinator.PodName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().Pods(ns).Delete(context.Background(), targetCoordinator.PodName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pod %s: %v", targetCoordinator.PodName, err) } if i < 4 { // Wait for pod to return with different UID op := func() error { - pod, err := kubecli.CoreV1().Pods(ns).Get(targetCoordinator.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetCoordinator.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -210,7 +210,7 @@ func TestMemberResilienceCoordinators(t *testing.T) { } else { // Wait for member to be replaced op := func() error { - updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -250,7 +250,7 @@ func TestMemberResilienceDBServers(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -273,7 +273,7 @@ func TestMemberResilienceDBServers(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -282,17 +282,17 @@ func TestMemberResilienceDBServers(t *testing.T) { targetServer := apiObject.Status.Members.DBServers[0] for i := 0; i < 5; i++ { // Get current pod so we can compare UID later - originalPod, err := kubecli.CoreV1().Pods(ns).Get(targetServer.PodName, metav1.GetOptions{}) + originalPod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetServer.PodName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pod %s: %v", targetServer.PodName, err) } - if err := kubecli.CoreV1().Pods(ns).Delete(targetServer.PodName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().Pods(ns).Delete(context.Background(), targetServer.PodName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pod %s: %v", targetServer.PodName, err) } if i < 4 { // Wait for pod to return with different UID op := func() error { - pod, err := kubecli.CoreV1().Pods(ns).Get(targetServer.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), targetServer.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -307,7 +307,7 @@ func TestMemberResilienceDBServers(t *testing.T) { } else { // Wait for member to be replaced op := func() error { - updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + updatedObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { return maskAny(err) } diff --git a/tests/metrics_test.go b/tests/metrics_test.go index 4280eb1af..518ec7caf 100644 --- a/tests/metrics_test.go +++ b/tests/metrics_test.go @@ -57,7 +57,7 @@ func TestAddingMetrics(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) require.NoErrorf(t, err, "Create deployment failed") defer deferedCleanupDeployment(c, depl.GetName(), ns) @@ -95,7 +95,7 @@ func TestAddingMetrics(t *testing.T) { return nil } for _, m := range *status { - pod, err := kubecli.CoreV1().Pods(ns).Get(m.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return err } diff --git a/tests/operator_upgrade_test.go b/tests/operator_upgrade_test.go index b2a0a98ad..1b18035b1 100644 --- a/tests/operator_upgrade_test.go +++ b/tests/operator_upgrade_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -48,7 +49,7 @@ func TestOperatorUpgradeFrom038(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - if _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl); err != nil { + if _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}); err != nil { t.Fatalf("Create deployment failed: %v", err) } defer removeDeployment(c, depl.GetName(), ns) @@ -59,7 +60,7 @@ func TestOperatorUpgradeFrom038(t *testing.T) { t.Fatalf("Deployment not running in time: %v", err) } - podsWatcher, err := kubecli.CoreV1().Pods(ns).Watch(metav1.ListOptions{ + podsWatcher, err := kubecli.CoreV1().Pods(ns).Watch(context.Background(), metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", "arangodb").String(), }) if err != nil { @@ -121,7 +122,7 @@ func TestOperatorUpgradeFrom038(t *testing.T) { func updateOperatorImage(t *testing.T, ns string, kube kubernetes.Interface, newImage string) (string, error) { for { - depl, err := kube.AppsV1().Deployments(ns).Get(operatorTestDeploymentName, metav1.GetOptions{}) + depl, err := kube.AppsV1().Deployments(ns).Get(context.Background(), operatorTestDeploymentName, metav1.GetOptions{}) if err != nil { return "", err } @@ -130,7 +131,7 @@ func updateOperatorImage(t *testing.T, ns string, kube kubernetes.Interface, new return "", err } setOperatorImage(depl, newImage) - if _, err := kube.AppsV1().Deployments(ns).Update(depl); k8sutil.IsConflict(err) { + if _, err := kube.AppsV1().Deployments(ns).Update(context.Background(), depl, metav1.UpdateOptions{}); k8sutil.IsConflict(err) { continue } else if err != nil { return "", err @@ -140,7 +141,7 @@ func updateOperatorImage(t *testing.T, ns string, kube kubernetes.Interface, new } func updateOperatorDeployment(ns string, kube kubernetes.Interface) (*appsv1.Deployment, error) { - return kube.AppsV1().Deployments(ns).Get(operatorTestDeploymentName, metav1.GetOptions{}) + return kube.AppsV1().Deployments(ns).Get(context.Background(), operatorTestDeploymentName, metav1.GetOptions{}) } func getOperatorImage(depl *appsv1.Deployment) (string, error) { @@ -164,7 +165,7 @@ func setOperatorImage(depl *appsv1.Deployment, image string) { func waitForArangoDBPodsGone(ns string, kube kubernetes.Interface) error { return retry.Retry(func() error { - _, err := kube.CoreV1().Pods(ns).List(metav1.ListOptions{ + _, err := kube.CoreV1().Pods(ns).List(context.Background(), metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", "arangodb").String(), }) if k8sutil.IsNotFound(err) { @@ -176,7 +177,7 @@ func waitForArangoDBPodsGone(ns string, kube kubernetes.Interface) error { func waitForOperatorImage(ns string, kube kubernetes.Interface, image string) error { return retry.Retry(func() error { - pods, err := kube.CoreV1().Pods(ns).List(metav1.ListOptions{ + pods, err := kube.CoreV1().Pods(ns).List(context.Background(), metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", operatorTestDeploymentName).String(), }) if err != nil { diff --git a/tests/pc_test.go b/tests/pc_test.go index 56a7b76c9..0c32be1e5 100644 --- a/tests/pc_test.go +++ b/tests/pc_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -20,13 +21,13 @@ import ( func waitForPriorityOfServerGroup(kube kubernetes.Interface, c versioned.Interface, depl, ns string, group api.ServerGroup, priority int32) error { return retry.Retry(func() error { - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(depl, metav1.GetOptions{}) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl, metav1.GetOptions{}) if err != nil { return err } for _, m := range apiObject.Status.Members.MembersOfGroup(group) { - pod, err := kube.CoreV1().Pods(apiObject.Namespace).Get(m.PodName, metav1.GetOptions{}) + pod, err := kube.CoreV1().Pods(apiObject.Namespace).Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return err } @@ -59,29 +60,29 @@ func TestPriorityClasses(t *testing.T) { highClassValue := int32(2000) // Create two priority classes - if _, err := kubecli.SchedulingV1beta1().PriorityClasses().Create(&v1beta1.PriorityClass{ + if _, err := kubecli.SchedulingV1beta1().PriorityClasses().Create(context.Background(), &v1beta1.PriorityClass{ Value: lowClassValue, GlobalDefault: false, Description: "Low priority test class", ObjectMeta: metav1.ObjectMeta{ Name: lowClassName, }, - }); err != nil { + }, metav1.CreateOptions{}); err != nil { t.Fatalf("Could not create PC: %v", err) } - defer kubecli.SchedulingV1beta1().PriorityClasses().Delete(lowClassName, &metav1.DeleteOptions{}) + defer kubecli.SchedulingV1beta1().PriorityClasses().Delete(context.Background(), lowClassName, metav1.DeleteOptions{}) - if _, err := kubecli.SchedulingV1beta1().PriorityClasses().Create(&v1beta1.PriorityClass{ + if _, err := kubecli.SchedulingV1beta1().PriorityClasses().Create(context.Background(), &v1beta1.PriorityClass{ Value: highClassValue, GlobalDefault: false, Description: "Low priority test class", ObjectMeta: metav1.ObjectMeta{ Name: highClassName, }, - }); err != nil { + }, metav1.CreateOptions{}); err != nil { t.Fatalf("Could not create PC: %v", err) } - defer kubecli.SchedulingV1beta1().PriorityClasses().Delete(highClassName, &metav1.DeleteOptions{}) + defer kubecli.SchedulingV1beta1().PriorityClasses().Delete(context.Background(), highClassName, metav1.DeleteOptions{}) // Prepare deployment config depl := newDeployment("test-pc-" + uniuri.NewLen(4)) @@ -94,7 +95,7 @@ func TestPriorityClasses(t *testing.T) { defer deferedCleanupDeployment(c, depl.GetName(), ns) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/pdb_test.go b/tests/pdb_test.go index 0d161b0ec..c3d61bfcc 100644 --- a/tests/pdb_test.go +++ b/tests/pdb_test.go @@ -1,6 +1,7 @@ package tests import ( + "context" "fmt" "testing" "time" @@ -24,7 +25,7 @@ func min(a int, b int) int { } func isPDBAsExpected(kube kubernetes.Interface, name, ns string, expectedMinAvailable int) error { - pdb, err := kube.PolicyV1beta1().PodDisruptionBudgets(ns).Get(name, metav1.GetOptions{}) + pdb, err := kube.PolicyV1beta1().PodDisruptionBudgets(ns).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { return err } @@ -88,7 +89,7 @@ func TestPDBCreate(t *testing.T) { assert.NoError(t, depl.Spec.Validate()) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/persistent_volumes_test.go b/tests/persistent_volumes_test.go index 99611ab6a..bf2bf75f7 100644 --- a/tests/persistent_volumes_test.go +++ b/tests/persistent_volumes_test.go @@ -22,6 +22,7 @@ package tests import ( + "context" "fmt" "strings" "testing" @@ -82,7 +83,7 @@ func TestPVCExists(t *testing.T) { assert.NoError(t, deploymentTemplate.Spec.Validate()) // Create deployment - _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(deploymentTemplate) + _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(context.Background(), deploymentTemplate, metav1.CreateOptions{}) assert.NoError(t, err, "failed to create deplyment: %s", err) _, err = waitUntilDeployment(deploymentClient, deploymentTemplate.GetName(), k8sNameSpace, deploymentIsReady()) @@ -116,7 +117,7 @@ func TestPVCResize(t *testing.T) { assert.NoError(t, deploymentTemplate.Spec.Validate()) // Create deployment - _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(deploymentTemplate) + _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(context.Background(), deploymentTemplate, metav1.CreateOptions{}) defer removeDeployment(deploymentClient, deploymentTemplate.GetName(), k8sNameSpace) assert.NoError(t, err, "failed to create deplyment: %s", err) @@ -125,7 +126,7 @@ func TestPVCResize(t *testing.T) { // Get list of all pvcs for dbservers for _, m := range depl.Status.Members.DBServers { - pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) assert.NoError(t, err, "failed to get pvc: %s", err) volumeSize, ok := pvc.Spec.Resources.Requests[corev1.ResourceStorage] assert.True(t, ok, "pvc does not have storage resource") @@ -147,7 +148,7 @@ func TestPVCResize(t *testing.T) { if err := retry.Retry(func() error { // Get list of all pvcs for dbservers and check for new size for _, m := range depl.Status.Members.DBServers { - pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { return err } @@ -158,7 +159,7 @@ func TestPVCResize(t *testing.T) { if volumeSize.Cmp(size10GB) != 0 { return fmt.Errorf("wrong pvc size: expected: %s, found: %s", size10GB.String(), volumeSize.String()) } - volume, err := k8sClient.CoreV1().PersistentVolumes().Get(pvc.Spec.VolumeName, metav1.GetOptions{}) + volume, err := k8sClient.CoreV1().PersistentVolumes().Get(context.Background(), pvc.Spec.VolumeName, metav1.GetOptions{}) if err != nil { return err } @@ -203,7 +204,7 @@ func TestPVCTemplateResize(t *testing.T) { deploymentTemplate.Spec.DBServers.VolumeClaimTemplate.Spec.Resources.Requests[corev1.ResourceStorage] = size08GB // Create deployment - _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(deploymentTemplate) + _, err := deploymentClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(context.Background(), deploymentTemplate, metav1.CreateOptions{}) defer removeDeployment(deploymentClient, deploymentTemplate.GetName(), k8sNameSpace) assert.NoError(t, err, "failed to create deplyment: %s", err) @@ -212,7 +213,7 @@ func TestPVCTemplateResize(t *testing.T) { // Get list of all pvcs for dbservers for _, m := range depl.Status.Members.DBServers { - pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) assert.NoError(t, err, "failed to get pvc: %s", err) volumeSize, ok := pvc.Spec.Resources.Requests[corev1.ResourceStorage] assert.True(t, ok, "pvc does not have storage resource") @@ -234,7 +235,7 @@ func TestPVCTemplateResize(t *testing.T) { if err := retry.Retry(func() error { // Get list of all pvcs for dbservers and check for new size for _, m := range depl.Status.Members.DBServers { - pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { return err } @@ -245,7 +246,7 @@ func TestPVCTemplateResize(t *testing.T) { if volumeSize.Cmp(size10GB) != 0 { return fmt.Errorf("wrong pvc size: expected: %s, found: %s", size10GB.String(), volumeSize.String()) } - volume, err := k8sClient.CoreV1().PersistentVolumes().Get(pvc.Spec.VolumeName, metav1.GetOptions{}) + volume, err := k8sClient.CoreV1().PersistentVolumes().Get(context.Background(), pvc.Spec.VolumeName, metav1.GetOptions{}) if err != nil { return err } @@ -283,10 +284,10 @@ func TestPVCChangeStorage(t *testing.T) { newStorage.ObjectMeta = metav1.ObjectMeta{ Name: newStorageClassName, } - newStorage, err := kubecli.StorageV1().StorageClasses().Create(newStorage) + newStorage, err := kubecli.StorageV1().StorageClasses().Create(context.Background(), newStorage, metav1.CreateOptions{}) require.NoError(t, err) defer func() { - err := kubecli.StorageV1().StorageClasses().Delete(newStorage.Name, &metav1.DeleteOptions{}) + err := kubecli.StorageV1().StorageClasses().Delete(context.Background(), newStorage.Name, metav1.DeleteOptions{}) assert.NoError(t, err) }() @@ -319,7 +320,7 @@ func TestPVCChangeStorage(t *testing.T) { require.NoError(t, err) // Create deployment - _, err = arangoClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(depl) + _, err = arangoClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(context.Background(), depl, metav1.CreateOptions{}) require.NoError(t, err, "failed to create deployment: %s", err) defer deferedCleanupDeployment(arangoClient, depl.GetName(), k8sNameSpace) @@ -356,7 +357,7 @@ func TestPVCChangeStorage(t *testing.T) { } for _, server := range deployment.Status.Members.DBServers { - pvc, err := kubecli.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(server.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := kubecli.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), server.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { return err } @@ -397,10 +398,10 @@ func TestPVCChangeStorageDeprecated(t *testing.T) { newStorage.ObjectMeta = metav1.ObjectMeta{ Name: newStorageClassName, } - newStorage, err := kubecli.StorageV1().StorageClasses().Create(newStorage) + newStorage, err := kubecli.StorageV1().StorageClasses().Create(context.Background(), newStorage, metav1.CreateOptions{}) require.NoError(t, err) defer func() { - err := kubecli.StorageV1().StorageClasses().Delete(newStorage.Name, &metav1.DeleteOptions{}) + err := kubecli.StorageV1().StorageClasses().Delete(context.Background(), newStorage.Name, metav1.DeleteOptions{}) assert.NoError(t, err) }() @@ -422,7 +423,7 @@ func TestPVCChangeStorageDeprecated(t *testing.T) { require.NoError(t, err) // Create deployment - _, err = arangoClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(depl) + _, err = arangoClient.DatabaseV1().ArangoDeployments(k8sNameSpace).Create(context.Background(), depl, metav1.CreateOptions{}) require.NoError(t, err, "failed to create deployment: %s", err) defer deferedCleanupDeployment(arangoClient, depl.GetName(), k8sNameSpace) @@ -447,7 +448,7 @@ func TestPVCChangeStorageDeprecated(t *testing.T) { // Check for updated deployment isDeprecatedStorageChanged := func(deployment *api.ArangoDeployment) error { for _, server := range deployment.Status.Members.DBServers { - pvc, err := kubecli.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(server.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := kubecli.CoreV1().PersistentVolumeClaims(k8sNameSpace).Get(context.Background(), server.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { return err } @@ -473,7 +474,7 @@ func TestPVCChangeStorageDeprecated(t *testing.T) { func getDefaultStorageClassOrDie(t *testing.T, kubecli kubernetes.Interface) *storagev1.StorageClass { var defaultStorageClass *storagev1.StorageClass - storageClasses, err := kubecli.StorageV1().StorageClasses().List(metav1.ListOptions{}) + storageClasses, err := kubecli.StorageV1().StorageClasses().List(context.Background(), metav1.ListOptions{}) require.NoError(t, err) for _, sc := range storageClasses.Items { diff --git a/tests/predicates.go b/tests/predicates.go index 2dc319d1b..21e89a8c7 100644 --- a/tests/predicates.go +++ b/tests/predicates.go @@ -23,6 +23,7 @@ package tests import ( + "context" "fmt" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -50,7 +51,7 @@ func resourcesAsRequested(kubecli kubernetes.Interface, ns string) func(obj *api return obj.ForeachServerGroup(func(group api.ServerGroup, spec api.ServerGroupSpec, status *api.MemberStatusList) error { for _, m := range *status { - pod, err := kubecli.CoreV1().Pods(ns).Get(m.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return err } diff --git a/tests/prepull_image_util.go b/tests/prepull_image_util.go index 9c1540f59..5da7360b7 100644 --- a/tests/prepull_image_util.go +++ b/tests/prepull_image_util.go @@ -23,6 +23,7 @@ package tests import ( + "context" "crypto/sha1" "fmt" "strings" @@ -75,16 +76,16 @@ func prepullArangoImage(cli kubernetes.Interface, image, namespace string) error }, } // Create DS - if _, err := cli.AppsV1().DaemonSets(namespace).Create(ds); err != nil { + if _, err := cli.AppsV1().DaemonSets(namespace).Create(context.Background(), ds, metav1.CreateOptions{}); err != nil { return maskAny(err) } // Cleanup on exit defer func() { - cli.AppsV1().DaemonSets(namespace).Delete(name, &metav1.DeleteOptions{}) + cli.AppsV1().DaemonSets(namespace).Delete(context.Background(), name, metav1.DeleteOptions{}) }() // Now wait for it to be ready op := func() error { - current, err := cli.AppsV1().DaemonSets(namespace).Get(name, metav1.GetOptions{}) + current, err := cli.AppsV1().DaemonSets(namespace).Get(context.Background(), name, metav1.GetOptions{}) if err != nil { return maskAny(err) } diff --git a/tests/resilience_test.go b/tests/resilience_test.go index 62d8f017c..338e1c639 100644 --- a/tests/resilience_test.go +++ b/tests/resilience_test.go @@ -57,7 +57,7 @@ func TestResiliencePod(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -80,7 +80,7 @@ func TestResiliencePod(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -89,14 +89,14 @@ func TestResiliencePod(t *testing.T) { apiObject.ForeachServerGroup(func(group api.ServerGroup, spec api.ServerGroupSpec, status *api.MemberStatusList) error { for _, m := range *status { // Get current pod so we can compare UID later - originalPod, err := kubecli.CoreV1().Pods(ns).Get(m.PodName, metav1.GetOptions{}) + originalPod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pod %s: %v", m.PodName, err) } // Get current PVC so we can compare UID later var originalPVCUID types.UID if m.PersistentVolumeClaimName != "" { - originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get PVC %s: %v", m.PersistentVolumeClaimName, err) } else { @@ -104,12 +104,12 @@ func TestResiliencePod(t *testing.T) { } } // Now delete the pod - if err := kubecli.CoreV1().Pods(ns).Delete(m.PodName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().Pods(ns).Delete(context.Background(), m.PodName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pod %s: %v", m.PodName, err) } // Wait for pod to return with different UID op := func() error { - pod, err := kubecli.CoreV1().Pods(ns).Get(m.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), m.PodName, metav1.GetOptions{}) if err != nil { return maskAny(err) } @@ -123,7 +123,7 @@ func TestResiliencePod(t *testing.T) { } // Now that the Pod has been replaced, check that the PVC has NOT been replaced (if any) if m.PersistentVolumeClaimName != "" { - pvc, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get PVC %s: %v", m.PersistentVolumeClaimName, err) } else if originalPVCUID != pvc.GetUID() { @@ -174,7 +174,7 @@ func testResiliencePVC(testGroup api.ServerGroup, t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -197,7 +197,7 @@ func testResiliencePVC(testGroup api.ServerGroup, t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -210,16 +210,16 @@ func testResiliencePVC(testGroup api.ServerGroup, t *testing.T) { } for _, m := range *status { // Get current pvc so we can compare UID later - originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pvc %s: %v", m.PersistentVolumeClaimName, err) } - if err := kubecli.CoreV1().PersistentVolumeClaims(ns).Delete(m.PersistentVolumeClaimName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().PersistentVolumeClaims(ns).Delete(context.Background(), m.PersistentVolumeClaimName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pvc %s: %v", m.PersistentVolumeClaimName, err) } // Wait for pvc to return with different UID op := func() error { - pvc, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + pvc, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { if k8sutil.IsNotFound(err) && group == api.ServerGroupDBServers { // DBServer member is completely replaced when cleaned out, so the PVC will have a different name also @@ -267,7 +267,7 @@ func TestResiliencePVDBServer(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -290,7 +290,7 @@ func TestResiliencePVDBServer(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -308,7 +308,7 @@ func TestResiliencePVDBServer(t *testing.T) { continue } // Get current pvc so we can compare UID later - originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(m.PersistentVolumeClaimName, metav1.GetOptions{}) + originalPVC, err := kubecli.CoreV1().PersistentVolumeClaims(ns).Get(context.Background(), m.PersistentVolumeClaimName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get pvc %s: %v", m.PersistentVolumeClaimName, err) } @@ -316,11 +316,11 @@ func TestResiliencePVDBServer(t *testing.T) { pvName := originalPVC.Spec.VolumeName require.NotEmpty(t, pvName, "VolumeName of %s must be non-empty", originalPVC.GetName()) // Delete PV - if err := kubecli.CoreV1().PersistentVolumes().Delete(pvName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().PersistentVolumes().Delete(context.Background(), pvName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pv %s: %v", pvName, err) } // Delete PVC - if err := kubecli.CoreV1().PersistentVolumeClaims(ns).Delete(m.PersistentVolumeClaimName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().PersistentVolumeClaims(ns).Delete(context.Background(), m.PersistentVolumeClaimName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete pvc %s: %v", m.PersistentVolumeClaimName, err) } // Delete Pod @@ -371,7 +371,7 @@ func TestResilienceService(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -394,7 +394,7 @@ func TestResilienceService(t *testing.T) { } // Fetch latest status so we know all member details - apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -402,16 +402,16 @@ func TestResilienceService(t *testing.T) { // Delete database service // Get current pod so we can compare UID later serviceName := apiObject.Status.ServiceName - originalService, err := kubecli.CoreV1().Services(ns).Get(serviceName, metav1.GetOptions{}) + originalService, err := kubecli.CoreV1().Services(ns).Get(context.Background(), serviceName, metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get service %s: %v", serviceName, err) } - if err := kubecli.CoreV1().Services(ns).Delete(serviceName, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().Services(ns).Delete(context.Background(), serviceName, metav1.DeleteOptions{}); err != nil { t.Fatalf("Failed to delete service %s: %v", serviceName, err) } // Wait for service to return with different UID op := func() error { - service, err := kubecli.CoreV1().Services(ns).Get(serviceName, metav1.GetOptions{}) + service, err := kubecli.CoreV1().Services(ns).Get(context.Background(), serviceName, metav1.GetOptions{}) if err != nil { return maskAny(err) } diff --git a/tests/resources_test.go b/tests/resources_test.go index 4fc316cc3..9af306907 100644 --- a/tests/resources_test.go +++ b/tests/resources_test.go @@ -23,7 +23,9 @@ package tests import ( + "context" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1" @@ -58,7 +60,7 @@ func TestResourcesChangeLimitsCluster(t *testing.T) { defer deferedCleanupDeployment(c, depl.GetName(), ns) // Create deployment - _, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := deploymentClient.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) defer removeDeployment(deploymentClient, depl.GetName(), ns) assert.NoError(t, err, "failed to create deplyment: %s", err) diff --git a/tests/rocksdb_encryption_test.go b/tests/rocksdb_encryption_test.go index 01e62d33f..e3c9bf9f9 100644 --- a/tests/rocksdb_encryption_test.go +++ b/tests/rocksdb_encryption_test.go @@ -25,6 +25,7 @@ package tests import ( "context" "crypto/rand" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" @@ -66,7 +67,7 @@ func TestRocksDBEncryptionSingle(t *testing.T) { } // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/scale_test.go b/tests/scale_test.go index 26a1eee00..ef7071dd9 100644 --- a/tests/scale_test.go +++ b/tests/scale_test.go @@ -24,6 +24,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "github.com/dchest/uniuri" @@ -49,7 +50,7 @@ func TestScaleClusterNonTLS(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -120,7 +121,7 @@ func TestScaleCluster(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -194,7 +195,7 @@ func TestScaleClusterWithSync(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/secret_hashes_test.go b/tests/secret_hashes_test.go index a324a25c8..8f3fae8f3 100644 --- a/tests/secret_hashes_test.go +++ b/tests/secret_hashes_test.go @@ -54,7 +54,7 @@ func TestSecretHashesRootUser(t *testing.T) { depl.Spec.Bootstrap.PasswordSecretNames[api.UserNameRoot] = api.PasswordSecretNameAuto // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -107,14 +107,14 @@ func TestSecretHashesRootUser(t *testing.T) { } secretRoot.Data[constants.SecretPassword] = []byte("1") - _, err = kubecli.CoreV1().Secrets(ns).Update(secretRoot) + _, err = kubecli.CoreV1().Secrets(ns).Update(context.Background(), secretRoot, metav1.UpdateOptions{}) if err != nil { t.Fatalf("Root secret '%s' has not been changed: %v", secretRootName, err) } err = retry.Retry(func() error { // check if root secret hash has changed - depl, err = c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + depl, err = c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } diff --git a/tests/service_account_test.go b/tests/service_account_test.go index 7b24eec48..b39af5f6a 100644 --- a/tests/service_account_test.go +++ b/tests/service_account_test.go @@ -58,7 +58,7 @@ func TestServiceAccountSingle(t *testing.T) { depl.Spec.Single.ServiceAccountName = util.NewString(saName) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -107,7 +107,7 @@ func TestServiceAccountActiveFailover(t *testing.T) { depl.Spec.Agents.ServiceAccountName = util.NewString(saName) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -158,7 +158,7 @@ func TestServiceAccountCluster(t *testing.T) { depl.Spec.Coordinators.ServiceAccountName = util.NewString(saName) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -215,7 +215,7 @@ func TestServiceAccountClusterWithSync(t *testing.T) { depl.Spec.SyncWorkers.ServiceAccountName = util.NewString(saName) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -264,7 +264,7 @@ func mustCreateServiceAccount(kubecli kubernetes.Interface, namePrefix, ns strin Name: strings.ToLower(namePrefix + uniuri.NewLen(4)), }, } - if _, err := kubecli.CoreV1().ServiceAccounts(ns).Create(&s); err != nil { + if _, err := kubecli.CoreV1().ServiceAccounts(ns).Create(context.Background(), &s, metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create service account: %v", err) } return s.GetName() @@ -272,7 +272,7 @@ func mustCreateServiceAccount(kubecli kubernetes.Interface, namePrefix, ns strin // deleteServiceAccount deletes a service account with given name in given namespace. func deleteServiceAccount(kubecli kubernetes.Interface, name, ns string) error { - if err := kubecli.CoreV1().ServiceAccounts(ns).Delete(name, &metav1.DeleteOptions{}); err != nil { + if err := kubecli.CoreV1().ServiceAccounts(ns).Delete(context.Background(), name, metav1.DeleteOptions{}); err != nil { return maskAny(err) } return nil @@ -283,7 +283,7 @@ func deleteServiceAccount(kubecli kubernetes.Interface, name, ns string) error { func checkMembersUsingServiceAccount(kubecli kubernetes.Interface, ns string, members []api.MemberStatus, serviceAccountName string, t *testing.T) { pods := kubecli.CoreV1().Pods(ns) for _, m := range members { - if p, err := pods.Get(m.PodName, metav1.GetOptions{}); err != nil { + if p, err := pods.Get(context.Background(), m.PodName, metav1.GetOptions{}); err != nil { t.Errorf("Failed to get pod for member '%s': %v", m.ID, err) } else if p.Spec.ServiceAccountName != serviceAccountName { t.Errorf("Expected pod '%s' to have serviceAccountName '%s', got '%s'", p.GetName(), serviceAccountName, p.Spec.ServiceAccountName) diff --git a/tests/sidecar_test.go b/tests/sidecar_test.go index 4fff87ff4..56faf32e1 100644 --- a/tests/sidecar_test.go +++ b/tests/sidecar_test.go @@ -24,6 +24,7 @@ package tests import ( "context" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "time" @@ -123,7 +124,7 @@ func runSideCarTest(t *testing.T, spec SideCarTest) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/simple_test.go b/tests/simple_test.go index 9633b76b7..173af86d6 100644 --- a/tests/simple_test.go +++ b/tests/simple_test.go @@ -24,6 +24,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "github.com/dchest/uniuri" @@ -47,7 +48,7 @@ func TestSimpleSingle(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeSingle) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -85,7 +86,7 @@ func TestSimpleActiveFailover(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeActiveFailover) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -123,7 +124,7 @@ func TestSimpleCluster(t *testing.T) { depl.Spec.Mode = api.NewMode(api.DeploymentModeCluster) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } @@ -164,7 +165,7 @@ func TestSimpleClusterWithSync(t *testing.T) { depl.Spec.Sync.Enabled = util.NewBool(true) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/sync_test.go b/tests/sync_test.go index ce07386fd..4574ff68f 100644 --- a/tests/sync_test.go +++ b/tests/sync_test.go @@ -43,7 +43,7 @@ import ( // waitUntilReplicationNotFound waits until a replication resource is deleted func waitUntilReplicationNotFound(ns, name string, cli versioned.Interface) error { return retry.Retry(func() error { - if _, err := cli.ReplicationV1().ArangoDeploymentReplications(ns).Get(name, metav1.GetOptions{}); k8sutil.IsNotFound(err) { + if _, err := cli.ReplicationV1().ArangoDeploymentReplications(ns).Get(context.Background(), name, metav1.GetOptions{}); k8sutil.IsNotFound(err) { return nil } else if err != nil { return err @@ -71,7 +71,7 @@ func TestSyncSimple(t *testing.T) { depla.Spec.Sync.ExternalAccess.AccessPackageSecretNames = []string{apname} // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depla) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depla, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment a failed: %v", err) } @@ -85,7 +85,7 @@ func TestSyncSimple(t *testing.T) { deplb.Spec.Sync.ExternalAccess.Type = api.NewExternalAccessType(api.ExternalAccessTypeNone) // Create deployment - _, err = c.DatabaseV1().ArangoDeployments(ns).Create(deplb) + _, err = c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), deplb, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment b failed: %v", err) } @@ -106,7 +106,7 @@ func TestSyncSimple(t *testing.T) { repl.Spec.Source.Authentication.KeyfileSecretName = util.NewString(apname) repl.Spec.Source.TLS.CASecretName = util.NewString(apname) repl.Spec.Destination.DeploymentName = util.NewString(deplb.GetName()) - _, err = c.ReplicationV1().ArangoDeploymentReplications(ns).Create(repl) + _, err = c.ReplicationV1().ArangoDeploymentReplications(ns).Create(context.Background(), repl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create replication resource failed: %v", err) } @@ -169,7 +169,7 @@ func TestSyncToggleEnabled(t *testing.T) { depl.Spec.Image = util.NewString(img) // Create deployment - _, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + _, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/test_util.go b/tests/test_util.go index 689fe6502..964c65d94 100644 --- a/tests/test_util.go +++ b/tests/test_util.go @@ -323,7 +323,7 @@ func newDeploymentWithValidation(name string, adjustDeployment func(*api.ArangoD func waitUntilDeployment(cli versioned.Interface, deploymentName, ns string, predicate func(*api.ArangoDeployment) error, timeout ...time.Duration) (*api.ArangoDeployment, error) { var result *api.ArangoDeployment op := func() error { - obj, err := cli.DatabaseV1().ArangoDeployments(ns).Get(deploymentName, metav1.GetOptions{}) + obj, err := cli.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), deploymentName, metav1.GetOptions{}) if err != nil { result = nil return maskAny(err) @@ -351,7 +351,7 @@ func waitUntilDeployment(cli versioned.Interface, deploymentName, ns string, pre func waitUntilSecret(cli kubernetes.Interface, secretName, ns string, predicate func(*v1.Secret) error, timeout time.Duration) (*v1.Secret, error) { var result *v1.Secret op := func() error { - obj, err := cli.CoreV1().Secrets(ns).Get(secretName, metav1.GetOptions{}) + obj, err := cli.CoreV1().Secrets(ns).Get(context.Background(), secretName, metav1.GetOptions{}) if err != nil { result = nil return maskAny(err) @@ -376,7 +376,7 @@ func waitUntilSecret(cli kubernetes.Interface, secretName, ns string, predicate func waitUntilService(cli kubernetes.Interface, serviceName, ns string, predicate func(*v1.Service) error, timeout time.Duration) (*v1.Service, error) { var result *v1.Service op := func() error { - obj, err := cli.CoreV1().Services(ns).Get(serviceName, metav1.GetOptions{}) + obj, err := cli.CoreV1().Services(ns).Get(context.Background(), serviceName, metav1.GetOptions{}) if err != nil { result = nil return maskAny(err) @@ -401,7 +401,7 @@ func waitUntilService(cli kubernetes.Interface, serviceName, ns string, predicat func waitUntilEndpoints(cli kubernetes.Interface, serviceName, ns string, predicate func(*v1.Endpoints) error, timeout time.Duration) (*v1.Endpoints, error) { var result *v1.Endpoints op := func() error { - obj, err := cli.CoreV1().Endpoints(ns).Get(serviceName, metav1.GetOptions{}) + obj, err := cli.CoreV1().Endpoints(ns).Get(context.Background(), serviceName, metav1.GetOptions{}) if err != nil { result = nil return maskAny(err) @@ -424,7 +424,7 @@ func waitUntilEndpoints(cli kubernetes.Interface, serviceName, ns string, predic // is no longer found. func waitUntilSecretNotFound(cli kubernetes.Interface, secretName, ns string, timeout time.Duration) error { op := func() error { - if _, err := cli.CoreV1().Secrets(ns).Get(secretName, metav1.GetOptions{}); k8sutil.IsNotFound(err) { + if _, err := cli.CoreV1().Secrets(ns).Get(context.Background(), secretName, metav1.GetOptions{}); k8sutil.IsNotFound(err) { return nil } else if err != nil { return maskAny(err) @@ -597,7 +597,7 @@ func waitUntilClusterSidecarsEqualSpec(t *testing.T, spec api.DeploymentMode, de for start := time.Now(); time.Since(start) < 600*time.Second; { // Fetch latest status so we know all member details - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(depl.GetName(), metav1.GetOptions{}) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), depl.GetName(), metav1.GetOptions{}) if err != nil { t.Fatalf("Failed to get deployment: %v", err) } @@ -669,12 +669,12 @@ func clusterHealthEqualsSpec(h driver.ClusterHealth, spec api.DeploymentSpec) er func updateDeployment(cli versioned.Interface, deploymentName, ns string, update func(*api.DeploymentSpec)) (*api.ArangoDeployment, error) { for { // Get current version - current, err := cli.DatabaseV1().ArangoDeployments(ns).Get(deploymentName, metav1.GetOptions{}) + current, err := cli.DatabaseV1().ArangoDeployments(ns).Get(context.Background(), deploymentName, metav1.GetOptions{}) if err != nil { return nil, maskAny(err) } update(¤t.Spec) - current, err = cli.DatabaseV1().ArangoDeployments(ns).Update(current) + current, err = cli.DatabaseV1().ArangoDeployments(ns).Update(context.Background(), current, metav1.UpdateOptions{}) if k8sutil.IsConflict(err) { // Retry } else if err != nil { @@ -686,7 +686,7 @@ func updateDeployment(cli versioned.Interface, deploymentName, ns string, update // removeDeployment removes a deployment func removeDeployment(cli versioned.Interface, deploymentName, ns string) error { - if err := cli.DatabaseV1().ArangoDeployments(ns).Delete(deploymentName, nil); err != nil && k8sutil.IsNotFound(err) { + if err := cli.DatabaseV1().ArangoDeployments(ns).Delete(context.Background(), deploymentName, metav1.DeleteOptions{}); err != nil && k8sutil.IsNotFound(err) { return maskAny(err) } return nil @@ -694,7 +694,7 @@ func removeDeployment(cli versioned.Interface, deploymentName, ns string) error // removeReplication removes a replication func removeReplication(cli versioned.Interface, replicationName, ns string) error { - if err := cli.ReplicationV1().ArangoDeploymentReplications(ns).Delete(replicationName, nil); err != nil && k8sutil.IsNotFound(err) { + if err := cli.ReplicationV1().ArangoDeploymentReplications(ns).Delete(context.Background(), replicationName, metav1.DeleteOptions{}); err != nil && k8sutil.IsNotFound(err) { return maskAny(err) } return nil @@ -726,7 +726,7 @@ func deferedCleanupReplication(cli versioned.Interface, replicationName, ns stri // removeSecret removes a secret func removeSecret(cli kubernetes.Interface, secretName, ns string) error { - if err := cli.CoreV1().Secrets(ns).Delete(secretName, nil); err != nil && k8sutil.IsNotFound(err) { + if err := cli.CoreV1().Secrets(ns).Delete(context.Background(), secretName, metav1.DeleteOptions{}); err != nil && k8sutil.IsNotFound(err) { return maskAny(err) } return nil @@ -850,7 +850,7 @@ func getPodCreationTimes(t *testing.T, kubecli kubernetes.Interface, depl *api.A for _, m := range *status { // Get pod: fmt.Printf("Looking at pod %s...\n", m.PodName) - pod, err := kubecli.CoreV1().Pods(ns).Get(m.PodName, metav1.GetOptions{}) + pod, err := kubecli.CoreV1().Pods(ns).Get(context.Background(), m.PodName, metav1.GetOptions{}) // Simply ignore error and skip pod: if err == nil { fmt.Printf("Found creation time of %v for pod %s\n", pod.GetCreationTimestamp(), m.PodName) diff --git a/tests/upgrade_test.go b/tests/upgrade_test.go index 1ec02266b..ba3fc9b96 100644 --- a/tests/upgrade_test.go +++ b/tests/upgrade_test.go @@ -24,6 +24,7 @@ package tests import ( "context" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "strings" "testing" @@ -237,7 +238,7 @@ func runUpgradeTest(t *testing.T, spec UpgradeTest) { depl.Spec.SetDefaults(depl.GetName()) // this must be last // Create deployment - deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + deployment, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) } diff --git a/tests/version_test.go b/tests/version_test.go index a7c93a465..14bcc77a7 100644 --- a/tests/version_test.go +++ b/tests/version_test.go @@ -2,6 +2,7 @@ package tests import ( "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "testing" "github.com/arangodb/go-driver" @@ -25,7 +26,7 @@ func TestIsVersionSet(t *testing.T) { depl.Spec.SetDefaults(depl.GetName()) depl.Spec.Image = util.NewString("arangodb/arangodb:" + string(expectedVersion)) // Create deployment - apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(depl) + apiObject, err := c.DatabaseV1().ArangoDeployments(ns).Create(context.Background(), depl, metav1.CreateOptions{}) if err != nil { t.Fatalf("Create deployment failed: %v", err) }