From f89adec080c98de8ea9814dc66d48b238264664f Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Wed, 23 Oct 2019 00:56:37 -0700 Subject: [PATCH] Split imports into 3 parts (#10) Signed-off-by: Tamal Saha --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- Makefile | 43 +++- cmd/stash-mongodb/main.go | 5 +- go.mod | 9 +- go.sum | 26 +-- hack/fmt.sh | 2 +- pkg/backup.go | 11 +- pkg/restore.go | 11 +- pkg/root.go | 5 +- pkg/utils.go | 5 +- vendor/kmodules.xyz/client-go/.gitignore | 5 + vendor/kmodules.xyz/client-go/.travis.yml | 25 -- vendor/kmodules.xyz/client-go/Makefile | 220 ++++++++++++++++++ vendor/kmodules.xyz/client-go/README.md | 2 +- .../apiextensions/v1beta1/cli-utils.go | 2 +- .../apiextensions/v1beta1/convert_types.go | 3 +- .../apiextensions/v1beta1/crdvalidation.go | 3 +- vendor/kmodules.xyz/client-go/go.mod | 4 +- vendor/kmodules.xyz/client-go/go.sum | 4 +- vendor/kmodules.xyz/client-go/logs/logs.go | 9 +- .../client-go/tools/analytics/analytics.go | 9 +- .../kmodules.xyz/client-go/tools/cli/cli.go | 5 +- .../tools/clientcmd/client_config.go | 3 +- .../apis/config/v1alpha1/openapi_generated.go | 6 + .../apis/config/v1alpha1/register.go | 3 +- vendor/modules.txt | 8 +- .../v1alpha1/zz_generated.conversion.go | 3 +- .../stash/apis/stash/v1alpha1/register.go | 3 +- .../apis/stash/v1beta1/backup_batch_types.go | 3 +- .../stash/v1beta1/backup_blueprint_types.go | 3 +- .../v1beta1/backup_configuration_types.go | 3 +- .../stash/v1beta1/backup_session_helpers.go | 9 +- .../stash/v1beta1/backup_session_types.go | 9 +- .../apis/stash/v1beta1/openapi_generated.go | 8 +- .../stash/apis/stash/v1beta1/register.go | 3 +- .../stash/apis/stash/v1beta1/types_helpers.go | 8 +- .../stash/apis/stash/v1beta1/validator.go | 2 +- .../stash/v1beta1/zz_generated.deepcopy.go | 7 +- vendor/stash.appscode.dev/stash/apis/util.go | 6 +- .../client/clientset/versioned/clientset.go | 7 +- .../versioned/fake/clientset_generated.go | 11 +- .../clientset/versioned/fake/register.go | 7 +- .../clientset/versioned/scheme/register.go | 7 +- .../v1alpha1/fake/fake_repositories_client.go | 3 +- .../v1alpha1/fake/fake_snapshot.go | 3 +- .../v1alpha1/repositories_client.go | 5 +- .../typed/repositories/v1alpha1/snapshot.go | 5 +- .../stash/v1alpha1/fake/fake_recovery.go | 3 +- .../stash/v1alpha1/fake/fake_repository.go | 3 +- .../typed/stash/v1alpha1/fake/fake_restic.go | 3 +- .../stash/v1alpha1/fake/fake_stash_client.go | 3 +- .../typed/stash/v1alpha1/recovery.go | 5 +- .../typed/stash/v1alpha1/repository.go | 5 +- .../versioned/typed/stash/v1alpha1/restic.go | 5 +- .../typed/stash/v1alpha1/stash_client.go | 5 +- .../typed/stash/v1beta1/backupbatch.go | 5 +- .../typed/stash/v1beta1/backupblueprint.go | 5 +- .../stash/v1beta1/backupconfiguration.go | 5 +- .../typed/stash/v1beta1/backupsession.go | 5 +- .../stash/v1beta1/fake/fake_backupbatch.go | 3 +- .../v1beta1/fake/fake_backupblueprint.go | 3 +- .../v1beta1/fake/fake_backupconfiguration.go | 3 +- .../stash/v1beta1/fake/fake_backupsession.go | 3 +- .../typed/stash/v1beta1/fake/fake_function.go | 3 +- .../stash/v1beta1/fake/fake_restoresession.go | 3 +- .../stash/v1beta1/fake/fake_stash_client.go | 3 +- .../typed/stash/v1beta1/fake/fake_task.go | 3 +- .../versioned/typed/stash/v1beta1/function.go | 5 +- .../typed/stash/v1beta1/restoresession.go | 5 +- .../typed/stash/v1beta1/stash_client.go | 5 +- .../versioned/typed/stash/v1beta1/task.go | 5 +- .../stash/v1beta1/util/backupblueprint.go | 5 +- .../stash/v1beta1/util/backupconfiguration.go | 5 +- .../typed/stash/v1beta1/util/backupsession.go | 5 +- .../typed/stash/v1beta1/util/function.go | 5 +- .../typed/stash/v1beta1/util/kubernetes.go | 3 +- .../stash/v1beta1/util/restoresession.go | 5 +- .../typed/stash/v1beta1/util/task.go | 5 +- .../client/listers/stash/v1alpha1/recovery.go | 3 +- .../listers/stash/v1alpha1/repository.go | 3 +- .../client/listers/stash/v1alpha1/restic.go | 3 +- .../listers/stash/v1beta1/backupbatch.go | 3 +- .../listers/stash/v1beta1/backupblueprint.go | 3 +- .../stash/v1beta1/backupconfiguration.go | 3 +- .../listers/stash/v1beta1/backupsession.go | 3 +- .../client/listers/stash/v1beta1/function.go | 3 +- .../listers/stash/v1beta1/restoresession.go | 3 +- .../client/listers/stash/v1beta1/task.go | 3 +- .../stash/pkg/restic/backup.go | 12 +- .../stash/pkg/restic/commands.go | 12 +- .../stash/pkg/restic/config.go | 3 +- .../stash/pkg/restic/metrics.go | 7 +- .../stash/pkg/restic/output.go | 2 +- .../stash/pkg/restic/restore.go | 4 +- .../stash/pkg/restic/util.go | 10 +- .../stash/pkg/util/backup_configuration.go | 9 +- .../stash.appscode.dev/stash/pkg/util/crds.go | 5 +- .../stash/pkg/util/init_container.go | 7 +- .../stash.appscode.dev/stash/pkg/util/job.go | 15 +- .../stash/pkg/util/kubernetes.go | 9 +- .../stash/pkg/util/options.go | 3 +- .../stash/pkg/util/restic.go | 5 +- .../stash/pkg/util/restore_session.go | 5 +- .../stash/pkg/util/sidecar.go | 9 +- .../stash.appscode.dev/stash/pkg/util/util.go | 22 +- 106 files changed, 575 insertions(+), 270 deletions(-) delete mode 100644 vendor/kmodules.xyz/client-go/.travis.yml create mode 100644 vendor/kmodules.xyz/client-go/Makefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b618584c4..bcad7fb43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: crazy-max/ghaction-docker-buildx@master + uses: crazy-max/ghaction-docker-buildx@v1 with: version: latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b8978765..990a98251 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: crazy-max/ghaction-docker-buildx@master + uses: crazy-max/ghaction-docker-buildx@v1 with: version: latest diff --git a/Makefile b/Makefile index 488586ab9..48657cb3b 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ SHELL=/bin/bash -o pipefail -# The binary to build (just the basename). +GO_PKG := stash.appscode.dev +REPO := $(notdir $(shell pwd)) BIN := stash-mongodb COMPRESS ?= no @@ -50,7 +51,8 @@ NEW_RESTIC_VER := 0.9.5 ### These variables should not need tweaking. ### -SRC_DIRS := cmd pkg # directories which hold app source (not vendored) +SRC_PKGS := cmd pkg +SRC_DIRS := $(SRC_PKGS) # directories which hold app source (not vendored) DOCKER_PLATFORMS := linux/amd64 BIN_PLATFORMS := $(DOCKER_PLATFORMS) @@ -80,7 +82,11 @@ endif # Directories that we need created to build/test. BUILD_DIRS := bin/$(OS)_$(ARCH) \ .go/bin/$(OS)_$(ARCH) \ - .go/cache + .go/cache \ + hack/config \ + $(HOME)/.credentials \ + $(HOME)/.kube \ + $(HOME)/.minikube DOCKERFILE_PROD = Dockerfile.in DOCKERFILE_DBG = Dockerfile.dbg @@ -141,7 +147,10 @@ fmt: $(BUILD_DIRS) --env HTTP_PROXY=$(HTTP_PROXY) \ --env HTTPS_PROXY=$(HTTPS_PROXY) \ $(BUILD_IMAGE) \ - ./hack/fmt.sh $(SRC_DIRS) + /bin/bash -c " \ + REPO_PKG=$(GO_PKG) \ + ./hack/fmt.sh $(SRC_DIRS) \ + " build: $(OUTBIN) @@ -231,7 +240,10 @@ docker-manifest-%: DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a $(IMAGE):$(VERSION_$*) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(VERSION_$*)_$(subst /,_,$(PLATFORM))) DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(IMAGE):$(VERSION_$*) -test: $(BUILD_DIRS) +.PHONY: test +test: unit-tests + +unit-tests: $(BUILD_DIRS) @docker run \ -i \ --rm \ @@ -270,7 +282,7 @@ lint: $(BUILD_DIRS) --env GO111MODULE=on \ --env GOFLAGS="-mod=vendor" \ $(BUILD_IMAGE) \ - golangci-lint run --enable $(ADDTL_LINTERS) --deadline=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default --skip-dirs=client,vendor + golangci-lint run --enable $(ADDTL_LINTERS) --deadline=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default $(BUILD_DIRS): @mkdir -p $@ @@ -278,8 +290,25 @@ $(BUILD_DIRS): .PHONY: dev dev: gen fmt push +.PHONY: verify +verify: verify-modules verify-gen + +.PHONY: verify-modules +verify-modules: + GO111MODULE=on go mod tidy + GO111MODULE=on go mod vendor + @if !(git diff --exit-code HEAD); then \ + echo "go module files are out of date"; exit 1; \ + fi + +.PHONY: verify-gen +verify-gen: gen fmt + @if !(git diff --exit-code HEAD); then \ + echo "files are out of date, run make gen fmt"; exit 1; \ + fi + .PHONY: ci -ci: lint test build #cover +ci: verify-gen lint build unit-tests #cover .PHONY: qa qa: diff --git a/cmd/stash-mongodb/main.go b/cmd/stash-mongodb/main.go index 6f9b0a705..27d0c6793 100644 --- a/cmd/stash-mongodb/main.go +++ b/cmd/stash-mongodb/main.go @@ -4,12 +4,13 @@ import ( "os" "runtime" + "stash.appscode.dev/mongodb/pkg" + _ "stash.appscode.dev/stash/client/clientset/versioned/fake" + "github.com/appscode/go/log" _ "k8s.io/client-go/kubernetes/fake" _ "k8s.io/client-go/plugin/pkg/client/auth" "kmodules.xyz/client-go/logs" - "stash.appscode.dev/mongodb/pkg" - _ "stash.appscode.dev/stash/client/clientset/versioned/fake" ) func main() { diff --git a/go.mod b/go.mod index 0db88bd3c..f9687ef2a 100644 --- a/go.mod +++ b/go.mod @@ -9,14 +9,13 @@ require ( github.com/spf13/cobra v0.0.5 k8s.io/apimachinery v0.0.0-20190508063446-a3da69d3723c k8s.io/client-go v11.0.0+incompatible - kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625 + kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57 kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 - kubedb.dev/apimachinery v0.13.0-rc.1.0.20191018033414-e2aca1186349 - stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2 + kubedb.dev/apimachinery v0.13.0-rc.2 + stash.appscode.dev/stash v0.9.0-rc.2 ) replace ( - git.apache.org/thrift.git => github.com/apache/thrift v0.12.0 github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.2+incompatible k8s.io/api => k8s.io/api v0.0.0-20190313235455-40a48860b5ab k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190315093550-53c4693659ed @@ -30,6 +29,6 @@ replace ( k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 k8s.io/kubernetes => k8s.io/kubernetes v1.14.0 k8s.io/metrics => k8s.io/metrics v0.0.0-20190314001731-1bd6a4002213 - k8s.io/utils => k8s.io/utils v0.0.0-20190221042446-c2654d5206da + k8s.io/utils => k8s.io/utils v0.0.0-20190514214443-0a167cbac756 sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 ) diff --git a/go.sum b/go.sum index 1128a1e03..6ced83337 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,9 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT contrib.go.opencensus.io/exporter/ocagent v0.4.1/go.mod h1:b6YwD5Q3Yvj4yk0CDK5vGXexygNzI09aXUdDEakQBgA= contrib.go.opencensus.io/exporter/ocagent v0.4.6 h1:xVeoJwnzMbseoL9YWhohR6SN/GncvP1p/fznasLkT/E= contrib.go.opencensus.io/exporter/ocagent v0.4.6/go.mod h1:YuG83h+XWwqWjvCqn7vK4KSyLKhThY3+gNGQ37iS2V0= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +git.apache.org/thrift.git v0.0.0-20181218151757-9b75e4fe745a/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v31.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -513,6 +516,7 @@ gomodules.xyz/envsubst v0.1.0/go.mod h1:2o5f7bd13XIITbE2ZKieE05YkqB2KDoZkqKccGeb gomodules.xyz/jsonpatch/v2 v2.0.0 h1:OyHbl+7IOECpPKfVK42oFr6N7+Y2dR+Jsb/IiDV3hOo= gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/stow v0.2.0/go.mod h1:YDDPM4nmJgQhxq4I5aGtLM/xrvJzDSVM/fbc7NGizpY= +gomodules.xyz/stow v0.2.2/go.mod h1:YDDPM4nmJgQhxq4I5aGtLM/xrvJzDSVM/fbc7NGizpY= gomodules.xyz/version v0.0.0-20190507203204-7cec7ee542d3/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU= gomodules.xyz/version v0.1.0 h1:inGItCg/egI0jPMeIE0SQkiDIJaodOMoCrxYqasQLR0= gomodules.xyz/version v0.1.0/go.mod h1:Y8xuV02mL/45psyPKG3NCVOwvAOy6T5Kx0l3rCjKSjU= @@ -587,18 +591,15 @@ k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= +k8s.io/utils v0.0.0-20190514214443-0a167cbac756 h1:2XBbostlqrw13zVYimyqcj/Om2P4B26oMzv+m2cj//k= +k8s.io/utils v0.0.0-20190514214443-0a167cbac756/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= kmodules.xyz/client-go v0.0.0-20190808141354-bbb9e14f60ab/go.mod h1:1GI6h5D31op/2D+Hrn9DhXW6iUd5wsHBQRoLeY7fndM= -kmodules.xyz/client-go v0.0.0-20191006173540-91f8ee6b6b4b/go.mod h1:1GI6h5D31op/2D+Hrn9DhXW6iUd5wsHBQRoLeY7fndM= -kmodules.xyz/client-go v0.0.0-20191014080252-6458e3cb3ca6/go.mod h1:VgT/bx3wEwarnLoDMMH5vjmKYIOO0WBPyvoCAiWKWxg= -kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625 h1:A/ceKV+HXdheKSpaY2CF7Q70E/iDKoysxiWtAuYMXyE= -kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625/go.mod h1:wFUBDofZzgkLW1sFJT5SSt6/G3ph2P8zUi5v81q5BKQ= +kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57 h1:4IsITvsVOl0W8IRABEMOqEMyJYwTCmhmfpJVIpwD4lM= +kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57/go.mod h1:BChXGI3zd3lNSjUUfDcGmvufMdqrofLI/nrndcZ4LUo= +kmodules.xyz/constants v0.0.0-20191009183447-fbd33067b8a6/go.mod h1:DbiFk1bJ1KEO94t1SlAn7tzc+Zz95rSXgyUKa2nzPmY= kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045 h1:DuvD64ouPDbv3egAUUCy5rBqs/vc218DeVVivcqfa+U= kmodules.xyz/custom-resources v0.0.0-20190927035424-65fe358bb045/go.mod h1:vlKyFcCXC+2Kfn3Fa5Z7RnBWyp4t46FSeEutNqpqMm8= kmodules.xyz/monitoring-agent-api v0.0.0-20190808150221-601a4005b7f7/go.mod h1:9v6LM+dmaAP3jjDiPOPOLPfsvD7jNjBJsi37JNCiFho= -kmodules.xyz/objectstore-api v0.0.0-20191006080053-fc8b57fadcf0/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8= -kmodules.xyz/objectstore-api v0.0.0-20191014164602-39104ec912b7/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8= kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3 h1:64QSexLk/Dio4+L8Ge1tb4c44aBiwmUwTNP2kCu6YQU= kmodules.xyz/objectstore-api v0.0.0-20191014210450-ac380fa650a3/go.mod h1:mT7lEi2IehAi64DomCPMPtlsWXOD5Fr3/mPqLIzU7T8= kmodules.xyz/offshoot-api v0.0.0-20190901210649-de049192326c h1:y54FqF02HNs2d4eJh6w+7Q2sfVLORzvZd/ueGm/t7Fg= @@ -607,8 +608,8 @@ kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1 h1:NmVj5+kPpUgoxRans2X kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1/go.mod h1:+E8HHcxBx6ja4oKOXZ6DCoQ+NjujODTgFOfgOe+ejXw= kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b h1:yd/uzBgLgsir3X4kGoznJY7CdrkgfznsNKvD4p2xUaQ= kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b/go.mod h1:X8J6YJvk3NqufXEDqcl2oFuL8T6+mV+AN30/miV4iJU= -kubedb.dev/apimachinery v0.13.0-rc.1.0.20191018033414-e2aca1186349 h1:GbB+QOpXyBjwj7JpFnbPG4q5Inp9CExId/h5Rl6r4x4= -kubedb.dev/apimachinery v0.13.0-rc.1.0.20191018033414-e2aca1186349/go.mod h1:XPKlQEFXiVsVasIlY6wku8iOiwqsHTsdwRI6EtnwVPk= +kubedb.dev/apimachinery v0.13.0-rc.2 h1:I/KXiJfXN/jB6zxHYsXhiVeuELjvsq17fFlTFwkIRb0= +kubedb.dev/apimachinery v0.13.0-rc.2/go.mod h1:pBjAo1UtqY09U0oqkHoDVQCO+06+aYLh9/cy4F3wasI= labix.org/v2/mgo v0.0.0-20140701140051-000000000287/go.mod h1:Lg7AYkt1uXJoR9oeSZ3W/8IXLdvOfIITgZnommstyz4= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= @@ -616,6 +617,5 @@ sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5 sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -stash.appscode.dev/stash v0.9.0-rc.1.0.20191007102408-f5a271be821a/go.mod h1:GZphLGASEViwv3yAoVSmImaHQ7qDIkY+8Cd/DQjl6g8= -stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2 h1:H2a7zLOI7Q6OxHuI8gzQKYJx/BPREOgQjbkVCLVUXYY= -stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2/go.mod h1:N8pJqTaV01TZpspiGEGfRBkJTNHkJ0ihflN0LYx3wPw= +stash.appscode.dev/stash v0.9.0-rc.2 h1:oZTmaDDTjANefmsNWYjqb0cqZYGl4JAeiewAlJJPnlE= +stash.appscode.dev/stash v0.9.0-rc.2/go.mod h1:DgbSJa5P8tV+V9dX/CxURZDnudLvgnKyuZksJF/Fp7Q= diff --git a/hack/fmt.sh b/hack/fmt.sh index 0e8cd28fd..34cab84e7 100755 --- a/hack/fmt.sh +++ b/hack/fmt.sh @@ -23,7 +23,7 @@ export GOFLAGS="-mod=vendor" TARGETS="$@" echo "Running reimport.py" -cmd="reimport.py ${TARGETS}" +cmd="reimport3.py ${REPO_PKG} ${TARGETS}" $cmd echo diff --git a/pkg/backup.go b/pkg/backup.go index f7b68b152..cdb0edeb2 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -12,6 +12,12 @@ import ( "syscall" "time" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + stash_cs "stash.appscode.dev/stash/client/clientset/versioned" + stash_cs_util "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" + "stash.appscode.dev/stash/pkg/restic" + "stash.appscode.dev/stash/pkg/util" + "github.com/appscode/go/flags" "github.com/appscode/go/log" "github.com/appscode/go/types" @@ -24,11 +30,6 @@ import ( "k8s.io/client-go/tools/clientcmd" appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned" "kubedb.dev/apimachinery/apis/config/v1alpha1" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - stash_cs "stash.appscode.dev/stash/client/clientset/versioned" - stash_cs_util "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" - "stash.appscode.dev/stash/pkg/restic" - "stash.appscode.dev/stash/pkg/util" ) var ( diff --git a/pkg/restore.go b/pkg/restore.go index 2f5d65108..f1b97dc2d 100644 --- a/pkg/restore.go +++ b/pkg/restore.go @@ -8,6 +8,12 @@ import ( "path/filepath" "strings" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + stash_cs "stash.appscode.dev/stash/client/clientset/versioned" + stash_cs_util "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" + "stash.appscode.dev/stash/pkg/restic" + "stash.appscode.dev/stash/pkg/util" + "github.com/appscode/go/flags" "github.com/appscode/go/log" "github.com/appscode/go/types" @@ -19,11 +25,6 @@ import ( "k8s.io/client-go/tools/clientcmd" appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned" "kubedb.dev/apimachinery/apis/config/v1alpha1" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - stash_cs "stash.appscode.dev/stash/client/clientset/versioned" - stash_cs_util "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" - "stash.appscode.dev/stash/pkg/restic" - "stash.appscode.dev/stash/pkg/util" ) func NewCmdRestore() *cobra.Command { diff --git a/pkg/root.go b/pkg/root.go index e290ca847..9f342d304 100644 --- a/pkg/root.go +++ b/pkg/root.go @@ -3,14 +3,15 @@ package pkg import ( "flag" + "stash.appscode.dev/stash/client/clientset/versioned/scheme" + "stash.appscode.dev/stash/pkg/util" + "github.com/appscode/go/flags" v "github.com/appscode/go/version" "github.com/spf13/cobra" clientsetscheme "k8s.io/client-go/kubernetes/scheme" "kmodules.xyz/client-go/logs" "kmodules.xyz/client-go/tools/cli" - "stash.appscode.dev/stash/client/clientset/versioned/scheme" - "stash.appscode.dev/stash/pkg/util" ) func NewRootCmd() *cobra.Command { diff --git a/pkg/utils.go b/pkg/utils.go index fe44b5bab..dd6b7e32b 100644 --- a/pkg/utils.go +++ b/pkg/utils.go @@ -6,12 +6,13 @@ import ( "strings" "time" + stash_cs "stash.appscode.dev/stash/client/clientset/versioned" + "stash.appscode.dev/stash/pkg/restic" + "github.com/appscode/go/log" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/kubernetes" appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned" - stash_cs "stash.appscode.dev/stash/client/clientset/versioned" - "stash.appscode.dev/stash/pkg/restic" ) const ( diff --git a/vendor/kmodules.xyz/client-go/.gitignore b/vendor/kmodules.xyz/client-go/.gitignore index 6b70172db..9aab71958 100644 --- a/vendor/kmodules.xyz/client-go/.gitignore +++ b/vendor/kmodules.xyz/client-go/.gitignore @@ -28,3 +28,8 @@ dist/ **/.env .vscode/ coverage.txt + +/bin +/.go + +apiserver.local.config/** diff --git a/vendor/kmodules.xyz/client-go/.travis.yml b/vendor/kmodules.xyz/client-go/.travis.yml deleted file mode 100644 index 7cc956592..000000000 --- a/vendor/kmodules.xyz/client-go/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: go -go: - - 1.x - - tip - -go_import_path: kmodules.xyz/client-go - -env: - global: - - GOFLAGS=-mod=vendor - - GO111MODULE=on - -cache: - directories: - - $HOME/.cache/go-build - - $GOPATH/pkg/mod - -install: true - -script: - - go build ./... - - ./hack/coverage.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/kmodules.xyz/client-go/Makefile b/vendor/kmodules.xyz/client-go/Makefile new file mode 100644 index 000000000..30c0e6e1d --- /dev/null +++ b/vendor/kmodules.xyz/client-go/Makefile @@ -0,0 +1,220 @@ +# Copyright 2019 AppsCode Inc. +# Copyright 2016 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SHELL=/bin/bash -o pipefail + +GO_PKG := kmodules.xyz +REPO := $(notdir $(shell pwd)) +BIN := client-go + +# This version-strategy uses git tags to set the version string +git_branch := $(shell git rev-parse --abbrev-ref HEAD) +git_tag := $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "") +commit_hash := $(shell git rev-parse --verify HEAD) +commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T) + +VERSION := $(shell git describe --tags --always --dirty) +version_strategy := commit_hash +ifdef git_tag + VERSION := $(git_tag) + version_strategy := tag +else + ifeq (,$(findstring $(git_branch),master HEAD)) + ifneq (,$(patsubst release-%,,$(git_branch))) + VERSION := $(git_branch) + version_strategy := branch + endif + endif +endif + +### +### These variables should not need tweaking. +### + +SRC_DIRS := *.go admissionregistration apiextensions apiregistration apps batch bin certificates core discovery dynamic extensions logs meta openapi policy rbac storage tools + +DOCKER_PLATFORMS := linux/amd64 linux/arm linux/arm64 +BIN_PLATFORMS := $(DOCKER_PLATFORMS) + +# Used internally. Users should pass GOOS and/or GOARCH. +OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) +ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) + +BASEIMAGE_PROD ?= gcr.io/distroless/static +BASEIMAGE_DBG ?= debian:stretch + +GO_VERSION ?= 1.12.12 +BUILD_IMAGE ?= appscode/golang-dev:$(GO_VERSION)-stretch + +OUTBIN = bin/$(OS)_$(ARCH)/$(BIN) +ifeq ($(OS),windows) + OUTBIN = bin/$(OS)_$(ARCH)/$(BIN).exe +endif + +# Directories that we need created to build/test. +BUILD_DIRS := bin/$(OS)_$(ARCH) \ + .go/bin/$(OS)_$(ARCH) \ + .go/cache \ + hack/config \ + $(HOME)/.credentials \ + $(HOME)/.kube \ + $(HOME)/.minikube + +# If you want to build all binaries, see the 'all-build' rule. +# If you want to build all containers, see the 'all-container' rule. +# If you want to build AND push all containers, see the 'all-push' rule. +all: fmt build + +# For the following OS/ARCH expansions, we transform OS/ARCH into OS_ARCH +# because make pattern rules don't match with embedded '/' characters. + +build-%: + @$(MAKE) build \ + --no-print-directory \ + GOOS=$(firstword $(subst _, ,$*)) \ + GOARCH=$(lastword $(subst _, ,$*)) + +all-build: $(addprefix build-, $(subst /,_, $(BIN_PLATFORMS))) + +version: + @echo version=$(VERSION) + @echo version_strategy=$(version_strategy) + @echo git_tag=$(git_tag) + @echo git_branch=$(git_branch) + @echo commit_hash=$(commit_hash) + @echo commit_timestamp=$(commit_timestamp) + +.PHONY: gen +gen: + @true + +fmt: $(BUILD_DIRS) + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + REPO_PKG=$(GO_PKG)/$(REPO) \ + ./hack/fmt.sh $(SRC_DIRS) \ + " + +build: $(OUTBIN) + +.PHONY: .go/$(OUTBIN) +$(OUTBIN): $(BUILD_DIRS) + @echo "making $(OUTBIN)" + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + ARCH=$(ARCH) \ + OS=$(OS) \ + VERSION=$(VERSION) \ + version_strategy=$(version_strategy) \ + git_branch=$(git_branch) \ + git_tag=$(git_tag) \ + commit_hash=$(commit_hash) \ + commit_timestamp=$(commit_timestamp) \ + ./hack/build.sh \ + " + @echo + +test: $(BUILD_DIRS) + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + $(BUILD_IMAGE) \ + /bin/bash -c " \ + ARCH=$(ARCH) \ + OS=$(OS) \ + VERSION=$(VERSION) \ + ./hack/test.sh $(SRC_DIRS) \ + " + +ADDTL_LINTERS := goconst,gofmt,goimports,unparam + +.PHONY: lint +lint: $(BUILD_DIRS) + @echo "running linter" + @docker run \ + -i \ + --rm \ + -u $$(id -u):$$(id -g) \ + -v $$(pwd):/src \ + -w /src \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin \ + -v $$(pwd)/.go/bin/$(OS)_$(ARCH):/go/bin/$(OS)_$(ARCH) \ + -v $$(pwd)/.go/cache:/.cache \ + --env HTTP_PROXY=$(HTTP_PROXY) \ + --env HTTPS_PROXY=$(HTTPS_PROXY) \ + --env GO111MODULE=on \ + --env GOFLAGS="-mod=vendor" \ + $(BUILD_IMAGE) \ + golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --skip-files="generated.*\.go$\" --skip-dirs-use-default + +$(BUILD_DIRS): + @mkdir -p $@ + +.PHONY: dev +dev: gen fmt push + +.PHONY: verify +verify: verify-modules verify-gen + +.PHONY: verify-modules +verify-modules: + GO111MODULE=on go mod tidy + GO111MODULE=on go mod vendor + @if !(git diff --exit-code HEAD); then \ + echo "go module files are out of date"; exit 1; \ + fi + +.PHONY: verify-gen +verify-gen: gen fmt + @if !(git diff --exit-code HEAD); then \ + echo "file formatting is out of date, run make gen fmt"; exit 1; \ + fi + +.PHONY: ci +ci: verify lint build test #cover + +.PHONY: clean +clean: + rm -rf .go bin diff --git a/vendor/kmodules.xyz/client-go/README.md b/vendor/kmodules.xyz/client-go/README.md index 5c7a8ed4a..a18fc91ed 100644 --- a/vendor/kmodules.xyz/client-go/README.md +++ b/vendor/kmodules.xyz/client-go/README.md @@ -1,6 +1,6 @@ [![Go Report Card](https://goreportcard.com/badge/kmodules.xyz/client-go)](https://goreportcard.com/report/kmodules.xyz/client-go) [![GoDoc](https://godoc.org/kmodules.xyz/client-go?status.svg "GoDoc")](https://godoc.org/kmodules.xyz/client-go) -[![Build Status](https://travis-ci.org/kmodules/client-go.svg?branch=master)](https://travis-ci.org/kmodules/client-go) +[![Build Status](https://github.com/kmodules/client-go/workflows/CI/badge.svg)](https://github.com/kmodules/client-go/actions?workflow=CI) [![codecov](https://codecov.io/gh/kmodules/client-go/branch/master/graph/badge.svg)](https://codecov.io/gh/kmodules/client-go) [![Slack](https://slack.appscode.com/badge.svg)](https://slack.appscode.com) [![Twitter](https://img.shields.io/twitter/follow/appscodehq.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=AppsCodeHQ) diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go index e25f2e78e..8c2f34de6 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/cli-utils.go @@ -117,7 +117,7 @@ func NewCustomResourceDefinition(config Config, options ...func(map[string]commo AdditionalPrinterColumns: config.AdditionalPrinterColumns, }, } - if config.SpecDefinitionName != "" && config.EnableValidation == true { + if config.SpecDefinitionName != "" && config.EnableValidation { crd.Spec.Validation = GetCustomResourceValidation(config.SpecDefinitionName, config.GetOpenAPIDefinitions, options) } if config.EnableStatusSubresource || config.EnableScaleSubresource { diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go index c143a644b..8be812730 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/convert_types.go @@ -62,8 +62,7 @@ func SchemaOrBoolToJSONProps(schemaOrBool *spec.SchemaOrBool, openapiSpec map[st // SchemPropsMapToJSONMap converts map[string]Schema to map[string]JSONSchemaProps func SchemPropsMapToJSONMap(schemaMap map[string]spec.Schema, openapiSpec map[string]common.OpenAPIDefinition, nested bool) map[string]extensionsobj.JSONSchemaProps { - var m map[string]extensionsobj.JSONSchemaProps - m = make(map[string]extensionsobj.JSONSchemaProps) + m := make(map[string]extensionsobj.JSONSchemaProps) for key, schema := range schemaMap { m[key] = *SchemaPropsToJSONProps(&schema, openapiSpec, nested) } diff --git a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go index abacb92bb..f85c0a39d 100644 --- a/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go +++ b/vendor/kmodules.xyz/client-go/apiextensions/v1beta1/crdvalidation.go @@ -24,8 +24,7 @@ type GetAPIDefinitions func(ref common.ReferenceCallback) map[string]common.Open // GetCustomResourceValidations returns a CRD validation spec map. It took the openapi generated definition from kube-openapi as argument func GetCustomResourceValidations(fn GetAPIDefinitions) map[string]*extensionsobj.CustomResourceValidation { openapiSpec := fn(OpenAPIRefCallBack) - var definitions map[string]*extensionsobj.CustomResourceValidation - definitions = make(map[string]*extensionsobj.CustomResourceValidation) + definitions := make(map[string]*extensionsobj.CustomResourceValidation) for key, definition := range openapiSpec { schema := definition.Schema definitions[key] = &extensionsobj.CustomResourceValidation{ diff --git a/vendor/kmodules.xyz/client-go/go.mod b/vendor/kmodules.xyz/client-go/go.mod index 2154618d4..672c60625 100644 --- a/vendor/kmodules.xyz/client-go/go.mod +++ b/vendor/kmodules.xyz/client-go/go.mod @@ -90,7 +90,7 @@ require ( k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 k8s.io/kubernetes v1.14.0 - k8s.io/utils v0.0.0-20190221042446-c2654d5206da // indirect + k8s.io/utils v0.0.0-20190221042446-c2654d5206da sigs.k8s.io/kustomize v2.0.3+incompatible // indirect sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 // indirect sigs.k8s.io/yaml v1.1.0 @@ -111,6 +111,6 @@ replace ( k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190314000639-da8327669ac5 k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 k8s.io/metrics => k8s.io/metrics v0.0.0-20190314001731-1bd6a4002213 - k8s.io/utils => k8s.io/utils v0.0.0-20190221042446-c2654d5206da + k8s.io/utils => k8s.io/utils v0.0.0-20190514214443-0a167cbac756 sigs.k8s.io/structured-merge-diff => sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 ) diff --git a/vendor/kmodules.xyz/client-go/go.sum b/vendor/kmodules.xyz/client-go/go.sum index dc4510aa6..b21370b08 100644 --- a/vendor/kmodules.xyz/client-go/go.sum +++ b/vendor/kmodules.xyz/client-go/go.sum @@ -422,8 +422,8 @@ k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= +k8s.io/utils v0.0.0-20190514214443-0a167cbac756 h1:2XBbostlqrw13zVYimyqcj/Om2P4B26oMzv+m2cj//k= +k8s.io/utils v0.0.0-20190514214443-0a167cbac756/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2 h1:9r5DY45ef9LtcA6BnkhW8MPV7OKAfbf2AUwUhq3LeRk= diff --git a/vendor/kmodules.xyz/client-go/logs/logs.go b/vendor/kmodules.xyz/client-go/logs/logs.go index 0a64edda8..5adb45d3c 100644 --- a/vendor/kmodules.xyz/client-go/logs/logs.go +++ b/vendor/kmodules.xyz/client-go/logs/logs.go @@ -24,6 +24,7 @@ import ( "github.com/golang/glog" "github.com/spf13/pflag" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/klog" ) @@ -37,7 +38,7 @@ const logFlushFreqFlagName = "log-flush-frequency" var logFlushFreq = pflag.Duration(logFlushFreqFlagName, 5*time.Second, "Maximum number of seconds between log flushes") func init() { - flag.Set("stderrthreshold", "INFO") + utilruntime.Must(flag.Set("stderrthreshold", "INFO")) } // AddFlags registers this package's flags on arbitrary FlagSets, such that they point to the @@ -65,7 +66,7 @@ func InitLogs() { func ParseFlags() { // ref: https://github.com/kubernetes/kubernetes/issues/17162#issuecomment-225596212 - flag.CommandLine.Parse([]string{}) + utilruntime.Must(flag.CommandLine.Parse([]string{})) klogFlags := flag.NewFlagSet("klog", flag.ExitOnError) klog.InitFlags(klogFlags) @@ -75,7 +76,9 @@ func ParseFlags() { f2 := klogFlags.Lookup(f1.Name) if f2 != nil { value := f1.Value.String() - f2.Value.Set(value) + // Ignore error. klog's -log_backtrace_at flag throws error when set to empty string. + // Unfortunately, there is no way to tell if a flag was set to empty string or left unset on command line. + _ = f2.Value.Set(value) } }) } diff --git a/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go b/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go index c795d3e9b..0e4fd20cb 100644 --- a/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go +++ b/vendor/kmodules.xyz/client-go/tools/analytics/analytics.go @@ -9,6 +9,8 @@ import ( "sort" "strings" + "kmodules.xyz/client-go/meta" + "github.com/appscode/go/analytics" net2 "github.com/appscode/go/net" "github.com/appscode/go/sets" @@ -19,7 +21,6 @@ import ( "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "kmodules.xyz/client-go/meta" ) const ( @@ -109,7 +110,7 @@ func ClientID() string { sort.Slice(ips, func(i, j int) bool { return bytes.Compare(ips[i], ips[j]) < 0 }) hasher := md5.New() for _, ip := range ips { - hasher.Write(ip) + _, _ = hasher.Write(ip) } return hex.EncodeToString(hasher.Sum(nil)) } @@ -146,7 +147,7 @@ func ClientID() string { sort.Slice(ips, func(i, j int) bool { return bytes.Compare(ips[i], ips[j]) < 0 }) hasher := md5.New() for _, ip := range ips { - hasher.Write(ip) + _, _ = hasher.Write(ip) } return hex.EncodeToString(hasher.Sum(nil)) } @@ -154,7 +155,7 @@ func ClientID() string { func hash(data ...string) string { hasher := md5.New() for _, x := range data { - hasher.Write([]byte(x)) + _, _ = hasher.Write([]byte(x)) } return hex.EncodeToString(hasher.Sum(nil)) } diff --git a/vendor/kmodules.xyz/client-go/tools/cli/cli.go b/vendor/kmodules.xyz/client-go/tools/cli/cli.go index 9e2ea3116..b5d82761f 100644 --- a/vendor/kmodules.xyz/client-go/tools/cli/cli.go +++ b/vendor/kmodules.xyz/client-go/tools/cli/cli.go @@ -5,10 +5,11 @@ import ( "strings" "time" + "kmodules.xyz/client-go/tools/analytics" + "github.com/appscode/go/log/golog" ga "github.com/jpillora/go-ogle-analytics" "github.com/spf13/cobra" - "kmodules.xyz/client-go/tools/analytics" ) const ( @@ -29,7 +30,7 @@ func SendAnalytics(c *cobra.Command, version string) { if client, err := ga.NewClient(gaTrackingCode); err == nil { client.ClientID(AnalyticsClientID) parts := strings.Split(c.CommandPath(), " ") - client.Send(ga.NewEvent(parts[0], strings.Join(parts[1:], "/")).Label(version)) + _ = client.Send(ga.NewEvent(parts[0], strings.Join(parts[1:], "/")).Label(version)) } } diff --git a/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go b/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go index de4e422dc..a300d3d35 100644 --- a/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go +++ b/vendor/kmodules.xyz/client-go/tools/clientcmd/client_config.go @@ -4,6 +4,8 @@ import ( "net" "os" + "kmodules.xyz/client-go/meta" + "github.com/golang/glog" "github.com/pkg/errors" "github.com/spf13/pflag" @@ -11,7 +13,6 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "kmodules.xyz/client-go/meta" ) // BuildConfigFromFlags is a helper function that builds configs from a master diff --git a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go index aca806e65..130186255 100644 --- a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/openapi_generated.go @@ -15343,6 +15343,12 @@ func schema_kmodulesxyz_objectstore_api_api_v1_S3Spec(ref common.ReferenceCallba Format: "", }, }, + "region": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, }, }, diff --git a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/register.go b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/register.go index e2007a9c6..8d4f3f71a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/register.go +++ b/vendor/kubedb.dev/apimachinery/apis/config/v1alpha1/register.go @@ -1,10 +1,11 @@ package v1alpha1 import ( + "kubedb.dev/apimachinery/apis/config" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "kubedb.dev/apimachinery/apis/config" ) var SchemeGroupVersion = schema.GroupVersion{Group: config.GroupName, Version: "v1alpha1"} diff --git a/vendor/modules.txt b/vendor/modules.txt index 799aa0f99..d2e99a80b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -495,11 +495,11 @@ k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/util/proto # k8s.io/kubernetes v1.14.0 => k8s.io/kubernetes v1.14.0 k8s.io/kubernetes/pkg/util/hash -# k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 => k8s.io/utils v0.0.0-20190221042446-c2654d5206da +# k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 => k8s.io/utils v0.0.0-20190514214443-0a167cbac756 k8s.io/utils/integer k8s.io/utils/buffer k8s.io/utils/trace -# kmodules.xyz/client-go v0.0.0-20191016085444-3044854ca625 +# kmodules.xyz/client-go v0.0.0-20191023042933-b12d1ccfaf57 kmodules.xyz/client-go/logs kmodules.xyz/client-go/tools/cli kmodules.xyz/client-go/tools/analytics @@ -528,7 +528,7 @@ kmodules.xyz/openshift/client/clientset/versioned/scheme kmodules.xyz/openshift/apis/security/v1 # kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b kmodules.xyz/webhook-runtime/apis/workload/v1 -# kubedb.dev/apimachinery v0.13.0-rc.1.0.20191018033414-e2aca1186349 +# kubedb.dev/apimachinery v0.13.0-rc.2 kubedb.dev/apimachinery/apis/config/v1alpha1 kubedb.dev/apimachinery/apis/config # sigs.k8s.io/kustomize v2.0.3+incompatible @@ -556,7 +556,7 @@ sigs.k8s.io/kustomize/pkg/expansion sigs.k8s.io/kustomize/pkg/transformers/config/defaultconfig # sigs.k8s.io/yaml v1.1.0 sigs.k8s.io/yaml -# stash.appscode.dev/stash v0.9.0-rc.1.0.20191018180359-9ef3cfeba2a2 +# stash.appscode.dev/stash v0.9.0-rc.2 stash.appscode.dev/stash/client/clientset/versioned/fake stash.appscode.dev/stash/apis/stash/v1beta1 stash.appscode.dev/stash/client/clientset/versioned diff --git a/vendor/stash.appscode.dev/stash/apis/repositories/v1alpha1/zz_generated.conversion.go b/vendor/stash.appscode.dev/stash/apis/repositories/v1alpha1/zz_generated.conversion.go index 0bf31b993..633749436 100644 --- a/vendor/stash.appscode.dev/stash/apis/repositories/v1alpha1/zz_generated.conversion.go +++ b/vendor/stash.appscode.dev/stash/apis/repositories/v1alpha1/zz_generated.conversion.go @@ -23,9 +23,10 @@ package v1alpha1 import ( unsafe "unsafe" + repositories "stash.appscode.dev/stash/apis/repositories" + conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - repositories "stash.appscode.dev/stash/apis/repositories" ) func init() { diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/register.go b/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/register.go index 87aca41ee..22639c276 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/register.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1alpha1/register.go @@ -1,10 +1,11 @@ package v1alpha1 import ( + "stash.appscode.dev/stash/apis/stash" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "stash.appscode.dev/stash/apis/stash" ) var SchemeGroupVersion = schema.GroupVersion{Group: stash.GroupName, Version: "v1alpha1"} diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_batch_types.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_batch_types.go index 3d9a36c2c..fa44b6f2f 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_batch_types.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_batch_types.go @@ -1,9 +1,10 @@ package v1beta1 import ( + "stash.appscode.dev/stash/apis/stash/v1alpha1" + core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" ) const ( diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_blueprint_types.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_blueprint_types.go index 74559d644..552b4b9f5 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_blueprint_types.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_blueprint_types.go @@ -1,10 +1,11 @@ package v1beta1 import ( + "stash.appscode.dev/stash/apis/stash/v1alpha1" + core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ofst "kmodules.xyz/offshoot-api/api/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" ) const ( diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_types.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_types.go index b66a58be5..1e26b295a 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_types.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_configuration_types.go @@ -1,11 +1,12 @@ package v1beta1 import ( + "stash.appscode.dev/stash/apis/stash/v1alpha1" + core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ofst "kmodules.xyz/offshoot-api/api/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" ) const ( diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_helpers.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_helpers.go index 3c707024f..b4d9108ef 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_helpers.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_helpers.go @@ -39,9 +39,14 @@ func (bs BackupSession) CustomResourceDefinition() *apiextensions.CustomResource EnableStatusSubresource: true, AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{ { - Name: "BackupConfiguration", + Name: "Invoker-Type", Type: "string", - JSONPath: ".spec.backupConfiguration.name", + JSONPath: ".spec.invoker.kind", + }, + { + Name: "Invoker-Name", + Type: "string", + JSONPath: ".spec.invoker.name", }, { Name: "Phase", diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_types.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_types.go index dedff6783..fc2fa1969 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_types.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/backup_session_types.go @@ -1,7 +1,6 @@ package v1beta1 import ( - core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -18,7 +17,8 @@ const ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=backupsessions,singular=backupsession,categories={stash,appscode,all} // +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="BackupConfiguration",type="string",JSONPath=".spec.backupConfiguration.name" +// +kubebuilder:printcolumn:name="Invoker-Type",type="string",JSONPath=".spec.invoker.kind" +// +kubebuilder:printcolumn:name="Invoker-Name",type="string",JSONPath=".spec.invoker.name" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" type BackupSession struct { @@ -32,11 +32,6 @@ type BackupSessionSpec struct { // Invoker refers to the BackupConfiguration or BackupBatch being used to invoke this backup session // +optional Invoker BackupInvokerRef `json:"invoker,omitempty"` - - // BackupConfiguration indicates the target BackupConfiguration crd - // Deprecated: Use Invoker - // +optional - BackupConfiguration *core.LocalObjectReference `json:"backupConfiguration,omitempty"` } type BackupSessionPhase string diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/openapi_generated.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/openapi_generated.go index fa3b73b98..05f5fc59a 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/openapi_generated.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/openapi_generated.go @@ -16737,17 +16737,11 @@ func schema_stash_apis_stash_v1beta1_BackupSessionSpec(ref common.ReferenceCallb Ref: ref("stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef"), }, }, - "backupConfiguration": { - SchemaProps: spec.SchemaProps{ - Description: "BackupConfiguration indicates the target BackupConfiguration crd Deprecated: Use Invoker", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef"}, + "stash.appscode.dev/stash/apis/stash/v1beta1.BackupInvokerRef"}, } } diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/register.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/register.go index ce19aa2b1..49c87892d 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/register.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/register.go @@ -1,10 +1,11 @@ package v1beta1 import ( + "stash.appscode.dev/stash/apis/stash" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "stash.appscode.dev/stash/apis/stash" ) var SchemeGroupVersion = schema.GroupVersion{Group: stash.GroupName, Version: "v1beta1"} diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go index 7dcc2bd1e..f9470a14f 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/types_helpers.go @@ -1,8 +1,9 @@ package v1beta1 import ( - "k8s.io/kube-openapi/pkg/common" "stash.appscode.dev/stash/apis/stash/v1alpha1" + + "k8s.io/kube-openapi/pkg/common" ) const ( @@ -12,10 +13,7 @@ const ( // TODO: complete func (t TargetRef) IsWorkload() bool { - if t.Kind == "Deployment" { - return true - } - return false + return t.Kind == "Deployment" } func GetOpenAPIDefinitionsWithRetentionPolicy(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/validator.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/validator.go index 18bf1b588..9464b25aa 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/validator.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/validator.go @@ -30,7 +30,7 @@ func (r RestoreSession) IsValid() error { } // ensure that no two rules with non-emtpy targetHosts matches for a host - res := make(map[string]int, 0) + res := make(map[string]int) for i, rule := range r.Spec.Rules { for _, host := range rule.TargetHosts { v, ok := res[host] diff --git a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/zz_generated.deepcopy.go b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/zz_generated.deepcopy.go index 0290104de..a0506cb58 100644 --- a/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/zz_generated.deepcopy.go +++ b/vendor/stash.appscode.dev/stash/apis/stash/v1beta1/zz_generated.deepcopy.go @@ -412,7 +412,7 @@ func (in *BackupSession) DeepCopyInto(out *BackupSession) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) return } @@ -472,11 +472,6 @@ func (in *BackupSessionList) DeepCopyObject() runtime.Object { func (in *BackupSessionSpec) DeepCopyInto(out *BackupSessionSpec) { *out = *in out.Invoker = in.Invoker - if in.BackupConfiguration != nil { - in, out := &in.BackupConfiguration, &out.BackupConfiguration - *out = new(v1.LocalObjectReference) - **out = **in - } return } diff --git a/vendor/stash.appscode.dev/stash/apis/util.go b/vendor/stash.appscode.dev/stash/apis/util.go index c1b18bb69..da8ecfb66 100644 --- a/vendor/stash.appscode.dev/stash/apis/util.go +++ b/vendor/stash.appscode.dev/stash/apis/util.go @@ -4,7 +4,8 @@ const ( StashKey = "stash.appscode.com" VersionTag = StashKey + "/tag" - KeyDeleteJobOnCompletion = StashKey + "/delete-job-on-completion" + KeyDeleteJobOnCompletion = StashKey + "/delete-job-on-completion" + AllowDeletingJobOnCompletion = "true" ) const ( @@ -13,9 +14,11 @@ const ( KindReplicationController = "ReplicationController" KindStatefulSet = "StatefulSet" KindDaemonSet = "DaemonSet" + KindPod = "Pod" KindPersistentVolumeClaim = "PersistentVolumeClaim" KindAppBinding = "AppBinding" KindDeploymentConfig = "DeploymentConfig" + KindSecret = "Secret" ) const ( @@ -24,6 +27,7 @@ const ( ResourcePluralReplicationController = "replicationcontrollers" ResourcePluralStatefulSet = "statefulsets" ResourcePluralDaemonSet = "daemonsets" + ResourcePluralPod = "pods" ResourcePluralPersistentVolumeClaim = "persistentvolumeclaims" ResourcePluralAppBinding = "appbindings" ResourcePluralDeploymentConfig = "deploymentconfigs" diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/clientset.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/clientset.go index 0e699829a..f0cac6be1 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/clientset.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/clientset.go @@ -19,12 +19,13 @@ limitations under the License. package versioned import ( - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" repositoriesv1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1" stashv1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1" stashv1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" ) type Interface interface { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/clientset_generated.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/clientset_generated.go index a76f30f59..2473bebe2 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/clientset_generated.go @@ -19,11 +19,6 @@ limitations under the License. package fake import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" clientset "stash.appscode.dev/stash/client/clientset/versioned" repositoriesv1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1" fakerepositoriesv1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake" @@ -31,6 +26,12 @@ import ( fakestashv1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake" stashv1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" fakestashv1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/register.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/register.go index 65684ff87..2586be98c 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/register.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/fake/register.go @@ -19,14 +19,15 @@ limitations under the License. package fake import ( + repositoriesv1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" + stashv1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + stashv1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - repositoriesv1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" - stashv1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - stashv1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) var scheme = runtime.NewScheme() diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/scheme/register.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/scheme/register.go index bb0c0c5cc..b1b146750 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/scheme/register.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/scheme/register.go @@ -19,14 +19,15 @@ limitations under the License. package scheme import ( + repositoriesv1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" + stashv1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + stashv1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - repositoriesv1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" - stashv1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - stashv1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) var Scheme = runtime.NewScheme() diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_repositories_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_repositories_client.go index 031089555..fa44d2c5a 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_repositories_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_repositories_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1" ) type FakeRepositoriesV1alpha1 struct { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_snapshot.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_snapshot.go index ad389c1be..f7183f1de 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_snapshot.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/fake/fake_snapshot.go @@ -19,11 +19,12 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" ) // FakeSnapshots implements SnapshotInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/repositories_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/repositories_client.go index b134664ab..687bf1378 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/repositories_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/repositories_client.go @@ -19,10 +19,11 @@ limitations under the License. package v1alpha1 import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" v1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" "stash.appscode.dev/stash/client/clientset/versioned/scheme" + + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" ) type RepositoriesV1alpha1Interface interface { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/snapshot.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/snapshot.go index a392665e5..3f0ee4eaa 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/snapshot.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/repositories/v1alpha1/snapshot.go @@ -21,10 +21,11 @@ package v1alpha1 import ( "time" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" v1alpha1 "stash.appscode.dev/stash/apis/repositories/v1alpha1" scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + rest "k8s.io/client-go/rest" ) // SnapshotsGetter has a method to return a SnapshotInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_recovery.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_recovery.go index a593330db..725e765bc 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_recovery.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_recovery.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // FakeRecoveries implements RecoveryInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_repository.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_repository.go index fafb53ebe..bf9b5e27c 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_repository.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_repository.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // FakeRepositories implements RepositoryInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_restic.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_restic.go index a17feb4f5..436c3c011 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_restic.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_restic.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // FakeRestics implements ResticInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_stash_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_stash_client.go index 472b1d732..c9258bcf9 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_stash_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/fake/fake_stash_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1" ) type FakeStashV1alpha1 struct { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/recovery.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/recovery.go index 27954b412..31209931a 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/recovery.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/recovery.go @@ -21,12 +21,13 @@ package v1alpha1 import ( "time" + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // RecoveriesGetter has a method to return a RecoveryInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/repository.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/repository.go index 5ba97ee3d..b9075db47 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/repository.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/repository.go @@ -21,12 +21,13 @@ package v1alpha1 import ( "time" + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // RepositoriesGetter has a method to return a RepositoryInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/restic.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/restic.go index 9ddea0b57..7920904e6 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/restic.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/restic.go @@ -21,12 +21,13 @@ package v1alpha1 import ( "time" + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // ResticsGetter has a method to return a ResticInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/stash_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/stash_client.go index c16199740..8d676e10e 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/stash_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1alpha1/stash_client.go @@ -19,10 +19,11 @@ limitations under the License. package v1alpha1 import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" "stash.appscode.dev/stash/client/clientset/versioned/scheme" + + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" ) type StashV1alpha1Interface interface { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go index 334e5a028..42bfb0c6a 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupbatch.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // BackupBatchesGetter has a method to return a BackupBatchInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupblueprint.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupblueprint.go index fd704a2f5..124c36338 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupblueprint.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupblueprint.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // BackupBlueprintsGetter has a method to return a BackupBlueprintInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupconfiguration.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupconfiguration.go index 00b88ec5c..740850272 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupconfiguration.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupconfiguration.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // BackupConfigurationsGetter has a method to return a BackupConfigurationInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupsession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupsession.go index 38f9adaa6..35f0ef80c 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupsession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/backupsession.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // BackupSessionsGetter has a method to return a BackupSessionInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go index 9aadc4df7..cda68aa62 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupbatch.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeBackupBatches implements BackupBatchInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupblueprint.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupblueprint.go index e99553fd0..936b29c41 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupblueprint.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupblueprint.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeBackupBlueprints implements BackupBlueprintInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupconfiguration.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupconfiguration.go index d049be70e..aecec5ca8 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupconfiguration.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupconfiguration.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeBackupConfigurations implements BackupConfigurationInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupsession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupsession.go index 3c5ed9fbf..747cdecf6 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupsession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_backupsession.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeBackupSessions implements BackupSessionInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_function.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_function.go index bd70b8984..ac80266a6 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_function.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_function.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeFunctions implements FunctionInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_restoresession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_restoresession.go index b2dd1e9b8..2d4568221 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_restoresession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_restoresession.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeRestoreSessions implements RestoreSessionInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go index fccf8d042..c66f7fb6d 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_stash_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) type FakeStashV1beta1 struct { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_task.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_task.go index 61d972f71..88cee150f 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_task.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/fake/fake_task.go @@ -19,13 +19,14 @@ limitations under the License. package fake import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FakeTasks implements TaskInterface diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/function.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/function.go index 7b757f256..c775322c6 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/function.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/function.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // FunctionsGetter has a method to return a FunctionInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/restoresession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/restoresession.go index 3da282ca4..f202b7694 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/restoresession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/restoresession.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // RestoreSessionsGetter has a method to return a RestoreSessionInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/stash_client.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/stash_client.go index 8979c58cd..724e97b32 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/stash_client.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/stash_client.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" "stash.appscode.dev/stash/client/clientset/versioned/scheme" + + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" ) type StashV1beta1Interface interface { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/task.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/task.go index 6a7eb56f5..0a43a1790 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/task.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/task.go @@ -21,12 +21,13 @@ package v1beta1 import ( "time" + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - scheme "stash.appscode.dev/stash/client/clientset/versioned/scheme" ) // TasksGetter has a method to return a TaskInterface. diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupblueprint.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupblueprint.go index 81c5fefa2..bfbb0d1cd 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupblueprint.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupblueprint.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchBackupBlueprint(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.BackupBlueprint) *api.BackupBlueprint) (*api.BackupBlueprint, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go index 47a09a407..d2e97698b 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupconfiguration.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchBackupConfiguration(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.BackupConfiguration) *api.BackupConfiguration) (*api.BackupConfiguration, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go index a15e5ab4d..819bea964 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/backupsession.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchBackupSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(bs *api_v1beta1.BackupSession) *api_v1beta1.BackupSession) (*api_v1beta1.BackupSession, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go index 5081fd292..4c0271c1d 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/function.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchFunction(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(fn *api.Function) *api.Function) (*api.Function, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go index d5380f6bb..ccb444880 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/kubernetes.go @@ -4,11 +4,12 @@ import ( "fmt" "reflect" + api "stash.appscode.dev/stash/apis/stash/v1alpha1" + jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime/schema" "kmodules.xyz/client-go/meta" - api "stash.appscode.dev/stash/apis/stash/v1alpha1" ) var json = jsoniter.ConfigFastest diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go index 354f7df79..3ba10fabb 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/restoresession.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchRestoreSession(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api_v1beta1.RestoreSession) *api_v1beta1.RestoreSession) (*api_v1beta1.RestoreSession, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go index c865d7616..9a19f8c3a 100644 --- a/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go +++ b/vendor/stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util/task.go @@ -3,6 +3,9 @@ package util import ( "fmt" + api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" + jsonpatch "github.com/evanphx/json-patch" "github.com/golang/glog" kerr "k8s.io/apimachinery/pkg/api/errors" @@ -10,8 +13,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" kutil "kmodules.xyz/client-go" - api "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1" ) func CreateOrPatchTask(c cs.StashV1beta1Interface, meta metav1.ObjectMeta, transform func(in *api.Task) *api.Task) (*api.Task, kutil.VerbType, error) { diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/recovery.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/recovery.go index 8b93cf6e7..74650c203 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/recovery.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/recovery.go @@ -19,10 +19,11 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // RecoveryLister helps list Recoveries. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/repository.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/repository.go index e29f531f4..5d7eb55bf 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/repository.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/repository.go @@ -19,10 +19,11 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // RepositoryLister helps list Repositories. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/restic.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/restic.go index 90f1cdc3b..5cbdaf228 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/restic.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1alpha1/restic.go @@ -19,10 +19,11 @@ limitations under the License. package v1alpha1 import ( + v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" ) // ResticLister helps list Restics. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupbatch.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupbatch.go index 78df177b2..328958481 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupbatch.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupbatch.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // BackupBatchLister helps list BackupBatches. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupblueprint.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupblueprint.go index 8b003e1e8..54ec0610f 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupblueprint.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupblueprint.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // BackupBlueprintLister helps list BackupBlueprints. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupconfiguration.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupconfiguration.go index e81bbeb3b..afcbde056 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupconfiguration.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupconfiguration.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // BackupConfigurationLister helps list BackupConfigurations. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupsession.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupsession.go index 95e60a84c..85b219eaf 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupsession.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/backupsession.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // BackupSessionLister helps list BackupSessions. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/function.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/function.go index c505af01a..4e3acddea 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/function.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/function.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // FunctionLister helps list Functions. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/restoresession.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/restoresession.go index 33ac81818..112e02005 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/restoresession.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/restoresession.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // RestoreSessionLister helps list RestoreSessions. diff --git a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/task.go b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/task.go index 9ff06cfb1..15f28fc56 100644 --- a/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/task.go +++ b/vendor/stash.appscode.dev/stash/client/listers/stash/v1beta1/task.go @@ -19,10 +19,11 @@ limitations under the License. package v1beta1 import ( + v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // TaskLister helps list Tasks. diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/backup.go b/vendor/stash.appscode.dev/stash/pkg/restic/backup.go index 4223ebcdc..d2735d0d1 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/backup.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/backup.go @@ -4,9 +4,10 @@ import ( "sync" "time" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + "github.com/appscode/go/types" "k8s.io/apimachinery/pkg/util/errors" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" ) // RunBackup takes backup, cleanup old snapshots, check repository integrity etc. @@ -16,7 +17,7 @@ func (w *ResticWrapper) RunBackup(backupOption BackupOptions) (*BackupOutput, er startTime := time.Now() // Initialize restic repository if it does not exist - _, err := w.initRepositoryIfAbsent() + err := w.initRepositoryIfAbsent() if err != nil { return nil, err } @@ -80,7 +81,7 @@ func (w *ResticWrapper) RunBackup(backupOption BackupOptions) (*BackupOutput, er func (w *ResticWrapper) RunParallelBackup(backupOptions []BackupOptions, maxConcurrency int) (*BackupOutput, error) { // Initialize restic repository if it does not exist - _, err := w.initRepositoryIfAbsent() + err := w.initRepositoryIfAbsent() if err != nil { return nil, err } @@ -199,7 +200,7 @@ func (w *ResticWrapper) runBackup(backupOption BackupOptions) (api_v1beta1.HostB return hostStats, err } // Extract information from the output of backup command - snapStats, err := extractBackupInfo(out, backupOption.StdinFileName, backupOption.Host) + snapStats, err := extractBackupInfo(out, backupOption.StdinFileName) if err != nil { return hostStats, err } @@ -214,7 +215,7 @@ func (w *ResticWrapper) runBackup(backupOption BackupOptions) (api_v1beta1.HostB return hostStats, err } // Extract information from the output of backup command - stats, err := extractBackupInfo(out, path, backupOption.Host) + stats, err := extractBackupInfo(out, path) if err != nil { return hostStats, err } @@ -249,5 +250,4 @@ func (backupOutput *BackupOutput) upsertHostBackupStats(hostStats api_v1beta1.Ho // no entry for this host. add a new entry backupOutput.HostBackupStats = append(backupOutput.HostBackupStats, hostStats) - return } diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/commands.go b/vendor/stash.appscode.dev/stash/pkg/restic/commands.go index ceb802acc..057189e18 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/commands.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/commands.go @@ -11,10 +11,11 @@ import ( "strings" "time" + "stash.appscode.dev/stash/apis/stash/v1alpha1" + "github.com/appscode/go/log" "github.com/armon/circbuf" storage "kmodules.xyz/objectstore-api/api/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" ) const ( @@ -60,7 +61,7 @@ func (w *ResticWrapper) deleteSnapshots(snapshotIDs []string) ([]byte, error) { return w.run(Command{Name: ResticCMD, Args: args}) } -func (w *ResticWrapper) initRepositoryIfAbsent() ([]byte, error) { +func (w *ResticWrapper) initRepositoryIfAbsent() error { log.Infoln("Ensuring restic repository in the backend") args := w.appendCacheDirFlag([]interface{}{"snapshots", "--json"}) args = w.appendCaCertFlag(args) @@ -70,9 +71,12 @@ func (w *ResticWrapper) initRepositoryIfAbsent() ([]byte, error) { args = w.appendCaCertFlag(args) args = w.appendMaxConnectionsFlag(args) - return w.run(Command{Name: ResticCMD, Args: args}) + _, err := w.run(Command{Name: ResticCMD, Args: args}) + if err != nil { + return err + } } - return nil, nil + return nil } func (w *ResticWrapper) backup(path, host string, tags []string) ([]byte, error) { diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/config.go b/vendor/stash.appscode.dev/stash/pkg/restic/config.go index 2d4474a18..92cef50e8 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/config.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/config.go @@ -7,9 +7,10 @@ import ( "path/filepath" "sort" + "stash.appscode.dev/stash/apis/stash/v1alpha1" + shell "github.com/codeskyblue/go-sh" ofst "kmodules.xyz/offshoot-api/api/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" ) const ( diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go b/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go index 8aff1109a..623461608 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/metrics.go @@ -6,6 +6,10 @@ import ( "strings" "time" + "stash.appscode.dev/stash/apis" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/push" core "k8s.io/api/core/v1" @@ -14,9 +18,6 @@ import ( "k8s.io/client-go/rest" appcatalog "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned" - "stash.appscode.dev/stash/apis" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned" ) const ( diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/output.go b/vendor/stash.appscode.dev/stash/pkg/restic/output.go index c5c75b01e..0804ee7d8 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/output.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/output.go @@ -98,7 +98,7 @@ func ReadRestoreOutput(filename string) (*RestoreOutput, error) { // ExtractBackupInfo extract information from output of "restic backup" command and // save valuable information into backupOutput -func extractBackupInfo(output []byte, path string, hostname string) (api_v1beta1.SnapshotStats, error) { +func extractBackupInfo(output []byte, path string) (api_v1beta1.SnapshotStats, error) { snapshotStats := api_v1beta1.SnapshotStats{ Path: path, } diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/restore.go b/vendor/stash.appscode.dev/stash/pkg/restic/restore.go index 3affea2bb..7e331ca66 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/restore.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/restore.go @@ -4,8 +4,9 @@ import ( "sync" "time" - "k8s.io/apimachinery/pkg/util/errors" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + + "k8s.io/apimachinery/pkg/util/errors" ) // RunRestore run restore process for a single host. @@ -223,5 +224,4 @@ func (restoreOutput *RestoreOutput) upsertHostRestoreStats(hostStats api_v1beta1 // no entry for this host. add a new entry restoreOutput.HostRestoreStats = append(restoreOutput.HostRestoreStats, hostStats) - return } diff --git a/vendor/stash.appscode.dev/stash/pkg/restic/util.go b/vendor/stash.appscode.dev/stash/pkg/restic/util.go index 6ec43d460..2451f0fdf 100644 --- a/vendor/stash.appscode.dev/stash/pkg/restic/util.go +++ b/vendor/stash.appscode.dev/stash/pkg/restic/util.go @@ -12,31 +12,31 @@ func convertSizeToBytes(dataSize string) (float64, error) { case strings.HasSuffix(dataSize, "TiB"): _, err := fmt.Sscanf(dataSize, "%f TiB", &size) if err != nil { - return 0, nil + return 0, err } return size * (1 << 40), nil case strings.HasSuffix(dataSize, "GiB"): _, err := fmt.Sscanf(dataSize, "%f GiB", &size) if err != nil { - return 0, nil + return 0, err } return size * (1 << 30), nil case strings.HasSuffix(dataSize, "MiB"): _, err := fmt.Sscanf(dataSize, "%f MiB", &size) if err != nil { - return 0, nil + return 0, err } return size * (1 << 20), nil case strings.HasSuffix(dataSize, "KiB"): _, err := fmt.Sscanf(dataSize, "%f KiB", &size) if err != nil { - return 0, nil + return 0, err } return size * (1 << 10), nil default: _, err := fmt.Sscanf(dataSize, "%f B", &size) if err != nil { - return 0, nil + return 0, err } return size, nil diff --git a/vendor/stash.appscode.dev/stash/pkg/util/backup_configuration.go b/vendor/stash.appscode.dev/stash/pkg/util/backup_configuration.go index 202e6c6b6..de714db14 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/backup_configuration.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/backup_configuration.go @@ -5,15 +5,16 @@ import ( "fmt" "reflect" + "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned" + v1beta1_listers "stash.appscode.dev/stash/client/listers/stash/v1beta1" + "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "kmodules.xyz/client-go/meta" wapi "kmodules.xyz/webhook-runtime/apis/workload/v1" - "stash.appscode.dev/stash/apis/stash/v1alpha1" - v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned" - v1beta1_listers "stash.appscode.dev/stash/client/listers/stash/v1beta1" ) // GetAppliedBackupConfiguration check whether BackupConfiguration was applied as annotation and returns the object definition if exist. diff --git a/vendor/stash.appscode.dev/stash/pkg/util/crds.go b/vendor/stash.appscode.dev/stash/pkg/util/crds.go index 19f7cb4b5..a46c2bb83 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/crds.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/crds.go @@ -3,13 +3,14 @@ package util import ( "fmt" - core "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "stash.appscode.dev/stash/apis" api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" cs "stash.appscode.dev/stash/client/clientset/versioned" util_v1beta1 "stash.appscode.dev/stash/client/clientset/versioned/typed/stash/v1beta1/util" "stash.appscode.dev/stash/pkg/docker" + + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EnsureDefaultFunctions creates "update-status", "pvc-backup" and "pvc-restore" Functions if they are not already present diff --git a/vendor/stash.appscode.dev/stash/pkg/util/init_container.go b/vendor/stash.appscode.dev/stash/pkg/util/init_container.go index 0cd2b5044..a101b9daa 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/init_container.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/init_container.go @@ -3,14 +3,15 @@ package util import ( "fmt" + v1alpha1_api "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" + "stash.appscode.dev/stash/pkg/docker" + "github.com/appscode/go/types" core "k8s.io/api/core/v1" "kmodules.xyz/client-go/tools/cli" "kmodules.xyz/client-go/tools/clientcmd" ofst_util "kmodules.xyz/offshoot-api/util" - v1alpha1_api "stash.appscode.dev/stash/apis/stash/v1alpha1" - v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" - "stash.appscode.dev/stash/pkg/docker" ) func NewInitContainer(r *v1alpha1_api.Restic, workload v1alpha1_api.LocalTypedReference, image docker.Docker) core.Container { diff --git a/vendor/stash.appscode.dev/stash/pkg/util/job.go b/vendor/stash.appscode.dev/stash/pkg/util/job.go index 5dd2cb3a9..8d20591d4 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/job.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/job.go @@ -3,6 +3,12 @@ package util import ( "fmt" + "stash.appscode.dev/stash/apis" + api_v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned" + "stash.appscode.dev/stash/pkg/docker" + "github.com/appscode/go/types" batch "k8s.io/api/batch/v1" core "k8s.io/api/core/v1" @@ -11,11 +17,6 @@ import ( "kmodules.xyz/client-go/tools/cli" "kmodules.xyz/client-go/tools/clientcmd" ofst_util "kmodules.xyz/offshoot-api/util" - "stash.appscode.dev/stash/apis" - api_v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned" - "stash.appscode.dev/stash/pkg/docker" ) func NewCheckJob(restic *api_v1alpha1.Restic, hostName, smartPrefix string, image docker.Docker) *batch.Job { @@ -36,7 +37,7 @@ func NewCheckJob(restic *api_v1alpha1.Restic, hostName, smartPrefix string, imag AnnotationRestic: restic.Name, AnnotationOperation: OperationCheck, // ensure that job gets deleted on completion - apis.KeyDeleteJobOnCompletion: "true", + apis.KeyDeleteJobOnCompletion: apis.AllowDeletingJobOnCompletion, }, }, Spec: batch.JobSpec{ @@ -129,7 +130,7 @@ func NewRecoveryJob(stashClient cs.Interface, recovery *api_v1alpha1.Recovery, i AnnotationRecovery: recovery.Name, AnnotationOperation: OperationRecovery, // ensure that the job gets deleted on completion - apis.KeyDeleteJobOnCompletion: "true", + apis.KeyDeleteJobOnCompletion: apis.AllowDeletingJobOnCompletion, }, }, Spec: batch.JobSpec{ diff --git a/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go b/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go index 40d5a1ecf..4884872ba 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/kubernetes.go @@ -6,6 +6,10 @@ import ( "strings" "time" + "stash.appscode.dev/stash/apis" + api "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" + "github.com/appscode/go/log" "github.com/appscode/go/types" snapshot_cs "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned" @@ -19,9 +23,6 @@ import ( store "kmodules.xyz/objectstore-api/api/v1" oc_cs "kmodules.xyz/openshift/client/clientset/versioned" wapi "kmodules.xyz/webhook-runtime/apis/workload/v1" - "stash.appscode.dev/stash/apis" - api "stash.appscode.dev/stash/apis/stash/v1alpha1" - v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" ) const ( @@ -487,7 +488,7 @@ func WaitUntilDeploymentConfigReady(c oc_cs.Interface, meta metav1.ObjectMeta) e func WaitUntilVolumeSnapshotReady(c snapshot_cs.Interface, meta metav1.ObjectMeta) error { return wait.PollImmediate(RetryInterval, 2*time.Hour, func() (bool, error) { if obj, err := c.SnapshotV1alpha1().VolumeSnapshots(meta.Namespace).Get(meta.Name, metav1.GetOptions{}); err == nil { - return obj.Status.ReadyToUse == true, nil + return obj.Status.ReadyToUse, nil } return false, nil }) diff --git a/vendor/stash.appscode.dev/stash/pkg/util/options.go b/vendor/stash.appscode.dev/stash/pkg/util/options.go index 7c4e10414..0232e6d4d 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/options.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/options.go @@ -1,10 +1,11 @@ package util import ( - go_str "github.com/appscode/go/strings" api_v1alpha1 "stash.appscode.dev/stash/apis/stash/v1alpha1" api "stash.appscode.dev/stash/apis/stash/v1beta1" "stash.appscode.dev/stash/pkg/restic" + + go_str "github.com/appscode/go/strings" ) // options that don't come from repository, backup-config, backup-session, restore-session diff --git a/vendor/stash.appscode.dev/stash/pkg/util/restic.go b/vendor/stash.appscode.dev/stash/pkg/util/restic.go index e6fa28102..d610c523b 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/restic.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/restic.go @@ -5,13 +5,14 @@ import ( "fmt" "reflect" + api "stash.appscode.dev/stash/apis/stash/v1alpha1" + stash_listers "stash.appscode.dev/stash/client/listers/stash/v1alpha1" + "github.com/pkg/errors" kerr "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "kmodules.xyz/client-go/meta" - api "stash.appscode.dev/stash/apis/stash/v1alpha1" - stash_listers "stash.appscode.dev/stash/client/listers/stash/v1alpha1" ) func GetAppliedRestic(m map[string]string) (*api.Restic, error) { diff --git a/vendor/stash.appscode.dev/stash/pkg/util/restore_session.go b/vendor/stash.appscode.dev/stash/pkg/util/restore_session.go index c51a2a877..a438949a4 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/restore_session.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/restore_session.go @@ -4,12 +4,13 @@ import ( "fmt" "reflect" + v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" + v1beta1_listers "stash.appscode.dev/stash/client/listers/stash/v1beta1" + kerr "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "kmodules.xyz/client-go/meta" wapi "kmodules.xyz/webhook-runtime/apis/workload/v1" - v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" - v1beta1_listers "stash.appscode.dev/stash/client/listers/stash/v1beta1" ) // GetAppliedRestoreSession check whether RestoreSession was applied as annotation and returns the object definition if exist. diff --git a/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go b/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go index 2ab1e5eb4..ff4db75be 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/sidecar.go @@ -3,6 +3,11 @@ package util import ( "fmt" + "stash.appscode.dev/stash/apis" + api "stash.appscode.dev/stash/apis/stash/v1alpha1" + v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" + "stash.appscode.dev/stash/pkg/docker" + "github.com/appscode/go/types" core "k8s.io/api/core/v1" "kmodules.xyz/client-go/tools/analytics" @@ -10,10 +15,6 @@ import ( "kmodules.xyz/client-go/tools/clientcmd" store "kmodules.xyz/objectstore-api/api/v1" ofst_util "kmodules.xyz/offshoot-api/util" - "stash.appscode.dev/stash/apis" - api "stash.appscode.dev/stash/apis/stash/v1alpha1" - v1beta1_api "stash.appscode.dev/stash/apis/stash/v1beta1" - "stash.appscode.dev/stash/pkg/docker" ) func NewSidecarContainer(r *api.Restic, workload api.LocalTypedReference, image docker.Docker) core.Container { diff --git a/vendor/stash.appscode.dev/stash/pkg/util/util.go b/vendor/stash.appscode.dev/stash/pkg/util/util.go index 8649e223b..b1a1e503b 100644 --- a/vendor/stash.appscode.dev/stash/pkg/util/util.go +++ b/vendor/stash.appscode.dev/stash/pkg/util/util.go @@ -7,6 +7,11 @@ import ( "strconv" "strings" + "stash.appscode.dev/stash/apis" + api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" + cs "stash.appscode.dev/stash/client/clientset/versioned" + "stash.appscode.dev/stash/pkg/restic" + "github.com/appscode/go/types" "github.com/pkg/errors" core "k8s.io/api/core/v1" @@ -22,10 +27,6 @@ import ( v1 "kmodules.xyz/offshoot-api/api/v1" oc_cs "kmodules.xyz/openshift/client/clientset/versioned" wapi "kmodules.xyz/webhook-runtime/apis/workload/v1" - "stash.appscode.dev/stash/apis" - api_v1beta1 "stash.appscode.dev/stash/apis/stash/v1beta1" - cs "stash.appscode.dev/stash/client/clientset/versioned" - "stash.appscode.dev/stash/pkg/restic" ) var ( @@ -36,6 +37,7 @@ const ( CallerWebhook = "webhook" CallerController = "controller" PushgatewayLocalURL = "http://localhost:56789" + DefaultHost = "host-0" ) type RepoLabelData struct { @@ -50,21 +52,19 @@ func GetHostName(target interface{}) (string, error) { // target nil for cluster backup var targetRef api_v1beta1.TargetRef if target == nil { - return "host-0", nil + return DefaultHost, nil } // read targetRef field from BackupTarget or RestoreTarget - switch target.(type) { + switch t := target.(type) { case *api_v1beta1.BackupTarget: - t := target.(*api_v1beta1.BackupTarget) if t == nil { - return "host-0", nil + return DefaultHost, nil } targetRef = t.Ref case *api_v1beta1.RestoreTarget: - t := target.(*api_v1beta1.RestoreTarget) if t == nil { - return "host-0", nil + return DefaultHost, nil } // if replicas or volumeClaimTemplate is specified then restore is done via job. @@ -101,7 +101,7 @@ func GetHostName(target interface{}) (string, error) { } return nodeName, nil default: - return "host-0", nil + return DefaultHost, nil } }