diff --git a/.gitignore b/.gitignore index 176b72ffd..886c19aa7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,10 +20,15 @@ _testmain.go *.test *.prof -*.DS_Store -.idea/ -dist/ -.vscode/ -.markdownlint.json -coverage.txt -apiserver.local.config/ +/bin +/.go + +/.idea +/.markdownlint.json +/.vscode +/apiserver.local.config +/coverage.txt +/dist +/hack/configs/.env +/test/e2e/junit.xml +/test/e2e/report.xml diff --git a/.travis.yml b/.travis.yml index 33a18907e..bd120667d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,11 @@ language: go go: - 1.x +cache: + directories: + - $HOME/.cache/go-build + - $GOPATH/pkg/mod + install: true script: diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..ebe5fb57a --- /dev/null +++ b/Makefile @@ -0,0 +1,217 @@ +SHELL=/bin/bash -o pipefail + +# The binary to build (just the basename). +BIN := kubedb +COMPRESS ?= no + +# 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 := cmd pkg hack/gendocs # directories which hold app source (not vendored) + +DOCKER_PLATFORMS := linux/amd64 linux/arm linux/arm64 +BIN_PLATFORMS := $(DOCKER_PLATFORMS) windows/amd64 darwin/amd64 + +# 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)) + +GO_VERSION ?= 1.12.5 +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 + +# 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) + +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) \ + ./hack/fmt.sh $(SRC_DIRS) + +build: $(OUTBIN) + +# The following structure defeats Go's (intentional) behavior to always touch +# result files, even if they have not changed. This will still run `go` but +# will not trigger further work if nothing has actually changed. + +$(OUTBIN): .go/$(OUTBIN).stamp + @true + +# This will build the binary under ./.go and update the real binary iff needed. +.PHONY: .go/$(OUTBIN).stamp +.go/$(OUTBIN).stamp: $(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 \ + " + @if [ $(COMPRESS) = yes ] && [ $(OS) != windows ]; then \ + echo "compressing $(OUTBIN)"; \ + upx --brute .go/$(OUTBIN); \ + fi + @if ! cmp -s .go/$(OUTBIN) $(OUTBIN); then \ + mv .go/$(OUTBIN) $(OUTBIN); \ + date >$@; \ + fi + @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) + +$(BUILD_DIRS): + @mkdir -p $@ + +.PHONY: dev +dev: gen fmt build + +.PHONY: ci +ci: lint test build #cover + +.PHONY: qa +qa: docker-manifest + @if [ "$$APPSCODE_ENV" = "prod" ]; then \ + echo "Nothing to do in prod env. Are you trying to 'release' binaries to prod?"; \ + exit 1; \ + fi + @if [ "$(version_strategy)" = "git_tag" ]; then \ + echo "Are you trying to 'release' binaries to prod?"; \ + exit 1; \ + fi + @$(MAKE) clean all-build --no-print-directory + +.PHONY: release +release: docker-manifest + @if [ "$$APPSCODE_ENV" != "prod" ]; then \ + echo "'release' only works in PROD env."; \ + exit 1; \ + fi + @if [ "$(version_strategy)" != "git_tag" ]; then \ + echo "'apply_tag' to release binaries and/or docker images."; \ + exit 1; \ + fi + @$(MAKE) clean all-build --no-print-directory + +.PHONY: clean +clean: + rm -rf .go bin diff --git a/cmd/kubedb/version.go b/cmd/kubedb/version.go index d85fde357..1f7379ff7 100644 --- a/cmd/kubedb/version.go +++ b/cmd/kubedb/version.go @@ -1,33 +1,29 @@ package main -import v "github.com/appscode/go/version" +import ( + v "github.com/appscode/go/version" +) var ( Version string VersionStrategy string - Os string - Arch string - CommitHash string - GitBranch string GitTag string + GitBranch string + CommitHash string CommitTimestamp string - BuildTimestamp string - BuildHost string - BuildHostOs string - BuildHostArch string + GoVersion string + Compiler string + Platform string ) func init() { v.Version.Version = Version v.Version.VersionStrategy = VersionStrategy - v.Version.Os = Os - v.Version.Arch = Arch - v.Version.CommitHash = CommitHash - v.Version.GitBranch = GitBranch v.Version.GitTag = GitTag + v.Version.GitBranch = GitBranch + v.Version.CommitHash = CommitHash v.Version.CommitTimestamp = CommitTimestamp - v.Version.BuildTimestamp = BuildTimestamp - v.Version.BuildHost = BuildHost - v.Version.BuildHostOs = BuildHostOs - v.Version.BuildHostArch = BuildHostArch + v.Version.GoVersion = GoVersion + v.Version.Compiler = Compiler + v.Version.Platform = Platform } diff --git a/go.mod b/go.mod index bf4125b69..12adbd644 100644 --- a/go.mod +++ b/go.mod @@ -5,17 +5,16 @@ go 1.12 require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e // indirect - github.com/appscode/go v0.0.0-20190424183524-60025f1135c9 + github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect - github.com/cpuguy83/go-md2man v1.0.10 // indirect github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0 // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect github.com/fatih/camelcase v0.0.0-20160318181535-f6a740d52f96 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b - github.com/kubedb/apimachinery v0.0.0-20190508221312-5ba915343400 + github.com/kubedb/apimachinery v0.0.0-20190526014453-48e4bab67179 github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/spf13/cobra v0.0.3 + github.com/spf13/cobra v0.0.4 github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c // indirect k8s.io/api v0.0.0-20190503110853-61630f889b3c @@ -26,9 +25,8 @@ require ( k8s.io/client-go v11.0.0+incompatible k8s.io/cloud-provider v0.0.0-20190508104637-039924654234 // indirect k8s.io/component-base v0.0.0-20190424053038-9fe063da3132 - k8s.io/kubernetes v1.14.1 - kmodules.xyz/client-go v0.0.0-20190508091620-0d215c04352f - kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec // indirect + k8s.io/kubernetes v1.14.2 + kmodules.xyz/client-go v0.0.0-20190524133821-9c8a87771aea kmodules.xyz/monitoring-agent-api v0.0.0-20190508125842-489150794b9b kmodules.xyz/objectstore-api v0.0.0-20190506085934-94c81c8acca9 vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc // indirect diff --git a/go.sum b/go.sum index 58e940b97..370ef9ccf 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,7 @@ github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e h1:eb0Pzkt15Bm github.com/MakeNowJust/heredoc v0.0.0-20171113091838-e9091a26100e/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -28,19 +29,24 @@ github.com/appscode/cron v0.0.0-20170717094345-ca60c6d796d4/go.mod h1:cbZVORXl6m github.com/appscode/docker-registry-client v0.0.0-20180426150142-1bb02bb202b0/go.mod h1:W9bsWfSbgJXUXzBZ+tSBV2g+zzT7ANPHQFsSXRHYKsA= github.com/appscode/go v0.0.0-20190424183524-60025f1135c9 h1:uIXQ61ZjsDmN6WhdBJNpd8vMCPBORLNd75MDNU8nUO4= github.com/appscode/go v0.0.0-20190424183524-60025f1135c9/go.mod h1:/PrESzUKHRrwhmBMpVXfGK3e/D0tqN+/dc8nSH03llU= +github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 h1:OtKgsfyrDaDNv8ELfW8frpskwj+HqiLhT3trOLX+R9g= +github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8/go.mod h1:/PrESzUKHRrwhmBMpVXfGK3e/D0tqN+/dc8nSH03llU= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 h1:Kn3rqvbUFqSepE2OqVu0Pn1CbDw9IuMlONapol0zuwk= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= github.com/appscode/osm v0.0.0-20190225021050-90ec9897e91b/go.mod h1:8+wQ9AjCUs7CBBYjpmdl/8W9HUS+TUVtcuTogictUQk= github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3 h1:7k8Z87LszBRiaREKV6jW5eCLAO0KaR2agaXMRScqsS4= github.com/appscode/stow v0.0.0-20190506085026-ca5baa008ea3/go.mod h1:34e6ldbiHdb1JjdDGoaBgggnC9hoIKDsXYFG/l4R9Nc= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aws/aws-sdk-go v1.12.7/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= github.com/aws/aws-sdk-go v1.14.12 h1:VvSayx3QBBH9qoEO2ygDfpqNDTqq5UtqyL2wRWJxCTk= github.com/aws/aws-sdk-go v1.14.12/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= +github.com/aws/aws-sdk-go v1.14.33/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 h1:7aWHqerlJ41y6FOsEUvknqgXnGmJyJSbjhAWq5pO4F8= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U= @@ -48,8 +54,11 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -63,6 +72,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/distribution v0.0.0-20170726174610-edc3ab29cdff/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= @@ -83,6 +93,8 @@ github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f h1:AUj1VoZUfhP github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful v2.9.3+incompatible h1:2OwhVdhtzYUp5P5wuGsVDPagKSRd9JK72sJCHVCXh5g= github.com/emicklei/go-restful v2.9.3+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -100,11 +112,13 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-check/check v1.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.38.2/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.40.0 h1:/pbZah2UXAjMCtUlVRASCb6nX+0A8aCXjmYouBEXu0c= github.com/go-ini/ini v1.40.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.0 h1:FTUMcX77w5rQkClIzDtTxvn6Bsa894CcrzNj2MMfeg8= github.com/go-openapi/jsonpointer v0.19.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= @@ -153,6 +167,7 @@ github.com/gopherjs/gopherjs v0.0.0-20180825215210-0210a2f0f73c/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gotestyourself/gotestyourself v2.2.0+incompatible h1:AQwinXlbQR2HvPjQZOmDhRqsv5mZf+Jb1RnSLxcqZcI= @@ -167,6 +182,7 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.6/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c h1:kQWxfPIHVLbgLzphqk3QUflDy9QdksZR4ygR807bpy0= github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= @@ -209,23 +225,29 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kubedb/apimachinery v0.0.0-20190508221312-5ba915343400 h1:48/mMLRoo3t20SUWjihU8YPwuZnjsQPd9kilAvrK+bE= -github.com/kubedb/apimachinery v0.0.0-20190508221312-5ba915343400/go.mod h1:Egec2weMcYffh9D9kT9mBIb7m+s6gCh2TtGZRe7Hl3c= +github.com/kubedb/apimachinery v0.0.0-20190526014453-48e4bab67179 h1:5HBf98WHTFvrzOtcNMXUY5+a+533qXbBraL1d5KX8RU= +github.com/kubedb/apimachinery v0.0.0-20190526014453-48e4bab67179/go.mod h1:5jrc9r99ZD4y7trI/MU+eAMYP8/f68mFQI+KUNfQFNs= github.com/kubernetes-incubator/service-catalog v0.1.43/go.mod h1:D0CRODiXUJs6VCZDB15TmCkesbuizkac9fYEiTA78BA= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg= github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= @@ -239,6 +261,7 @@ github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 h1:10VrZWOtDSvWh github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/ncw/swift v1.0.41/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -250,6 +273,7 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/orcaman/concurrent-map v0.0.0-20190314100340-2693aad1ed75/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -263,20 +287,24 @@ github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOi github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.3.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0 h1:7etb9YClo3a6HjLzfl6rIQaU+FDfi0VSX39io3aQ+DM= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rancher/go-rancher v0.0.0-20160922212217-09693a8743ba/go.mod h1:7oQvGNiJsGvrUgB+7AH8bmdzuR0uhULfwKb43Ht0hUk= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= @@ -289,27 +317,37 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180820201707-7c9eb446e3cf/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.4 h1:S0tLZ3VOKl2Te0hpq8+ke0eSJPfCnNTPiDlsfwi1/NE= +github.com/spf13/cobra v0.0.4/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 h1:j2hhcujLRHAg872RWAV5yaUrEjHEObwDv3aImCaNLek= github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yudai/gojsondiff v0.0.0-20180504020246-0525c875b75c h1:/8Xb/f8s2/ZZpzMzBkFwW2Jvj7Pglk+AW8m8FFqOoIQ= github.com/yudai/gojsondiff v0.0.0-20180504020246-0525c875b75c/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= @@ -323,6 +361,7 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -361,10 +400,12 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190508100423-12bbe5a7a520 h1:5/ojcKo2vQ2eroPDFcBB9tuc4N42a5njs7UWP2jk3KU= golang.org/x/sys v0.0.0-20190508100423-12bbe5a7a520/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -455,12 +496,14 @@ k8s.io/kubernetes v1.14.0 h1:6T2iAEoOYQnzQb3WvPlUkcczEEXZ7+YPlAO8olwujRw= k8s.io/kubernetes v1.14.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/kubernetes v1.14.1 h1:I9F52h5sqVxBmoSsBlNQ0YygNcukDilkpGxUbJRoBoY= k8s.io/kubernetes v1.14.1/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/kubernetes v1.14.2 h1:Gdq2hPpttbaJBoClIanCE6WSu4IZReA54yhkZtvPUOo= +k8s.io/kubernetes v1.14.2/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= kmodules.xyz/client-go v0.0.0-20190508091620-0d215c04352f h1:to7LqlT1BOdBRm1AFuApV7MmXB5T9+PYz4c+faDBhhc= kmodules.xyz/client-go v0.0.0-20190508091620-0d215c04352f/go.mod h1:R1t4K2wWb6PTkhQPEjqQIWz+gRS0/Z0mMfIy/TsdB/w= -kmodules.xyz/custom-resources v0.0.0-20190225012057-ed1c15a0bbda h1:CakBaOFRIOuqRHVMJ5HGQjMIko72MAXQX/mH7awDtQQ= -kmodules.xyz/custom-resources v0.0.0-20190225012057-ed1c15a0bbda/go.mod h1:XSLXXzWk0aRybMX3PaR/4Kx938krmL5o3EaP1K7ltMg= +kmodules.xyz/client-go v0.0.0-20190524133821-9c8a87771aea h1:jt5p9kuSqG0RLsXGB/Rj+szXDrmKB/9ZjCZdKjPJz1c= +kmodules.xyz/client-go v0.0.0-20190524133821-9c8a87771aea/go.mod h1:R1t4K2wWb6PTkhQPEjqQIWz+gRS0/Z0mMfIy/TsdB/w= kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec h1:a7sxsWe1QYUZaEWxGpSuzB6ZAdXmCwNh2SyMTLQKGEI= kmodules.xyz/custom-resources v0.0.0-20190508103408-464e8324c3ec/go.mod h1:0C61XSEPGexAmkrayynpNnCTacvkwn4802CRAQ5tUPI= kmodules.xyz/monitoring-agent-api v0.0.0-20190508125842-489150794b9b h1:QnYWK/4yzl5LCdbPcZ8GZNyhFWrm+5y6ebeMQZzef94= diff --git a/hack/build.sh b/hack/build.sh new file mode 100755 index 000000000..518c73d1b --- /dev/null +++ b/hack/build.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -eou pipefail + +if [ -z "${OS:-}" ]; then + echo "OS must be set" + exit 1 +fi +if [ -z "${ARCH:-}" ]; then + echo "ARCH must be set" + exit 1 +fi +if [ -z "${VERSION:-}" ]; then + echo "VERSION must be set" + exit 1 +fi + +export CGO_ENABLED=0 +export GOARCH="${ARCH}" +export GOOS="${OS}" +export GO111MODULE=on +export GOFLAGS="-mod=vendor" + +go install \ + -installsuffix "static" \ + -ldflags " \ + -X main.Version=${VERSION} \ + -X main.VersionStrategy=${version_strategy:-} \ + -X main.GitTag=${git_tag:-} \ + -X main.GitBranch=${git_branch:-} \ + -X main.CommitHash=${commit_hash:-} \ + -X main.CommitTimestamp=${commit_timestamp:-} \ + -X main.GoVersion=$(go version | cut -d " " -f 3) \ + -X main.Compiler=$(go env CC) \ + -X main.Platform=${OS}/${ARCH} \ + " \ + ./... diff --git a/hack/fmt.sh b/hack/fmt.sh new file mode 100755 index 000000000..e2036f8ed --- /dev/null +++ b/hack/fmt.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -eou pipefail + +export CGO_ENABLED=0 +export GO111MODULE=on +export GOFLAGS="-mod=vendor" + +TARGETS="$@" + +echo "Running reimport.py" +cmd="reimport.py ${TARGETS}" +$cmd +echo + +echo "Running goimports:" +cmd="goimports -w ${TARGETS}" +echo $cmd; $cmd +echo + +echo "Running gofmt:" +cmd="gofmt -s -w ${TARGETS}" +echo $cmd; $cmd +echo diff --git a/hack/test.sh b/hack/test.sh new file mode 100755 index 000000000..0d9aa03f0 --- /dev/null +++ b/hack/test.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +set -eou pipefail + +export CGO_ENABLED=0 +export GO111MODULE=on +export GOFLAGS="-mod=vendor" + +TARGETS=$(for d in "$@"; do echo ./$d/...; done) + +echo "Running tests:" +go test -installsuffix "static" ${TARGETS} +echo + +echo -n "Checking gofmt: " +ERRS=$(find "$@" -type f -name \*.go | xargs gofmt -l 2>&1 || true) +if [ -n "${ERRS}" ]; then + echo "FAIL - the following files need to be gofmt'ed:" + for e in ${ERRS}; do + echo " $e" + done + echo + exit 1 +fi +echo "PASS" +echo + +echo -n "Checking go vet: " +ERRS=$(go vet ${TARGETS} 2>&1 || true) +if [ -n "${ERRS}" ]; then + echo "FAIL" + echo "${ERRS}" + echo + exit 1 +fi +echo "PASS" +echo diff --git a/vendor/github.com/appscode/go/version/version.go b/vendor/github.com/appscode/go/version/version.go index 89181448e..ad0628040 100644 --- a/vendor/github.com/appscode/go/version/version.go +++ b/vendor/github.com/appscode/go/version/version.go @@ -2,48 +2,49 @@ package version import ( "fmt" - "os" - "github.com/spf13/cobra" ) type version struct { Version string `json:"version,omitempty"` VersionStrategy string `json:"versionStrategy,omitempty"` - Os string `json:"os,omitempty"` - Arch string `json:"arch,omitempty"` CommitHash string `json:"commitHash,omitempty"` GitBranch string `json:"gitBranch,omitempty"` GitTag string `json:"gitTag,omitempty"` CommitTimestamp string `json:"commitTimestamp,omitempty"` - BuildTimestamp string `json:"buildTimestamp,omitempty"` - BuildHost string `json:"buildHost,omitempty"` - BuildHostOs string `json:"buildHostOs,omitempty"` - BuildHostArch string `json:"buildHostArch,omitempty"` + GoVersion string `json:"goVersion,omitempty"` + Compiler string `json:"compiler,omitempty"` + Platform string `json:"platform,omitempty"` + // Deprecated + Os string `json:"os,omitempty"` + // Deprecated + Arch string `json:"arch,omitempty"` + // Deprecated + BuildTimestamp string `json:"buildTimestamp,omitempty"` + // Deprecated + BuildHost string `json:"buildHost,omitempty"` + // Deprecated + BuildHostOs string `json:"buildHostOs,omitempty"` + // Deprecated + BuildHostArch string `json:"buildHostArch,omitempty"` } func (v *version) Print() { fmt.Printf("Version = %v\n", v.Version) fmt.Printf("VersionStrategy = %v\n", v.VersionStrategy) - fmt.Printf("Os = %v\n", v.Os) - fmt.Printf("Arch = %v\n", v.Arch) - - fmt.Printf("CommitHash = %v\n", v.CommitHash) - fmt.Printf("GitBranch = %v\n", v.GitBranch) fmt.Printf("GitTag = %v\n", v.GitTag) + fmt.Printf("GitBranch = %v\n", v.GitBranch) + fmt.Printf("CommitHash = %v\n", v.CommitHash) fmt.Printf("CommitTimestamp = %v\n", v.CommitTimestamp) - if v.BuildTimestamp != "" { - fmt.Printf("BuildTimestamp = %v\n", v.BuildTimestamp) - } - if v.BuildHost != "" { - fmt.Printf("BuildHost = %v\n", v.BuildHost) + if v.GoVersion != "" { + fmt.Printf("GoVersion = %v\n", v.GoVersion) } - if v.BuildHostOs != "" { - fmt.Printf("BuildHostOs = %v\n", v.BuildHostOs) + if v.Compiler != "" { + fmt.Printf("Compiler = %v\n", v.Compiler) } - if v.BuildHostArch != "" { - fmt.Printf("BuildHostArch = %v\n", v.BuildHostArch) + if v.Platform != "" { + fmt.Printf("Platform = %v\n", v.Platform) } } @@ -58,9 +59,9 @@ func NewCmdVersion() *cobra.Command { Run: func(cmd *cobra.Command, args []string) { if short { fmt.Print(Version.Version) - os.Exit(0) + } else { + Version.Print() } - Version.Print() }, } cmd.Flags().BoolVar(&short, "short", false, "Print just the version number.") diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md index da5bcaacc..e52529631 100644 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/CHANGES.md @@ -1,6 +1,18 @@ ## Change history of go-restful +v2.9.5 +- fix panic in Response.WriteError if err == nil + +v2.9.4 + +- fix issue #400 , parsing mime type quality +- Route Builder added option for contentEncodingEnabled (#398) + +v2.9.3 + +- Avoid return of 415 Unsupported Media Type when request body is empty (#396) + v2.9.2 - Reduce allocations in per-request methods to improve performance (#395) diff --git a/vendor/github.com/emicklei/go-restful/mime.go b/vendor/github.com/emicklei/go-restful/mime.go index d7ea2b615..33014471b 100644 --- a/vendor/github.com/emicklei/go-restful/mime.go +++ b/vendor/github.com/emicklei/go-restful/mime.go @@ -22,7 +22,10 @@ func insertMime(l []mime, e mime) []mime { return append(l, e) } +const qFactorWeightingKey = "q" + // sortedMimes returns a list of mime sorted (desc) by its specified quality. +// e.g. text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 func sortedMimes(accept string) (sorted []mime) { for _, each := range strings.Split(accept, ",") { typeAndQuality := strings.Split(strings.Trim(each, " "), ";") @@ -30,14 +33,16 @@ func sortedMimes(accept string) (sorted []mime) { sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) } else { // take factor - parts := strings.Split(typeAndQuality[1], "=") - if len(parts) == 2 { - f, err := strconv.ParseFloat(parts[1], 64) + qAndWeight := strings.Split(typeAndQuality[1], "=") + if len(qAndWeight) == 2 && strings.Trim(qAndWeight[0], " ") == qFactorWeightingKey { + f, err := strconv.ParseFloat(qAndWeight[1], 64) if err != nil { traceLogger.Printf("unable to parse quality in %s, %v", each, err) } else { sorted = insertMime(sorted, mime{typeAndQuality[0], f}) } + } else { + sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0}) } } } diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go index 4d987d130..fbb48f2da 100644 --- a/vendor/github.com/emicklei/go-restful/response.go +++ b/vendor/github.com/emicklei/go-restful/response.go @@ -174,10 +174,15 @@ func (r *Response) WriteHeaderAndJson(status int, value interface{}, contentType return writeJSON(r, status, contentType, value) } -// WriteError write the http status and the error string on the response. +// WriteError write the http status and the error string on the response. err can be nil. func (r *Response) WriteError(httpStatus int, err error) error { r.err = err - return r.WriteErrorString(httpStatus, err.Error()) + if err == nil { + r.WriteErrorString(httpStatus, "") + } else { + r.WriteErrorString(httpStatus, err.Error()) + } + return err } // WriteServiceError is a convenience method for a responding with a status and a ServiceError diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go index 8dfdf934b..0fccf61e9 100644 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ b/vendor/github.com/emicklei/go-restful/route_builder.go @@ -38,6 +38,7 @@ type RouteBuilder struct { defaultResponse *ResponseError metadata map[string]interface{} deprecated bool + contentEncodingEnabled *bool } // Do evaluates each argument with the RouteBuilder itself. @@ -233,6 +234,12 @@ func (b *RouteBuilder) If(condition RouteSelectionConditionFunction) *RouteBuild return b } +// ContentEncodingEnabled allows you to override the Containers value for auto-compressing this route response. +func (b *RouteBuilder) ContentEncodingEnabled(enabled bool) *RouteBuilder { + b.contentEncodingEnabled = &enabled + return b +} + // If no specific Route path then set to rootPath // If no specific Produces then set to rootProduces // If no specific Consumes then set to rootConsumes @@ -269,25 +276,27 @@ func (b *RouteBuilder) Build() Route { operationName = nameOfFunction(b.function) } route := Route{ - Method: b.httpMethod, - Path: concatPath(b.rootPath, b.currentPath), - Produces: b.produces, - Consumes: b.consumes, - Function: b.function, - Filters: b.filters, - If: b.conditions, - relativePath: b.currentPath, - pathExpr: pathExpr, - Doc: b.doc, - Notes: b.notes, - Operation: operationName, - ParameterDocs: b.parameters, - ResponseErrors: b.errorMap, - DefaultResponse: b.defaultResponse, - ReadSample: b.readSample, - WriteSample: b.writeSample, - Metadata: b.metadata, - Deprecated: b.deprecated} + Method: b.httpMethod, + Path: concatPath(b.rootPath, b.currentPath), + Produces: b.produces, + Consumes: b.consumes, + Function: b.function, + Filters: b.filters, + If: b.conditions, + relativePath: b.currentPath, + pathExpr: pathExpr, + Doc: b.doc, + Notes: b.notes, + Operation: operationName, + ParameterDocs: b.parameters, + ResponseErrors: b.errorMap, + DefaultResponse: b.defaultResponse, + ReadSample: b.readSample, + WriteSample: b.writeSample, + Metadata: b.metadata, + Deprecated: b.deprecated, + contentEncodingEnabled: b.contentEncodingEnabled, + } route.postBuild() return route } diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/elasticsearch_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/elasticsearch_helpers.go index 796d78dd5..b389e0516 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/elasticsearch_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/elasticsearch_helpers.go @@ -182,6 +182,10 @@ func (e *Elasticsearch) SetDefaults() { return } e.Spec.SetDefaults() + + if e.Spec.PodTemplate.Spec.ServiceAccountName == "" { + e.Spec.PodTemplate.Spec.ServiceAccountName = e.OffshootName() + } } func (e *ElasticsearchSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_helpers.go new file mode 100644 index 000000000..57b496276 --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_helpers.go @@ -0,0 +1,207 @@ +package v1alpha1 + +import ( + "fmt" + + "github.com/appscode/go/types" + "github.com/kubedb/apimachinery/apis" + "github.com/kubedb/apimachinery/apis/kubedb" + apps "k8s.io/api/apps/v1" + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + crdutils "kmodules.xyz/client-go/apiextensions/v1beta1" + meta_util "kmodules.xyz/client-go/meta" + appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" + mona "kmodules.xyz/monitoring-agent-api/api/v1" +) + +var _ apis.ResourceInfo = &MariaDB{} + +func (m MariaDB) OffshootName() string { + return m.Name +} + +func (m MariaDB) OffshootSelectors() map[string]string { + return map[string]string{ + LabelDatabaseName: m.Name, + LabelDatabaseKind: ResourceKindMariaDB, + } +} + +func (m MariaDB) OffshootLabels() map[string]string { + out := m.OffshootSelectors() + out[meta_util.NameLabelKey] = ResourceSingularMariaDB + out[meta_util.VersionLabelKey] = string(m.Spec.Version) + out[meta_util.InstanceLabelKey] = m.Name + out[meta_util.ComponentLabelKey] = "database" + out[meta_util.ManagedByLabelKey] = GenericKey + return meta_util.FilterKeys(GenericKey, out, m.Labels) +} + +func (m MariaDB) ResourceShortCode() string { + return ResourceCodeMariaDB +} + +func (m MariaDB) ResourceKind() string { + return ResourceKindMariaDB +} + +func (m MariaDB) ResourceSingular() string { + return ResourceSingularMariaDB +} + +func (m MariaDB) ResourcePlural() string { + return ResourcePluralMariaDB +} + +func (m MariaDB) ServiceName() string { + return m.OffshootName() +} + +func (m MariaDB) GoverningServiceName() string { + return m.OffshootName() + "-gvr" +} + +type mariadbApp struct { + *MariaDB +} + +func (m mariadbApp) Name() string { + return m.MariaDB.Name +} + +func (m mariadbApp) Type() appcat.AppType { + return appcat.AppType(fmt.Sprintf("%s/%s", kubedb.GroupName, ResourceSingularMariaDB)) +} + +func (m MariaDB) AppBindingMeta() appcat.AppBindingMeta { + return &mariadbApp{&m} +} + +type mariadbStatsService struct { + *MariaDB +} + +func (m mariadbStatsService) GetNamespace() string { + return m.MariaDB.GetNamespace() +} + +func (m mariadbStatsService) ServiceName() string { + return m.OffshootName() + "-stats" +} + +func (m mariadbStatsService) ServiceMonitorName() string { + return fmt.Sprintf("kubedb-%s-%s", m.Namespace, m.Name) +} + +func (m mariadbStatsService) Path() string { + return "/metrics" +} + +func (m mariadbStatsService) Scheme() string { + return "" +} + +func (m MariaDB) StatsService() mona.StatsAccessor { + return &mariadbStatsService{&m} +} + +func (m MariaDB) StatsServiceLabels() map[string]string { + lbl := meta_util.FilterKeys(GenericKey, m.OffshootSelectors(), m.Labels) + lbl[LabelRole] = "stats" + return lbl +} + +func (m *MariaDB) GetMonitoringVendor() string { + if m.Spec.Monitor != nil { + return m.Spec.Monitor.Agent.Vendor() + } + return "" +} + +func (m MariaDB) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crdutils.NewCustomResourceDefinition(crdutils.Config{ + Group: SchemeGroupVersion.Group, + Plural: ResourcePluralMariaDB, + Singular: ResourceSingularMariaDB, + Kind: ResourceKindMariaDB, + ShortNames: []string{ResourceCodeMariaDB}, + Categories: []string{"datastore", "kubedb", "appscode", "all"}, + ResourceScope: string(apiextensions.NamespaceScoped), + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: SchemeGroupVersion.Version, + Served: true, + Storage: true, + }, + }, + Labels: crdutils.Labels{ + LabelsMap: map[string]string{"app": "kubedb"}, + }, + SpecDefinitionName: "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB", + EnableValidation: true, + GetOpenAPIDefinitions: GetOpenAPIDefinitions, + EnableStatusSubresource: apis.EnableStatusSubresource, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{ + { + Name: "Version", + Type: "string", + JSONPath: ".spec.version", + }, + { + Name: "Status", + Type: "string", + JSONPath: ".status.phase", + }, + { + Name: "Age", + Type: "date", + JSONPath: ".metadata.creationTimestamp", + }, + }, + }, apis.SetNameSchema) +} + +func (m *MariaDB) SetDefaults() { + if m == nil { + return + } + m.Spec.SetDefaults() +} + +func (m *MariaDBSpec) SetDefaults() { + if m == nil { + return + } + + if m.Replicas == nil { + m.Replicas = types.Int32P(1) + } + + // perform defaulting + + if m.StorageType == "" { + m.StorageType = StorageTypeDurable + } + if m.UpdateStrategy.Type == "" { + m.UpdateStrategy.Type = apps.RollingUpdateStatefulSetStrategyType + } + if m.TerminationPolicy == "" { + if m.StorageType == StorageTypeEphemeral { + m.TerminationPolicy = TerminationPolicyDelete + } else { + m.TerminationPolicy = TerminationPolicyPause + } + } +} + +func (m *MariaDBSpec) GetSecrets() []string { + if m == nil { + return nil + } + + var secrets []string + if m.DatabaseSecret != nil { + secrets = append(secrets, m.DatabaseSecret.SecretName) + } + return secrets +} diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_types.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_types.go new file mode 100644 index 000000000..a6a790368 --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mariadb_types.go @@ -0,0 +1,93 @@ +package v1alpha1 + +import ( + "github.com/appscode/go/encoding/json/types" + apps "k8s.io/api/apps/v1" + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + mona "kmodules.xyz/monitoring-agent-api/api/v1" + ofst "kmodules.xyz/offshoot-api/api/v1" +) + +const ( + ResourceCodeMariaDB = "md" + ResourceKindMariaDB = "MariaDB" + ResourceSingularMariaDB = "mariadb" + ResourcePluralMariaDB = "mariadbs" +) + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MariaDB defines a MariaDB database. +type MariaDB struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec MariaDBSpec `json:"spec,omitempty"` + Status MariaDBStatus `json:"status,omitempty"` +} + +type MariaDBSpec struct { + // Version of MariaDB to be deployed. + Version types.StrYo `json:"version"` + + // Number of instances to deploy for a MariaDB database. + Replicas *int32 `json:"replicas,omitempty"` + + // StorageType can be durable (default) or ephemeral + StorageType StorageType `json:"storageType,omitempty"` + + // Storage spec to specify how storage shall be used. + Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"` + + // Database authentication secret + DatabaseSecret *core.SecretVolumeSource `json:"databaseSecret,omitempty"` + + // Init is used to initialize database + // +optional + Init *InitSpec `json:"init,omitempty"` + + // Monitor is used monitor database instance + // +optional + Monitor *mona.AgentSpec `json:"monitor,omitempty"` + + // ConfigSource is an optional field to provide custom configuration file for database (i.e custom-mysql.cnf). + // If specified, this file will be used as configuration file otherwise default configuration file will be used. + ConfigSource *core.VolumeSource `json:"configSource,omitempty"` + + // PodTemplate is an optional configuration for pods used to expose database + // +optional + PodTemplate ofst.PodTemplateSpec `json:"podTemplate,omitempty"` + + // ServiceTemplate is an optional configuration for service used to expose database + // +optional + ServiceTemplate ofst.ServiceTemplateSpec `json:"serviceTemplate,omitempty"` + + // updateStrategy indicates the StatefulSetUpdateStrategy that will be + // employed to update Pods in the StatefulSet when a revision is made to + // Template. + UpdateStrategy apps.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"` + + // TerminationPolicy controls the delete operation for database + // +optional + TerminationPolicy TerminationPolicy `json:"terminationPolicy,omitempty"` +} + +type MariaDBStatus struct { + Phase DatabasePhase `json:"phase,omitempty"` + Reason string `json:"reason,omitempty"` + // observedGeneration is the most recent generation observed for this resource. It corresponds to the + // resource's generation, which is updated on mutation by the API Server. + // +optional + ObservedGeneration *types.IntHash `json:"observedGeneration,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type MariaDBList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + // Items is a list of MariaDB TPR objects + Items []MariaDB `json:"items,omitempty"` +} diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/memcached_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/memcached_helpers.go index 7e07e0386..b72b85688 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/memcached_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/memcached_helpers.go @@ -161,6 +161,10 @@ func (m *Memcached) SetDefaults() { return } m.Spec.SetDefaults() + + if m.Spec.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } } func (m *MemcachedSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mongodb_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mongodb_helpers.go index b5c1a8a7e..f7a4b85ef 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mongodb_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mongodb_helpers.go @@ -317,6 +317,24 @@ func (m *MongoDB) SetDefaults() { return } m.Spec.SetDefaults() + if m.Spec.ShardTopology != nil { + if m.Spec.ShardTopology.ConfigServer.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.ShardTopology.ConfigServer.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } + if m.Spec.ShardTopology.Mongos.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.ShardTopology.Mongos.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } + if m.Spec.ShardTopology.Shard.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.ShardTopology.Shard.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } + } else { + if m.Spec.PodTemplate == nil { + m.Spec.PodTemplate = new(ofst.PodTemplateSpec) + } + if m.Spec.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } + } } func (m *MongoDBSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mysql_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mysql_helpers.go index 74914c13b..8699b2833 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mysql_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/mysql_helpers.go @@ -172,6 +172,10 @@ func (m *MySQL) SetDefaults() { return } m.Spec.SetDefaults() + + if m.Spec.PodTemplate.Spec.ServiceAccountName == "" { + m.Spec.PodTemplate.Spec.ServiceAccountName = m.OffshootName() + } } func (m *MySQLSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go index c0f7674e9..710788424 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/openapi_generated.go @@ -53,6 +53,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.EtcdStatus": schema_apimachinery_apis_kubedb_v1alpha1_EtcdStatus(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.InitSpec": schema_apimachinery_apis_kubedb_v1alpha1_InitSpec(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.LeaderElectionConfig": schema_apimachinery_apis_kubedb_v1alpha1_LeaderElectionConfig(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB": schema_apimachinery_apis_kubedb_v1alpha1_MariaDB(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBList": schema_apimachinery_apis_kubedb_v1alpha1_MariaDBList(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBSpec": schema_apimachinery_apis_kubedb_v1alpha1_MariaDBSpec(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBStatus": schema_apimachinery_apis_kubedb_v1alpha1_MariaDBStatus(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MemberSecret": schema_apimachinery_apis_kubedb_v1alpha1_MemberSecret(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Memcached": schema_apimachinery_apis_kubedb_v1alpha1_Memcached(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MemcachedList": schema_apimachinery_apis_kubedb_v1alpha1_MemcachedList(ref), @@ -76,6 +80,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MySQLStatus": schema_apimachinery_apis_kubedb_v1alpha1_MySQLStatus(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Origin": schema_apimachinery_apis_kubedb_v1alpha1_Origin(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.OriginSpec": schema_apimachinery_apis_kubedb_v1alpha1_OriginSpec(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona": schema_apimachinery_apis_kubedb_v1alpha1_Percona(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaList": schema_apimachinery_apis_kubedb_v1alpha1_PerconaList(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaSpec": schema_apimachinery_apis_kubedb_v1alpha1_PerconaSpec(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaStatus": schema_apimachinery_apis_kubedb_v1alpha1_PerconaStatus(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Postgres": schema_apimachinery_apis_kubedb_v1alpha1_Postgres(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PostgresArchiverSpec": schema_apimachinery_apis_kubedb_v1alpha1_PostgresArchiverSpec(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PostgresList": schema_apimachinery_apis_kubedb_v1alpha1_PostgresList(ref), @@ -105,12 +113,16 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.elasticsearchStatsService": schema_apimachinery_apis_kubedb_v1alpha1_elasticsearchStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.etcdApp": schema_apimachinery_apis_kubedb_v1alpha1_etcdApp(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.etcdStatsService": schema_apimachinery_apis_kubedb_v1alpha1_etcdStatsService(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mariadbApp": schema_apimachinery_apis_kubedb_v1alpha1_mariadbApp(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mariadbStatsService": schema_apimachinery_apis_kubedb_v1alpha1_mariadbStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.memcachedApp": schema_apimachinery_apis_kubedb_v1alpha1_memcachedApp(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.memcachedStatsService": schema_apimachinery_apis_kubedb_v1alpha1_memcachedStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mongoDBApp": schema_apimachinery_apis_kubedb_v1alpha1_mongoDBApp(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mongoDBStatsService": schema_apimachinery_apis_kubedb_v1alpha1_mongoDBStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mysqlApp": schema_apimachinery_apis_kubedb_v1alpha1_mysqlApp(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.mysqlStatsService": schema_apimachinery_apis_kubedb_v1alpha1_mysqlStatsService(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.perconaApp": schema_apimachinery_apis_kubedb_v1alpha1_perconaApp(ref), + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.perconaStatsService": schema_apimachinery_apis_kubedb_v1alpha1_perconaStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.postgresApp": schema_apimachinery_apis_kubedb_v1alpha1_postgresApp(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.postgresStatsService": schema_apimachinery_apis_kubedb_v1alpha1_postgresStatsService(ref), "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.redisApp": schema_apimachinery_apis_kubedb_v1alpha1_redisApp(ref), @@ -1324,6 +1336,219 @@ func schema_apimachinery_apis_kubedb_v1alpha1_LeaderElectionConfig(ref common.Re } } +func schema_apimachinery_apis_kubedb_v1alpha1_MariaDB(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MariaDB defines a MariaDB database.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBSpec", "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDBStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_MariaDBList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items is a list of MariaDB TPR objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_MariaDBSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version of MariaDB to be deployed.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Number of instances to deploy for a MariaDB database.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "storageType": { + SchemaProps: spec.SchemaProps{ + Description: "StorageType can be durable (default) or ephemeral", + Type: []string{"string"}, + Format: "", + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "Storage spec to specify how storage shall be used.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), + }, + }, + "databaseSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Database authentication secret", + Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), + }, + }, + "init": { + SchemaProps: spec.SchemaProps{ + Description: "Init is used to initialize database", + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.InitSpec"), + }, + }, + "monitor": { + SchemaProps: spec.SchemaProps{ + Description: "Monitor is used monitor database instance", + Ref: ref("kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec"), + }, + }, + "configSource": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSource is an optional field to provide custom configuration file for database (i.e custom-mysql.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used.", + Ref: ref("k8s.io/api/core/v1.VolumeSource"), + }, + }, + "podTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "PodTemplate is an optional configuration for pods used to expose database", + Ref: ref("kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec"), + }, + }, + "serviceTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceTemplate is an optional configuration for service used to expose database", + Ref: ref("kmodules.xyz/offshoot-api/api/v1.ServiceTemplateSpec"), + }, + }, + "updateStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", + Ref: ref("k8s.io/api/apps/v1.StatefulSetUpdateStrategy"), + }, + }, + "terminationPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "TerminationPolicy controls the delete operation for database", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"version"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.InitSpec", "k8s.io/api/apps/v1.StatefulSetUpdateStrategy", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.VolumeSource", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec", "kmodules.xyz/offshoot-api/api/v1.ServiceTemplateSpec"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_MariaDBStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the most recent generation observed for this resource. It corresponds to the resource's generation, which is updated on mutation by the API Server.", + Ref: ref("github.com/appscode/go/encoding/json/types.IntHash"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/appscode/go/encoding/json/types.IntHash"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha1_MemberSecret(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -2392,6 +2617,219 @@ func schema_apimachinery_apis_kubedb_v1alpha1_OriginSpec(ref common.ReferenceCal } } +func schema_apimachinery_apis_kubedb_v1alpha1_Percona(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Percona defines a percona variation of Mysql database.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaSpec", "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.PerconaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_PerconaList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items is a list of Percona TPR objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_PerconaSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version of Percona to be deployed.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Number of instances to deploy for Percona", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "storageType": { + SchemaProps: spec.SchemaProps{ + Description: "StorageType can be durable (default) or ephemeral", + Type: []string{"string"}, + Format: "", + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "Storage spec to specify how storage shall be used.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), + }, + }, + "databaseSecret": { + SchemaProps: spec.SchemaProps{ + Description: "Database authentication secret", + Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), + }, + }, + "init": { + SchemaProps: spec.SchemaProps{ + Description: "Init is used to initialize database", + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.InitSpec"), + }, + }, + "monitor": { + SchemaProps: spec.SchemaProps{ + Description: "Monitor is used monitor database instance", + Ref: ref("kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec"), + }, + }, + "configSource": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSource is an optional field to provide custom configuration file for database (i.e custom-mysql.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used.", + Ref: ref("k8s.io/api/core/v1.VolumeSource"), + }, + }, + "podTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "PodTemplate is an optional configuration for pods used to expose database", + Ref: ref("kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec"), + }, + }, + "serviceTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "ServiceTemplate is an optional configuration for service used to expose database", + Ref: ref("kmodules.xyz/offshoot-api/api/v1.ServiceTemplateSpec"), + }, + }, + "updateStrategy": { + SchemaProps: spec.SchemaProps{ + Description: "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", + Ref: ref("k8s.io/api/apps/v1.StatefulSetUpdateStrategy"), + }, + }, + "terminationPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "TerminationPolicy controls the delete operation for database", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"version"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.InitSpec", "k8s.io/api/apps/v1.StatefulSetUpdateStrategy", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.VolumeSource", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec", "kmodules.xyz/offshoot-api/api/v1.ServiceTemplateSpec"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_PerconaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "phase": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the most recent generation observed for this resource. It corresponds to the resource's generation, which is updated on mutation by the API Server.", + Ref: ref("github.com/appscode/go/encoding/json/types.IntHash"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "github.com/appscode/go/encoding/json/types.IntHash"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha1_Postgres(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3748,6 +4186,46 @@ func schema_apimachinery_apis_kubedb_v1alpha1_etcdStatsService(ref common.Refere } } +func schema_apimachinery_apis_kubedb_v1alpha1_mariadbApp(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "MariaDB": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB"), + }, + }, + }, + Required: []string{"MariaDB"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_mariadbStatsService(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "MariaDB": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB"), + }, + }, + }, + Required: []string{"MariaDB"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.MariaDB"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha1_memcachedApp(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3868,6 +4346,46 @@ func schema_apimachinery_apis_kubedb_v1alpha1_mysqlStatsService(ref common.Refer } } +func schema_apimachinery_apis_kubedb_v1alpha1_perconaApp(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Percona": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona"), + }, + }, + }, + Required: []string{"Percona"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona"}, + } +} + +func schema_apimachinery_apis_kubedb_v1alpha1_perconaStatsService(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Percona": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona"), + }, + }, + }, + Required: []string{"Percona"}, + }, + }, + Dependencies: []string{ + "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha1_postgresApp(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_helpers.go new file mode 100644 index 000000000..e890e8718 --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_helpers.go @@ -0,0 +1,205 @@ +package v1alpha1 + +import ( + "fmt" + + "github.com/appscode/go/types" + "github.com/kubedb/apimachinery/apis" + "github.com/kubedb/apimachinery/apis/kubedb" + apps "k8s.io/api/apps/v1" + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + crdutils "kmodules.xyz/client-go/apiextensions/v1beta1" + meta_util "kmodules.xyz/client-go/meta" + appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" + mona "kmodules.xyz/monitoring-agent-api/api/v1" +) + +var _ apis.ResourceInfo = &Percona{} + +func (p Percona) OffshootName() string { + return p.Name +} + +func (p Percona) OffshootSelectors() map[string]string { + return map[string]string{ + LabelDatabaseName: p.Name, + LabelDatabaseKind: ResourceKindPercona, + } +} + +func (p Percona) OffshootLabels() map[string]string { + out := p.OffshootSelectors() + out[meta_util.NameLabelKey] = ResourceSingularPercona + out[meta_util.VersionLabelKey] = string(p.Spec.Version) + out[meta_util.InstanceLabelKey] = p.Name + out[meta_util.ComponentLabelKey] = "database" + out[meta_util.ManagedByLabelKey] = GenericKey + return meta_util.FilterKeys(GenericKey, out, p.Labels) +} + +func (p Percona) ResourceShortCode() string { + return ResourceCodePercona +} + +func (p Percona) ResourceKind() string { + return ResourceKindPercona +} + +func (p Percona) ResourceSingular() string { + return ResourceSingularPercona +} + +func (p Percona) ResourcePlural() string { + return ResourcePluralPercona +} + +func (p Percona) ServiceName() string { + return p.OffshootName() +} + +func (p Percona) GoverningServiceName() string { + return p.OffshootName() + "-gvr" +} + +type perconaApp struct { + *Percona +} + +func (p perconaApp) Name() string { + return p.Percona.Name +} + +func (p perconaApp) Type() appcat.AppType { + return appcat.AppType(fmt.Sprintf("%s/%s", kubedb.GroupName, ResourceSingularPercona)) +} + +func (p Percona) AppBindingMeta() appcat.AppBindingMeta { + return &perconaApp{&p} +} + +type perconaStatsService struct { + *Percona +} + +func (p perconaStatsService) GetNamespace() string { + return p.Percona.GetNamespace() +} + +func (p perconaStatsService) ServiceName() string { + return p.OffshootName() + "-stats" +} + +func (p perconaStatsService) ServiceMonitorName() string { + return fmt.Sprintf("kubedb-%s-%s", p.Namespace, p.Name) +} + +func (p perconaStatsService) Path() string { + return "/metrics" +} + +func (p perconaStatsService) Scheme() string { + return "" +} + +func (p Percona) StatsService() mona.StatsAccessor { + return &perconaStatsService{&p} +} + +func (p Percona) StatsServiceLabels() map[string]string { + lbl := meta_util.FilterKeys(GenericKey, p.OffshootSelectors(), p.Labels) + lbl[LabelRole] = "stats" + return lbl +} + +func (p *Percona) GetMonitoringVendor() string { + if p.Spec.Monitor != nil { + return p.Spec.Monitor.Agent.Vendor() + } + return "" +} + +func (p Percona) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crdutils.NewCustomResourceDefinition(crdutils.Config{ + Group: SchemeGroupVersion.Group, + Plural: ResourcePluralPercona, + Singular: ResourceSingularPercona, + Kind: ResourceKindPercona, + ShortNames: []string{ResourceCodePercona}, + Categories: []string{"datastore", "kubedb", "appscode", "all"}, + ResourceScope: string(apiextensions.NamespaceScoped), + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: SchemeGroupVersion.Version, + Served: true, + Storage: true, + }, + }, + Labels: crdutils.Labels{ + LabelsMap: map[string]string{"app": "kubedb"}, + }, + SpecDefinitionName: "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1.Percona", + EnableValidation: true, + GetOpenAPIDefinitions: GetOpenAPIDefinitions, + EnableStatusSubresource: apis.EnableStatusSubresource, + AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{ + { + Name: "Version", + Type: "string", + JSONPath: ".spec.version", + }, + { + Name: "Status", + Type: "string", + JSONPath: ".status.phase", + }, + { + Name: "Age", + Type: "date", + JSONPath: ".metadata.creationTimestamp", + }, + }, + }, apis.SetNameSchema) +} + +func (p *Percona) SetDefaults() { + if p == nil { + return + } + p.Spec.SetDefaults() +} + +func (p *PerconaSpec) SetDefaults() { + if p == nil { + return + } + + if p.Replicas == nil { + p.Replicas = types.Int32P(1) + } + + if p.StorageType == "" { + p.StorageType = StorageTypeDurable + } + if p.UpdateStrategy.Type == "" { + p.UpdateStrategy.Type = apps.RollingUpdateStatefulSetStrategyType + } + if p.TerminationPolicy == "" { + if p.StorageType == StorageTypeEphemeral { + p.TerminationPolicy = TerminationPolicyDelete + } else { + p.TerminationPolicy = TerminationPolicyPause + } + } +} + +func (p *PerconaSpec) GetSecrets() []string { + if p == nil { + return nil + } + + var secrets []string + if p.DatabaseSecret != nil { + secrets = append(secrets, p.DatabaseSecret.SecretName) + } + return secrets +} diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_types.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_types.go new file mode 100644 index 000000000..60040bea2 --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/percona_types.go @@ -0,0 +1,93 @@ +package v1alpha1 + +import ( + "github.com/appscode/go/encoding/json/types" + apps "k8s.io/api/apps/v1" + core "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + mona "kmodules.xyz/monitoring-agent-api/api/v1" + ofst "kmodules.xyz/offshoot-api/api/v1" +) + +const ( + ResourceCodePercona = "pc" + ResourceKindPercona = "Percona" + ResourceSingularPercona = "percona" + ResourcePluralPercona = "perconas" +) + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Percona defines a percona variation of Mysql database. +type Percona struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec PerconaSpec `json:"spec,omitempty"` + Status PerconaStatus `json:"status,omitempty"` +} + +type PerconaSpec struct { + // Version of Percona to be deployed. + Version types.StrYo `json:"version"` + + // Number of instances to deploy for Percona + Replicas *int32 `json:"replicas,omitempty"` + + // StorageType can be durable (default) or ephemeral + StorageType StorageType `json:"storageType,omitempty"` + + // Storage spec to specify how storage shall be used. + Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"` + + // Database authentication secret + DatabaseSecret *core.SecretVolumeSource `json:"databaseSecret,omitempty"` + + // Init is used to initialize database + // +optional + Init *InitSpec `json:"init,omitempty"` + + // Monitor is used monitor database instance + // +optional + Monitor *mona.AgentSpec `json:"monitor,omitempty"` + + // ConfigSource is an optional field to provide custom configuration file for database (i.e custom-mysql.cnf). + // If specified, this file will be used as configuration file otherwise default configuration file will be used. + ConfigSource *core.VolumeSource `json:"configSource,omitempty"` + + // PodTemplate is an optional configuration for pods used to expose database + // +optional + PodTemplate ofst.PodTemplateSpec `json:"podTemplate,omitempty"` + + // ServiceTemplate is an optional configuration for service used to expose database + // +optional + ServiceTemplate ofst.ServiceTemplateSpec `json:"serviceTemplate,omitempty"` + + // updateStrategy indicates the StatefulSetUpdateStrategy that will be + // employed to update Pods in the StatefulSet when a revision is made to + // Template. + UpdateStrategy apps.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"` + + // TerminationPolicy controls the delete operation for database + // +optional + TerminationPolicy TerminationPolicy `json:"terminationPolicy,omitempty"` +} + +type PerconaStatus struct { + Phase DatabasePhase `json:"phase,omitempty"` + Reason string `json:"reason,omitempty"` + // observedGeneration is the most recent generation observed for this resource. It corresponds to the + // resource's generation, which is updated on mutation by the API Server. + // +optional + ObservedGeneration *types.IntHash `json:"observedGeneration,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type PerconaList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + // Items is a list of Percona TPR objects + Items []Percona `json:"items,omitempty"` +} diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/postgres_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/postgres_helpers.go index b2d971618..46998d26d 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/postgres_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/postgres_helpers.go @@ -171,6 +171,10 @@ func (p *Postgres) SetDefaults() { return } p.Spec.SetDefaults() + + if p.Spec.PodTemplate.Spec.ServiceAccountName == "" { + p.Spec.PodTemplate.Spec.ServiceAccountName = p.OffshootName() + } } func (p *PostgresSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/redis_helpers.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/redis_helpers.go index 43a756c7d..ed1c261c5 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/redis_helpers.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/redis_helpers.go @@ -174,6 +174,10 @@ func (r *Redis) SetDefaults() { return } r.Spec.SetDefaults() + + if r.Spec.PodTemplate.Spec.ServiceAccountName == "" { + r.Spec.PodTemplate.Spec.ServiceAccountName = r.OffshootName() + } } func (r *RedisSpec) SetDefaults() { diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/register.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/register.go index 388a7b94c..7df39bf68 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/register.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/register.go @@ -47,6 +47,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &MongoDBList{}, &MySQL{}, &MySQLList{}, + &Percona{}, + &PerconaList{}, + &MariaDB{}, + &MariaDBList{}, &Redis{}, &RedisList{}, &Etcd{}, diff --git a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/zz_generated.deepcopy.go index b4ccfdbcd..27bf6cd6b 100644 --- a/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubedb/apimachinery/apis/kubedb/v1alpha1/zz_generated.deepcopy.go @@ -535,6 +535,136 @@ func (in *LeaderElectionConfig) DeepCopy() *LeaderElectionConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MariaDB) DeepCopyInto(out *MariaDB) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariaDB. +func (in *MariaDB) DeepCopy() *MariaDB { + if in == nil { + return nil + } + out := new(MariaDB) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MariaDB) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MariaDBList) DeepCopyInto(out *MariaDBList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MariaDB, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariaDBList. +func (in *MariaDBList) DeepCopy() *MariaDBList { + if in == nil { + return nil + } + out := new(MariaDBList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MariaDBList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MariaDBSpec) DeepCopyInto(out *MariaDBSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(v1.PersistentVolumeClaimSpec) + (*in).DeepCopyInto(*out) + } + if in.DatabaseSecret != nil { + in, out := &in.DatabaseSecret, &out.DatabaseSecret + *out = new(v1.SecretVolumeSource) + (*in).DeepCopyInto(*out) + } + if in.Init != nil { + in, out := &in.Init, &out.Init + *out = new(InitSpec) + (*in).DeepCopyInto(*out) + } + if in.Monitor != nil { + in, out := &in.Monitor, &out.Monitor + *out = new(apiv1.AgentSpec) + (*in).DeepCopyInto(*out) + } + if in.ConfigSource != nil { + in, out := &in.ConfigSource, &out.ConfigSource + *out = new(v1.VolumeSource) + (*in).DeepCopyInto(*out) + } + in.PodTemplate.DeepCopyInto(&out.PodTemplate) + in.ServiceTemplate.DeepCopyInto(&out.ServiceTemplate) + in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariaDBSpec. +func (in *MariaDBSpec) DeepCopy() *MariaDBSpec { + if in == nil { + return nil + } + out := new(MariaDBSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MariaDBStatus) DeepCopyInto(out *MariaDBStatus) { + *out = *in + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariaDBStatus. +func (in *MariaDBStatus) DeepCopy() *MariaDBStatus { + if in == nil { + return nil + } + out := new(MariaDBStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemberSecret) DeepCopyInto(out *MemberSecret) { *out = *in @@ -1205,6 +1335,136 @@ func (in *OriginSpec) DeepCopy() *OriginSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Percona) DeepCopyInto(out *Percona) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Percona. +func (in *Percona) DeepCopy() *Percona { + if in == nil { + return nil + } + out := new(Percona) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Percona) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PerconaList) DeepCopyInto(out *PerconaList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Percona, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaList. +func (in *PerconaList) DeepCopy() *PerconaList { + if in == nil { + return nil + } + out := new(PerconaList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PerconaList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PerconaSpec) DeepCopyInto(out *PerconaSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Storage != nil { + in, out := &in.Storage, &out.Storage + *out = new(v1.PersistentVolumeClaimSpec) + (*in).DeepCopyInto(*out) + } + if in.DatabaseSecret != nil { + in, out := &in.DatabaseSecret, &out.DatabaseSecret + *out = new(v1.SecretVolumeSource) + (*in).DeepCopyInto(*out) + } + if in.Init != nil { + in, out := &in.Init, &out.Init + *out = new(InitSpec) + (*in).DeepCopyInto(*out) + } + if in.Monitor != nil { + in, out := &in.Monitor, &out.Monitor + *out = new(apiv1.AgentSpec) + (*in).DeepCopyInto(*out) + } + if in.ConfigSource != nil { + in, out := &in.ConfigSource, &out.ConfigSource + *out = new(v1.VolumeSource) + (*in).DeepCopyInto(*out) + } + in.PodTemplate.DeepCopyInto(&out.PodTemplate) + in.ServiceTemplate.DeepCopyInto(&out.ServiceTemplate) + in.UpdateStrategy.DeepCopyInto(&out.UpdateStrategy) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaSpec. +func (in *PerconaSpec) DeepCopy() *PerconaSpec { + if in == nil { + return nil + } + out := new(PerconaSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PerconaStatus) DeepCopyInto(out *PerconaStatus) { + *out = *in + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = (*in).DeepCopy() + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PerconaStatus. +func (in *PerconaStatus) DeepCopy() *PerconaStatus { + if in == nil { + return nil + } + out := new(PerconaStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Postgres) DeepCopyInto(out *Postgres) { *out = *in diff --git a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/generated_expansion.go b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/generated_expansion.go index 74dc88ec8..94bb1a12b 100644 --- a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/generated_expansion.go +++ b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/generated_expansion.go @@ -24,12 +24,16 @@ type ElasticsearchExpansion interface{} type EtcdExpansion interface{} +type MariaDBExpansion interface{} + type MemcachedExpansion interface{} type MongoDBExpansion interface{} type MySQLExpansion interface{} +type PerconaExpansion interface{} + type PostgresExpansion interface{} type RedisExpansion interface{} diff --git a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/kubedb_client.go b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/kubedb_client.go index fdd2368af..b78c5a7b3 100644 --- a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/kubedb_client.go +++ b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/kubedb_client.go @@ -30,9 +30,11 @@ type KubedbV1alpha1Interface interface { DormantDatabasesGetter ElasticsearchesGetter EtcdsGetter + MariaDBsGetter MemcachedsGetter MongoDBsGetter MySQLsGetter + PerconasGetter PostgresesGetter RedisesGetter SnapshotsGetter @@ -55,6 +57,10 @@ func (c *KubedbV1alpha1Client) Etcds(namespace string) EtcdInterface { return newEtcds(c, namespace) } +func (c *KubedbV1alpha1Client) MariaDBs(namespace string) MariaDBInterface { + return newMariaDBs(c, namespace) +} + func (c *KubedbV1alpha1Client) Memcacheds(namespace string) MemcachedInterface { return newMemcacheds(c, namespace) } @@ -67,6 +73,10 @@ func (c *KubedbV1alpha1Client) MySQLs(namespace string) MySQLInterface { return newMySQLs(c, namespace) } +func (c *KubedbV1alpha1Client) Perconas(namespace string) PerconaInterface { + return newPerconas(c, namespace) +} + func (c *KubedbV1alpha1Client) Postgreses(namespace string) PostgresInterface { return newPostgreses(c, namespace) } diff --git a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/mariadb.go b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/mariadb.go new file mode 100644 index 000000000..33316125e --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/mariadb.go @@ -0,0 +1,191 @@ +/* +Copyright 2019 The KubeDB Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1" + scheme "github.com/kubedb/apimachinery/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" +) + +// MariaDBsGetter has a method to return a MariaDBInterface. +// A group's client should implement this interface. +type MariaDBsGetter interface { + MariaDBs(namespace string) MariaDBInterface +} + +// MariaDBInterface has methods to work with MariaDB resources. +type MariaDBInterface interface { + Create(*v1alpha1.MariaDB) (*v1alpha1.MariaDB, error) + Update(*v1alpha1.MariaDB) (*v1alpha1.MariaDB, error) + UpdateStatus(*v1alpha1.MariaDB) (*v1alpha1.MariaDB, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.MariaDB, error) + List(opts v1.ListOptions) (*v1alpha1.MariaDBList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MariaDB, err error) + MariaDBExpansion +} + +// mariaDBs implements MariaDBInterface +type mariaDBs struct { + client rest.Interface + ns string +} + +// newMariaDBs returns a MariaDBs +func newMariaDBs(c *KubedbV1alpha1Client, namespace string) *mariaDBs { + return &mariaDBs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the mariaDB, and returns the corresponding mariaDB object, and an error if there is any. +func (c *mariaDBs) Get(name string, options v1.GetOptions) (result *v1alpha1.MariaDB, err error) { + result = &v1alpha1.MariaDB{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mariadbs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MariaDBs that match those selectors. +func (c *mariaDBs) List(opts v1.ListOptions) (result *v1alpha1.MariaDBList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.MariaDBList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("mariadbs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested mariaDBs. +func (c *mariaDBs) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("mariadbs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a mariaDB and creates it. Returns the server's representation of the mariaDB, and an error, if there is any. +func (c *mariaDBs) Create(mariaDB *v1alpha1.MariaDB) (result *v1alpha1.MariaDB, err error) { + result = &v1alpha1.MariaDB{} + err = c.client.Post(). + Namespace(c.ns). + Resource("mariadbs"). + Body(mariaDB). + Do(). + Into(result) + return +} + +// Update takes the representation of a mariaDB and updates it. Returns the server's representation of the mariaDB, and an error, if there is any. +func (c *mariaDBs) Update(mariaDB *v1alpha1.MariaDB) (result *v1alpha1.MariaDB, err error) { + result = &v1alpha1.MariaDB{} + err = c.client.Put(). + Namespace(c.ns). + Resource("mariadbs"). + Name(mariaDB.Name). + Body(mariaDB). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *mariaDBs) UpdateStatus(mariaDB *v1alpha1.MariaDB) (result *v1alpha1.MariaDB, err error) { + result = &v1alpha1.MariaDB{} + err = c.client.Put(). + Namespace(c.ns). + Resource("mariadbs"). + Name(mariaDB.Name). + SubResource("status"). + Body(mariaDB). + Do(). + Into(result) + return +} + +// Delete takes name of the mariaDB and deletes it. Returns an error if one occurs. +func (c *mariaDBs) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("mariadbs"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *mariaDBs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("mariadbs"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched mariaDB. +func (c *mariaDBs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MariaDB, err error) { + result = &v1alpha1.MariaDB{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("mariadbs"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/percona.go b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/percona.go new file mode 100644 index 000000000..ff0abfa7e --- /dev/null +++ b/vendor/github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1/percona.go @@ -0,0 +1,191 @@ +/* +Copyright 2019 The KubeDB Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/kubedb/apimachinery/apis/kubedb/v1alpha1" + scheme "github.com/kubedb/apimachinery/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" +) + +// PerconasGetter has a method to return a PerconaInterface. +// A group's client should implement this interface. +type PerconasGetter interface { + Perconas(namespace string) PerconaInterface +} + +// PerconaInterface has methods to work with Percona resources. +type PerconaInterface interface { + Create(*v1alpha1.Percona) (*v1alpha1.Percona, error) + Update(*v1alpha1.Percona) (*v1alpha1.Percona, error) + UpdateStatus(*v1alpha1.Percona) (*v1alpha1.Percona, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.Percona, error) + List(opts v1.ListOptions) (*v1alpha1.PerconaList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Percona, err error) + PerconaExpansion +} + +// perconas implements PerconaInterface +type perconas struct { + client rest.Interface + ns string +} + +// newPerconas returns a Perconas +func newPerconas(c *KubedbV1alpha1Client, namespace string) *perconas { + return &perconas{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the percona, and returns the corresponding percona object, and an error if there is any. +func (c *perconas) Get(name string, options v1.GetOptions) (result *v1alpha1.Percona, err error) { + result = &v1alpha1.Percona{} + err = c.client.Get(). + Namespace(c.ns). + Resource("perconas"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Perconas that match those selectors. +func (c *perconas) List(opts v1.ListOptions) (result *v1alpha1.PerconaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PerconaList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("perconas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested perconas. +func (c *perconas) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("perconas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a percona and creates it. Returns the server's representation of the percona, and an error, if there is any. +func (c *perconas) Create(percona *v1alpha1.Percona) (result *v1alpha1.Percona, err error) { + result = &v1alpha1.Percona{} + err = c.client.Post(). + Namespace(c.ns). + Resource("perconas"). + Body(percona). + Do(). + Into(result) + return +} + +// Update takes the representation of a percona and updates it. Returns the server's representation of the percona, and an error, if there is any. +func (c *perconas) Update(percona *v1alpha1.Percona) (result *v1alpha1.Percona, err error) { + result = &v1alpha1.Percona{} + err = c.client.Put(). + Namespace(c.ns). + Resource("perconas"). + Name(percona.Name). + Body(percona). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *perconas) UpdateStatus(percona *v1alpha1.Percona) (result *v1alpha1.Percona, err error) { + result = &v1alpha1.Percona{} + err = c.client.Put(). + Namespace(c.ns). + Resource("perconas"). + Name(percona.Name). + SubResource("status"). + Body(percona). + Do(). + Into(result) + return +} + +// Delete takes name of the percona and deletes it. Returns an error if one occurs. +func (c *perconas) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("perconas"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *perconas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("perconas"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched percona. +func (c *perconas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Percona, err error) { + result = &v1alpha1.Percona{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("perconas"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/sirupsen/logrus/.travis.yml b/vendor/github.com/sirupsen/logrus/.travis.yml index 7e54dc6e3..848938a6d 100644 --- a/vendor/github.com/sirupsen/logrus/.travis.yml +++ b/vendor/github.com/sirupsen/logrus/.travis.yml @@ -5,16 +5,20 @@ git: env: - GO111MODULE=on - GO111MODULE=off -go: [ 1.10.x, 1.11.x, 1.12.x ] -os: [ linux, osx, windows ] +go: [ 1.11.x, 1.12.x ] +os: [ linux, osx ] matrix: exclude: - - env: GO111MODULE=on - go: 1.10.x + - go: 1.12.x + env: GO111MODULE=off + - go: 1.11.x + os: osx install: + - ./travis/install.sh - if [[ "$GO111MODULE" == "on" ]]; then go mod download; fi - if [[ "$GO111MODULE" == "off" ]]; then go get github.com/stretchr/testify/assert golang.org/x/sys/unix github.com/konsorten/go-windows-terminal-sequences; fi script: + - ./travis/cross_build.sh - export GOMAXPROCS=4 - export GORACE=halt_on_error=1 - go test -race -v ./... diff --git a/vendor/github.com/sirupsen/logrus/CHANGELOG.md b/vendor/github.com/sirupsen/logrus/CHANGELOG.md index f62cbd24a..51a7ab0ca 100644 --- a/vendor/github.com/sirupsen/logrus/CHANGELOG.md +++ b/vendor/github.com/sirupsen/logrus/CHANGELOG.md @@ -1,3 +1,5 @@ +# 1.4.2 + * Fixes build break for plan9, nacl, solaris # 1.4.1 This new release introduces: * Enhance TextFormatter to not print caller information when they are empty (#944) diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod index 8261a2b3a..12fdf9898 100644 --- a/vendor/github.com/sirupsen/logrus/go.mod +++ b/vendor/github.com/sirupsen/logrus/go.mod @@ -6,5 +6,5 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.1.1 // indirect github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 + golang.org/x/sys v0.0.0-20190422165155-953cdadca894 ) diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum index 2d787be60..596c318b9 100644 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ b/vendor/github.com/sirupsen/logrus/go.sum @@ -2,6 +2,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe h1:CHRGQ8V7OlCYtwaKPJi3iA7J+YdNKdo8j7nG5IgDhjs= github.com/konsorten/go-windows-terminal-sequences v0.0.0-20180402223658-b729f2633dfe/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -11,3 +12,5 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_js.go b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go similarity index 79% rename from vendor/github.com/sirupsen/logrus/terminal_check_js.go rename to vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go index 0c209750a..97af92c68 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_js.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go @@ -1,4 +1,4 @@ -// +build js +// +build js nacl plan9 package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go index 7be2d87c5..3293fb3ca 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go @@ -1,4 +1,4 @@ -// +build !appengine,!js,!windows +// +build !appengine,!js,!windows,!nacl,!plan9 package logrus diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go b/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go new file mode 100644 index 000000000..f6710b3bd --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/terminal_check_solaris.go @@ -0,0 +1,11 @@ +package logrus + +import ( + "golang.org/x/sys/unix" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func isTerminal(fd int) bool { + _, err := unix.IoctlGetTermio(fd, unix.TCGETA) + return err == nil +} diff --git a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go index 3b9d2864c..572889db2 100644 --- a/vendor/github.com/sirupsen/logrus/terminal_check_windows.go +++ b/vendor/github.com/sirupsen/logrus/terminal_check_windows.go @@ -6,15 +6,29 @@ import ( "io" "os" "syscall" + + sequences "github.com/konsorten/go-windows-terminal-sequences" ) +func initTerminal(w io.Writer) { + switch v := w.(type) { + case *os.File: + sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) + } +} + func checkIfTerminal(w io.Writer) bool { + var ret bool switch v := w.(type) { case *os.File: var mode uint32 err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) - return err == nil + ret = (err == nil) default: - return false + ret = false + } + if ret { + initTerminal(w) } + return ret } diff --git a/vendor/github.com/sirupsen/logrus/terminal_notwindows.go b/vendor/github.com/sirupsen/logrus/terminal_notwindows.go deleted file mode 100644 index 3dbd23720..000000000 --- a/vendor/github.com/sirupsen/logrus/terminal_notwindows.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build !windows - -package logrus - -import "io" - -func initTerminal(w io.Writer) { -} diff --git a/vendor/github.com/sirupsen/logrus/terminal_windows.go b/vendor/github.com/sirupsen/logrus/terminal_windows.go deleted file mode 100644 index b4ef5286c..000000000 --- a/vendor/github.com/sirupsen/logrus/terminal_windows.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build !appengine,!js,windows - -package logrus - -import ( - "io" - "os" - "syscall" - - sequences "github.com/konsorten/go-windows-terminal-sequences" -) - -func initTerminal(w io.Writer) { - switch v := w.(type) { - case *os.File: - sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) - } -} diff --git a/vendor/github.com/sirupsen/logrus/text_formatter.go b/vendor/github.com/sirupsen/logrus/text_formatter.go index 1569161eb..e01587c43 100644 --- a/vendor/github.com/sirupsen/logrus/text_formatter.go +++ b/vendor/github.com/sirupsen/logrus/text_formatter.go @@ -84,10 +84,6 @@ type TextFormatter struct { func (f *TextFormatter) init(entry *Entry) { if entry.Logger != nil { f.isTerminal = checkIfTerminal(entry.Logger.Out) - - if f.isTerminal { - initTerminal(entry.Logger.Out) - } } } diff --git a/vendor/github.com/spf13/cobra/.travis.yml b/vendor/github.com/spf13/cobra/.travis.yml index 5afcb2096..38b85f499 100644 --- a/vendor/github.com/spf13/cobra/.travis.yml +++ b/vendor/github.com/spf13/cobra/.travis.yml @@ -1,21 +1,31 @@ language: go +stages: + - diff + - test + +go: + - 1.10.x + - 1.11.x + - 1.12.x + - tip + matrix: - include: - - go: 1.9.4 - - go: 1.10.0 - - go: tip allow_failures: - go: tip + include: + - stage: diff + go: 1.12.x + script: diff -u <(echo -n) <(gofmt -d -s .) before_install: - mkdir -p bin - - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.3/shellcheck + - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.6.0/shellcheck - chmod +x bin/shellcheck + - go get -u github.com/kyoh86/richgo script: - - PATH=$PATH:$PWD/bin go test -v ./... + - PATH=$PATH:$PWD/bin richgo test -v ./... - go build - - diff -u <(echo -n) <(gofmt -d -s .) - if [ -z $NOVET ]; then - diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); + diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); fi diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index 851fcc087..ff16e3f60 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -2,25 +2,28 @@ Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. -Many of the most widely used Go projects are built using Cobra including: - -* [Kubernetes](http://kubernetes.io/) -* [Hugo](http://gohugo.io) -* [rkt](https://github.com/coreos/rkt) -* [etcd](https://github.com/coreos/etcd) -* [Moby (former Docker)](https://github.com/moby/moby) -* [Docker (distribution)](https://github.com/docker/distribution) -* [OpenShift](https://www.openshift.com/) -* [Delve](https://github.com/derekparker/delve) -* [GopherJS](http://www.gopherjs.org/) -* [CockroachDB](http://www.cockroachlabs.com/) -* [Bleve](http://www.blevesearch.com/) -* [ProjectAtomic (enterprise)](http://www.projectatomic.io/) -* [GiantSwarm's swarm](https://github.com/giantswarm/cli) -* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) -* [rclone](http://rclone.org/) -* [nehm](https://github.com/bogem/nehm) -* [Pouch](https://github.com/alibaba/pouch) +Many of the most widely used Go projects are built using Cobra, such as: +[Kubernetes](http://kubernetes.io/), +[Hugo](http://gohugo.io), +[rkt](https://github.com/coreos/rkt), +[etcd](https://github.com/coreos/etcd), +[Moby (former Docker)](https://github.com/moby/moby), +[Docker (distribution)](https://github.com/docker/distribution), +[OpenShift](https://www.openshift.com/), +[Delve](https://github.com/derekparker/delve), +[GopherJS](http://www.gopherjs.org/), +[CockroachDB](http://www.cockroachlabs.com/), +[Bleve](http://www.blevesearch.com/), +[ProjectAtomic (enterprise)](http://www.projectatomic.io/), +[Giant Swarm's gsctl](https://github.com/giantswarm/gsctl), +[Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack), +[rclone](http://rclone.org/), +[nehm](https://github.com/bogem/nehm), +[Pouch](https://github.com/alibaba/pouch), +[Istio](https://istio.io), +[Prototool](https://github.com/uber/prototool), +[mattermost-server](https://github.com/mattermost/mattermost-server), +etc. [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra) @@ -152,9 +155,6 @@ In a Cobra app, typically the main.go file is very bare. It serves one purpose: package main import ( - "fmt" - "os" - "{pathToYourApp}/cmd" ) @@ -265,9 +265,6 @@ In a Cobra app, typically the main.go file is very bare. It serves, one purpose, package main import ( - "fmt" - "os" - "{pathToYourApp}/cmd" ) @@ -395,6 +392,7 @@ The following validators are built in: - `MinimumNArgs(int)` - the command will report an error if there are not at least N positional args. - `MaximumNArgs(int)` - the command will report an error if there are more than N positional args. - `ExactArgs(int)` - the command will report an error if there are not exactly N positional args. +- `ExactValidArgs(int)` - the command will report an error if there are not exactly N positional args OR if there are any positional args that are not in the `ValidArgs` field of `Command` - `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args. An example of setting the custom validator: @@ -404,7 +402,7 @@ var cmd = &cobra.Command{ Short: "hello", Args: func(cmd *cobra.Command, args []string) error { if len(args) < 1 { - return errors.New("requires at least one arg") + return errors.New("requires a color argument") } if myapp.IsValidColor(args[0]) { return nil @@ -464,7 +462,7 @@ Echo works a lot like print, except it has a child command.`, } var cmdTimes = &cobra.Command{ - Use: "times [# times] [string to echo]", + Use: "times [string to echo]", Short: "Echo anything to the screen more times", Long: `echo things multiple times back to the user by providing a count and a string.`, diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go index a5d8a9273..c4d820b85 100644 --- a/vendor/github.com/spf13/cobra/args.go +++ b/vendor/github.com/spf13/cobra/args.go @@ -78,6 +78,18 @@ func ExactArgs(n int) PositionalArgs { } } +// ExactValidArgs returns an error if +// there are not exactly N positional args OR +// there are any positional args that are not in the `ValidArgs` field of `Command` +func ExactValidArgs(n int) PositionalArgs { + return func(cmd *Command, args []string) error { + if err := ExactArgs(n)(cmd, args); err != nil { + return err + } + return OnlyValidArgs(cmd, args) + } +} + // RangeArgs returns an error if the number of args is not within the expected range. func RangeArgs(min int, max int) PositionalArgs { return func(cmd *Command, args []string) error { diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index 8fa8f486f..c3c1e5018 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -129,7 +129,13 @@ __%[1]s_handle_reply() fi if [[ ${#COMPREPLY[@]} -eq 0 ]]; then - declare -F __custom_func >/dev/null && __custom_func + if declare -F __%[1]s_custom_func >/dev/null; then + # try command name qualified custom func + __%[1]s_custom_func + else + # otherwise fall back to unqualified for compatibility + declare -F __custom_func >/dev/null && __custom_func + fi fi # available in bash-completion >= 2, not always present on macOS @@ -193,7 +199,8 @@ __%[1]s_handle_flag() fi # skip the argument to a two word flag - if __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then + if [[ ${words[c]} != *"="* ]] && __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then + __%[1]s_debug "${FUNCNAME[0]}: found a flag ${words[c]}, skip the next argument" c=$((c+1)) # if we are looking for a flags value, don't show commands if [[ $c -eq $cword ]]; then @@ -373,6 +380,10 @@ func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { } format += "\")\n" buf.WriteString(fmt.Sprintf(format, name)) + if len(flag.NoOptDefVal) == 0 { + format = " two_word_flags+=(\"--%s\")\n" + buf.WriteString(fmt.Sprintf(format, name)) + } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md index e79d4769d..4ac61ee13 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.md +++ b/vendor/github.com/spf13/cobra/bash_completions.md @@ -1,5 +1,40 @@ # Generating Bash Completions For Your Own cobra.Command +If you are using the generator you can create a completion command by running + +```bash +cobra add completion +``` + +Update the help text show how to install the bash_completion Linux show here [Kubectl docs show mac options](https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion) + +Writing the shell script to stdout allows the most flexible use. + +```go +// completionCmd represents the completion command +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generates bash completion scripts", + Long: `To load completion run + +. <(bitbucket completion) + +To configure your bash shell to load completions for each session add to your bashrc + +# ~/.bashrc or ~/.profile +. <(bitbucket completion) +`, + Run: func(cmd *cobra.Command, args []string) { + rootCmd.GenBashCompletion(os.Stdout); + }, +} +``` + +**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script + + +## Example from kubectl + Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: ```go @@ -47,7 +82,7 @@ __kubectl_get_resource() fi } -__custom_func() { +__kubectl_custom_func() { case ${last_command} in kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop) __kubectl_get_resource @@ -74,7 +109,7 @@ Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, } ``` -The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! +The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__kubectl_custom_func()` (`___custom_func()`) to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__kubectl_customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__kubectl_custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! ## Have the completions code complete your 'nouns' diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index 7010fd15b..6505c070b 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -23,6 +23,7 @@ import ( "strconv" "strings" "text/template" + "time" "unicode" ) @@ -56,6 +57,12 @@ var MousetrapHelpText string = `This is a command line tool. You need to open cmd.exe and run it from there. ` +// MousetrapDisplayDuration controls how long the MousetrapHelpText message is displayed on Windows +// if the CLI is started from explorer.exe. Set to 0 to wait for the return key to be pressed. +// To disable the mousetrap, just set MousetrapHelpText to blank string (""). +// Works only on Microsoft Windows. +var MousetrapDisplayDuration time.Duration = 5 * time.Second + // AddTemplateFunc adds a template function that's available to Usage and Help // template generation. func AddTemplateFunc(name string, tmplFunc interface{}) { diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index 34d1bf367..b257f91b6 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -817,13 +817,11 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { // overriding c.InitDefaultHelpCmd() - var args []string + args := c.args // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { args = os.Args[1:] - } else { - args = c.args } var flags []string @@ -1335,7 +1333,7 @@ func (c *Command) LocalFlags() *flag.FlagSet { return c.lflags } -// InheritedFlags returns all flags which were inherited from parents commands. +// InheritedFlags returns all flags which were inherited from parent commands. func (c *Command) InheritedFlags() *flag.FlagSet { c.mergePersistentFlags() diff --git a/vendor/github.com/spf13/cobra/command_win.go b/vendor/github.com/spf13/cobra/command_win.go index edec728e4..8768b1736 100644 --- a/vendor/github.com/spf13/cobra/command_win.go +++ b/vendor/github.com/spf13/cobra/command_win.go @@ -3,6 +3,7 @@ package cobra import ( + "fmt" "os" "time" @@ -14,7 +15,12 @@ var preExecHookFn = preExecHook func preExecHook(c *Command) { if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { c.Print(MousetrapHelpText) - time.Sleep(5 * time.Second) + if MousetrapDisplayDuration > 0 { + time.Sleep(MousetrapDisplayDuration) + } else { + c.Println("Press return to continue...") + fmt.Scanln() + } os.Exit(1) } } diff --git a/vendor/github.com/spf13/cobra/doc/man_docs.go b/vendor/github.com/spf13/cobra/doc/man_docs.go index baa48118a..4a0623393 100644 --- a/vendor/github.com/spf13/cobra/doc/man_docs.go +++ b/vendor/github.com/spf13/cobra/doc/man_docs.go @@ -20,6 +20,7 @@ import ( "os" "path/filepath" "sort" + "strconv" "strings" "time" @@ -87,7 +88,7 @@ type GenManTreeOptions struct { // GenManHeader is a lot like the .TH header at the start of man pages. These // include the title, section, date, source, and manual. We will use the -// current time if Date if unset and will use "Auto generated by spf13/cobra" +// current time if Date is unset and will use "Auto generated by spf13/cobra" // if the Source is unset. type GenManHeader struct { Title string @@ -104,14 +105,16 @@ func GenMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error { if header == nil { header = &GenManHeader{} } - fillHeader(header, cmd.CommandPath()) + if err := fillHeader(header, cmd.CommandPath()); err != nil { + return err + } b := genMan(cmd, header) _, err := w.Write(md2man.Render(b)) return err } -func fillHeader(header *GenManHeader, name string) { +func fillHeader(header *GenManHeader, name string) error { if header.Title == "" { header.Title = strings.ToUpper(strings.Replace(name, " ", "\\-", -1)) } @@ -120,12 +123,20 @@ func fillHeader(header *GenManHeader, name string) { } if header.Date == nil { now := time.Now() + if epoch := os.Getenv("SOURCE_DATE_EPOCH"); epoch != "" { + unixEpoch, err := strconv.ParseInt(epoch, 10, 64) + if err != nil { + return fmt.Errorf("invalid SOURCE_DATE_EPOCH: %v", err) + } + now = time.Unix(unixEpoch, 0) + } header.Date = &now } header.date = (*header.Date).Format("Jan 2006") if header.Source == "" { header.Source = "Auto generated by spf13/cobra" } + return nil } func manPreamble(buf *bytes.Buffer, header *GenManHeader, cmd *cobra.Command, dashedName string) { diff --git a/vendor/github.com/spf13/cobra/go.mod b/vendor/github.com/spf13/cobra/go.mod new file mode 100644 index 000000000..9a9eb65a3 --- /dev/null +++ b/vendor/github.com/spf13/cobra/go.mod @@ -0,0 +1,13 @@ +module github.com/spf13/cobra + +go 1.12 + +require ( + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/cpuguy83/go-md2man v1.0.10 + github.com/inconshreveable/mousetrap v1.0.0 + github.com/mitchellh/go-homedir v1.1.0 + github.com/spf13/pflag v1.0.3 + github.com/spf13/viper v1.3.2 + gopkg.in/yaml.v2 v2.2.2 +) diff --git a/vendor/github.com/spf13/cobra/go.sum b/vendor/github.com/spf13/cobra/go.sum new file mode 100644 index 000000000..9761f4d03 --- /dev/null +++ b/vendor/github.com/spf13/cobra/go.sum @@ -0,0 +1,51 @@ +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/kmodules.xyz/client-go/.travis.yml b/vendor/kmodules.xyz/client-go/.travis.yml index 6463c1a2e..d96b1f30a 100644 --- a/vendor/kmodules.xyz/client-go/.travis.yml +++ b/vendor/kmodules.xyz/client-go/.travis.yml @@ -3,6 +3,11 @@ go: - 1.x - tip +cache: + directories: + - $HOME/.cache/go-build + - $GOPATH/pkg/mod + go_import_path: kmodules.xyz/client-go install: true diff --git a/vendor/kmodules.xyz/client-go/core/v1/node.go b/vendor/kmodules.xyz/client-go/core/v1/node.go index 285243196..43052f4af 100644 --- a/vendor/kmodules.xyz/client-go/core/v1/node.go +++ b/vendor/kmodules.xyz/client-go/core/v1/node.go @@ -16,7 +16,7 @@ import ( func CreateOrPatchNode(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Node) *core.Node) (*core.Node, kutil.VerbType, error) { cur, err := c.CoreV1().Nodes().Get(meta.Name, metav1.GetOptions{}) if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating Node %s/%s.", meta.Namespace, meta.Name) + glog.V(3).Infof("Creating Node %s", meta.Name) out, err := c.CoreV1().Nodes().Create(transform(&core.Node{ TypeMeta: metav1.TypeMeta{ Kind: "Node", diff --git a/vendor/modules.txt b/vendor/modules.txt index 93019f946..80c710e1b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -16,7 +16,7 @@ github.com/MakeNowJust/heredoc github.com/PuerkitoBio/purell # github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 github.com/PuerkitoBio/urlesc -# github.com/appscode/go v0.0.0-20190424183524-60025f1135c9 +# github.com/appscode/go v0.0.0-20190523031839-1468ee3a76e8 github.com/appscode/go/version github.com/appscode/go/runtime github.com/appscode/go/types @@ -50,7 +50,7 @@ github.com/docker/docker/pkg/term/windows # github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c github.com/docker/spdystream github.com/docker/spdystream/spdy -# github.com/emicklei/go-restful v2.9.3+incompatible +# github.com/emicklei/go-restful v2.9.5+incompatible github.com/emicklei/go-restful github.com/emicklei/go-restful/log # github.com/evanphx/json-patch v4.2.0+incompatible @@ -124,7 +124,7 @@ github.com/jpillora/go-ogle-analytics github.com/json-iterator/go # github.com/konsorten/go-windows-terminal-sequences v1.0.2 github.com/konsorten/go-windows-terminal-sequences -# github.com/kubedb/apimachinery v0.0.0-20190508221312-5ba915343400 +# github.com/kubedb/apimachinery v0.0.0-20190526014453-48e4bab67179 github.com/kubedb/apimachinery/apis/kubedb/v1alpha1 github.com/kubedb/apimachinery/client/clientset/versioned/scheme github.com/kubedb/apimachinery/client/clientset/versioned/typed/kubedb/v1alpha1 @@ -159,9 +159,9 @@ github.com/pkg/errors github.com/russross/blackfriday # github.com/sergi/go-diff v1.0.0 github.com/sergi/go-diff/diffmatchpatch -# github.com/sirupsen/logrus v1.4.1 +# github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus -# github.com/spf13/cobra v0.0.3 +# github.com/spf13/cobra v0.0.4 github.com/spf13/cobra/doc github.com/spf13/cobra # github.com/spf13/pflag v1.0.3 @@ -420,13 +420,13 @@ k8s.io/client-go/util/exec k8s.io/cloud-provider/features # k8s.io/component-base v0.0.0-20190424053038-9fe063da3132 => k8s.io/component-base v0.0.0-20190314000054-4a91899592f4 k8s.io/component-base/cli/flag -# k8s.io/klog v0.3.0 => k8s.io/klog v0.3.0 +# k8s.io/klog v0.3.1 => k8s.io/klog v0.3.0 k8s.io/klog # k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503 => k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/util/proto/validation -# k8s.io/kubernetes v1.14.1 +# k8s.io/kubernetes v1.14.2 k8s.io/kubernetes/pkg/kubectl/cmd/util k8s.io/kubernetes/pkg/kubectl/cmd/util/editor k8s.io/kubernetes/pkg/kubectl/cmd/wait @@ -534,7 +534,7 @@ k8s.io/utils/integer k8s.io/utils/buffer k8s.io/utils/trace k8s.io/utils/pointer -# kmodules.xyz/client-go v0.0.0-20190508091620-0d215c04352f +# kmodules.xyz/client-go v0.0.0-20190524133821-9c8a87771aea kmodules.xyz/client-go/logs kmodules.xyz/client-go/tools/cli kmodules.xyz/client-go/meta