diff --git a/.ci/pipeline_definitions b/.ci/pipeline_definitions index 3452f2ac7..a5aa30e91 100644 --- a/.ci/pipeline_definitions +++ b/.ci/pipeline_definitions @@ -45,7 +45,6 @@ etcd-druid: nextversion: 'bump_minor' git_tags: - ref_template: 'refs/tags/{VERSION}' - - ref_template: 'refs/tags/api/{VERSION}' slack: default_channel: 'internal_scp_workspace' channel_cfgs: diff --git a/.ci/test b/.ci/test index 8bcda5ca7..d8c859895 100755 --- a/.ci/test +++ b/.ci/test @@ -159,7 +159,7 @@ function test_with_coverage() { fetch_envtest_tools "$kb_root_dir" setup_envtest_env "$kb_root_dir" -TEST_PACKAGES="api api_tests controllers pkg" +TEST_PACKAGES="api controllers pkg" GINKGO_COMMON_FLAGS="-r -timeout=1h0m0s --randomizeAllSpecs --randomizeSuites --failOnPending --progress" if [ -z $COVER ] || [ "$COVER" = false ] ; then echo "[INFO] Test coverage is disabled." diff --git a/Makefile b/Makefile index 61c920b0b..083966478 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,6 @@ CRD_OPTIONS ?= "crd:trivialVersions=true" .PHONY: revendor revendor: - @cd "$(REPO_ROOT)/api" && go mod tidy @env GO111MODULE=on go mod vendor @env GO111MODULE=on go mod tidy @chmod +x "$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/"* @@ -65,7 +64,7 @@ deploy: manifests # Generate manifests e.g. CRD, RBAC etc. .PHONY: manifests manifests: - @cd "$(REPO_ROOT)/api" && controller-gen $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=../config/crd/bases + @controller-gen $(CRD_OPTIONS) paths="./api/..." output:crd:artifacts:config="./config/crd/bases" @controller-gen rbac:roleName=manager-role paths="./controllers/..." # Run go fmt against code @@ -80,8 +79,7 @@ clean: # Check packages .PHONY: check check: - @cd "$(REPO_ROOT)/api" && "$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh" --golangci-lint-config=../.golangci.yaml ./... - @"$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh" --golangci-lint-config=./.golangci.yaml ./pkg/... ./controllers/... + @"$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh" --golangci-lint-config=./.golangci.yaml ./api/... ./pkg/... ./controllers/... .PHONY: check-generate check-generate: diff --git a/api/go.mod b/api/go.mod deleted file mode 100644 index 8d47e14fa..000000000 --- a/api/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/gardener/etcd-druid/api - -go 1.15 - -require ( - gopkg.in/yaml.v2 v2.3.0 // indirect - k8s.io/api v0.19.6 - k8s.io/apimachinery v0.19.6 -) diff --git a/api/go.sum b/api/go.sum deleted file mode 100644 index d59624cc4..000000000 --- a/api/go.sum +++ /dev/null @@ -1,173 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/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-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.19.6 h1:F3lfwgpKcKms6F1mMqkQXFzXmme8QqHTJBtBkev3TOg= -k8s.io/api v0.19.6/go.mod h1:Plxx44Nh4zVblkJrIgxVPgPre1mvng6tXf1Sj3bs0fU= -k8s.io/apimachinery v0.19.6 h1:kBLzSGuDdY1NdSV2uFzI+FwZ9wtkmG+X3ZVcWXSqNgA= -k8s.io/apimachinery v0.19.6/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/api_tests/v1alpha1/etcd_types_test.go b/api/v1alpha1/etcd_types_test.go similarity index 86% rename from api_tests/v1alpha1/etcd_types_test.go rename to api/v1alpha1/etcd_types_test.go index 2ac37a0cd..8d26e6de7 100644 --- a/api_tests/v1alpha1/etcd_types_test.go +++ b/api/v1alpha1/etcd_types_test.go @@ -14,22 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1alpha1_test import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "context" "time" - druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/api/resource" - - corev1 "k8s.io/api/core/v1" + . "github.com/gardener/etcd-druid/api/v1alpha1" ) // These tests are written in BDD-style using Ginkgo framework. Refer to @@ -38,7 +36,7 @@ import ( var _ = Describe("Etcd", func() { var ( key types.NamespacedName - created, fetched *druidv1alpha1.Etcd + created, fetched *Etcd ) BeforeEach(func() { @@ -66,7 +64,7 @@ var _ = Describe("Etcd", func() { By("creating an API obj") Expect(k8sClient.Create(context.TODO(), created)).To(Succeed()) - fetched = &druidv1alpha1.Etcd{} + fetched = &Etcd{} Expect(k8sClient.Get(context.TODO(), key, fetched)).To(Succeed()) Expect(fetched).To(Equal(created)) @@ -79,12 +77,12 @@ var _ = Describe("Etcd", func() { }) -func getEtcd(name, namespace string) *druidv1alpha1.Etcd { +func getEtcd(name, namespace string) *Etcd { var ( - clientPort int32 = 2379 - serverPort int32 = 2380 - backupPort int32 = 8080 - metricLevel druidv1alpha1.MetricsLevel = druidv1alpha1.Basic + clientPort int32 = 2379 + serverPort int32 = 2380 + backupPort int32 = 8080 + metricLevel MetricsLevel = Basic ) garbageCollectionPeriod := metav1.Duration{ @@ -102,11 +100,11 @@ func getEtcd(name, namespace string) *druidv1alpha1.Etcd { deltaSnapShotMemLimit := resource.MustParse("100Mi") quota := resource.MustParse("8Gi") storageClass := "gardener.cloud-fast" - provider := druidv1alpha1.StorageProvider("aws") + provider := StorageProvider("aws") prefix := "etcd-test" - garbageCollectionPolicy := druidv1alpha1.GarbageCollectionPolicy(druidv1alpha1.GarbageCollectionPolicyExponential) + garbageCollectionPolicy := GarbageCollectionPolicy(GarbageCollectionPolicyExponential) - tlsConfig := &druidv1alpha1.TLSConfig{ + tlsConfig := &TLSConfig{ ClientTLSSecretRef: corev1.SecretReference{ Name: "etcd-client-tls", }, @@ -118,12 +116,12 @@ func getEtcd(name, namespace string) *druidv1alpha1.Etcd { }, } - instance := &druidv1alpha1.Etcd{ + instance := &Etcd{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, }, - Spec: druidv1alpha1.EtcdSpec{ + Spec: EtcdSpec{ Annotations: map[string]string{ "app": "etcd-statefulset", "role": "test", @@ -143,7 +141,7 @@ func getEtcd(name, namespace string) *druidv1alpha1.Etcd { StorageClass: &storageClass, StorageCapacity: &storageCapacity, - Backup: druidv1alpha1.BackupSpec{ + Backup: BackupSpec{ Image: &imageBR, Port: &backupPort, FullSnapshotSchedule: &snapshotSchedule, @@ -162,7 +160,7 @@ func getEtcd(name, namespace string) *druidv1alpha1.Etcd { "memory": parseQuantity("128Mi"), }, }, - Store: &druidv1alpha1.StoreSpec{ + Store: &StoreSpec{ SecretRef: &corev1.SecretReference{ Name: "etcd-backup", }, @@ -171,7 +169,7 @@ func getEtcd(name, namespace string) *druidv1alpha1.Etcd { Prefix: prefix, }, }, - Etcd: druidv1alpha1.EtcdConfig{ + Etcd: EtcdConfig{ Quota: "a, Metrics: &metricLevel, Image: &imageEtcd, diff --git a/api_tests/v1alpha1/suite_test.go b/api/v1alpha1/suite_test.go similarity index 93% rename from api_tests/v1alpha1/suite_test.go rename to api/v1alpha1/suite_test.go index d468f4012..fa9027eae 100644 --- a/api_tests/v1alpha1/suite_test.go +++ b/api/v1alpha1/suite_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1alpha1_test import ( "path/filepath" @@ -22,9 +22,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - - druidv1alpha1 "github.com/gardener/etcd-druid/api/v1alpha1" - "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" @@ -32,6 +29,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" + + . "github.com/gardener/etcd-druid/api/v1alpha1" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to @@ -59,7 +58,7 @@ var _ = BeforeSuite(func(done Done) { CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, } - err := druidv1alpha1.SchemeBuilder.AddToScheme(scheme.Scheme) + err := SchemeBuilder.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) cfg, err = testEnv.Start() diff --git a/api_tests/validation/etcd_test.go b/api/validation/etcd_test.go similarity index 100% rename from api_tests/validation/etcd_test.go rename to api/validation/etcd_test.go diff --git a/api_tests/validation/validation_suite_test.go b/api/validation/validation_suite_test.go similarity index 100% rename from api_tests/validation/validation_suite_test.go rename to api/validation/validation_suite_test.go diff --git a/config/crd/bases/druid.gardener.cloud_etcds.yaml b/config/crd/bases/druid.gardener.cloud_etcds.yaml index 604f9a49f..35b02cc94 100644 --- a/config/crd/bases/druid.gardener.cloud_etcds.yaml +++ b/config/crd/bases/druid.gardener.cloud_etcds.yaml @@ -49,9 +49,6 @@ spec: backupCompactionSchedule: description: BackupCompactionSchedule defines the cron standard for compacting the snapstore type: string - etcdSnapshotTimeout: - description: EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation - type: string compression: description: SnapshotCompression defines the specification for compression of Snapshots. properties: @@ -78,6 +75,9 @@ spec: enableProfiling: description: EnableProfiling defines if profiling should be enabled for the etcd-backup-restore-sidecar type: boolean + etcdSnapshotTimeout: + description: EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation + type: string fullSnapshotSchedule: description: FullSnapshotSchedule defines the cron standard schedule for full snapshots. type: string diff --git a/go.mod b/go.mod index 4d7edf250..c12b8d2bc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/gardener/etcd-druid go 1.16 require ( - github.com/gardener/etcd-druid/api v0.0.0-00010101000000-000000000000 github.com/gardener/gardener v1.23.0 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v0.3.0 @@ -20,7 +19,6 @@ require ( ) replace ( - github.com/gardener/etcd-druid/api => ./api k8s.io/api => k8s.io/api v0.19.6 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.6 k8s.io/apimachinery => k8s.io/apimachinery v0.19.6 diff --git a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/etcd_types.go b/vendor/github.com/gardener/etcd-druid/api/v1alpha1/etcd_types.go deleted file mode 100644 index 12a44e874..000000000 --- a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/etcd_types.go +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // GarbageCollectionPolicyExponential defines the exponential policy for garbage collecting old backups - GarbageCollectionPolicyExponential = "Exponential" - // GarbageCollectionPolicyLimitBased defines the limit based policy for garbage collecting old backups - GarbageCollectionPolicyLimitBased = "LimitBased" - - // Basic is a constant for metrics level basic. - Basic MetricsLevel = "basic" - // Extensive is a constant for metrics level extensive. - Extensive MetricsLevel = "extensive" - - // GzipCompression is constant for gzip compression policy. - GzipCompression CompressionPolicy = "gzip" - // LzwCompression is constant for lzw compression policy. - LzwCompression CompressionPolicy = "lzw" - // ZlibCompression is constant for zlib compression policy. - ZlibCompression CompressionPolicy = "zlib" - - // DefaultCompression is constant for default compression policy(only if compression is enabled). - DefaultCompression CompressionPolicy = GzipCompression - // DefaultCompressionEnabled is constant to define whether to compress the snapshots or not. - DefaultCompressionEnabled = false - - // Periodic is a constant to set auto-compaction-mode 'periodic' for duration based retention. - Periodic CompactionMode = "periodic" - // Revision is a constant to set auto-compaction-mode 'revision' for revision number based retention. - Revision CompactionMode = "revision" -) - -// MetricsLevel defines the level 'basic' or 'extensive'. -// +kubebuilder:validation:Enum=basic;extensive -type MetricsLevel string - -// GarbageCollectionPolicy defines the type of policy for snapshot garbage collection. -// +kubebuilder:validation:Enum=Exponential;LimitBased -type GarbageCollectionPolicy string - -// StorageProvider defines the type of object store provider for storing backups. -type StorageProvider string - -// CompressionPolicy defines the type of policy for compression of snapshots. -// +kubebuilder:validation:Enum=gzip;lzw;zlib -type CompressionPolicy string - -// CompactionMode defines the auto-compaction-mode: 'periodic' or 'revision'. -// 'periodic' for duration based retention and 'revision' for revision number based retention. -// +kubebuilder:validation:Enum=periodic;revision -type CompactionMode string - -// StoreSpec defines parameters related to ObjectStore persisting backups -type StoreSpec struct { - // Container is the name of the container the backup is stored at. - // +optional - Container *string `json:"container,omitempty"` - // Prefix is the prefix used for the store. - // +required - Prefix string `json:"prefix"` - // Provider is the name of the backup provider. - // +optional - Provider *StorageProvider `json:"provider,omitempty"` - // SecretRef is the reference to the secret which used to connect to the backup store. - // +optional - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` -} - -// TLSConfig hold the TLS configuration details. -type TLSConfig struct { - // +required - ServerTLSSecretRef corev1.SecretReference `json:"serverTLSSecretRef"` - // +required - ClientTLSSecretRef corev1.SecretReference `json:"clientTLSSecretRef"` - // +required - TLSCASecretRef corev1.SecretReference `json:"tlsCASecretRef"` -} - -// CompressionSpec defines parameters related to compression of Snapshots(full as well as delta). -type CompressionSpec struct { - // +optional - Enabled bool `json:"enabled,omitempty"` - // +optional - Policy *CompressionPolicy `json:"policy,omitempty"` -} - -// BackupSpec defines parametes associated with the full and delta snapshots of etcd -type BackupSpec struct { - // Port define the port on which etcd-backup-restore server will exposed. - // +optional - Port *int32 `json:"port,omitempty"` - // +optional - TLS *TLSConfig `json:"tls,omitempty"` - // Image defines the etcd container image and tag - // +optional - Image *string `json:"image,omitempty"` - // Store defines the specification of object store provider for storing backups. - // +optional - Store *StoreSpec `json:"store,omitempty"` - // Resources defines the compute Resources required by backup-restore container. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - Resources *corev1.ResourceRequirements `json:"resources,omitempty"` - // FullSnapshotSchedule defines the cron standard schedule for full snapshots. - // +optional - FullSnapshotSchedule *string `json:"fullSnapshotSchedule,omitempty"` - // GarbageCollectionPolicy defines the policy for garbage collecting old backups - // +optional - GarbageCollectionPolicy *GarbageCollectionPolicy `json:"garbageCollectionPolicy,omitempty"` - // GarbageCollectionPeriod defines the period for garbage collecting old backups - // +optional - GarbageCollectionPeriod *metav1.Duration `json:"garbageCollectionPeriod,omitempty"` - // DeltaSnapshotPeriod defines the period after which delta snapshots will be taken - // +optional - DeltaSnapshotPeriod *metav1.Duration `json:"deltaSnapshotPeriod,omitempty"` - // DeltaSnapshotMemoryLimit defines the memory limit after which delta snapshots will be taken - // +optional - DeltaSnapshotMemoryLimit *resource.Quantity `json:"deltaSnapshotMemoryLimit,omitempty"` - // SnapshotCompression defines the specification for compression of Snapshots. - // +optional - SnapshotCompression *CompressionSpec `json:"compression,omitempty"` - // EnableProfiling defines if profiling should be enabled for the etcd-backup-restore-sidecar - // +optional - EnableProfiling *bool `json:"enableProfiling,omitempty"` - // BackupCompactionSchedule defines the cron standard for compacting the snapstore - // +optional - BackupCompactionSchedule *string `json:"backupCompactionSchedule,omitempty"` - // EtcdSnapshotTimeout defines the timeout duration for etcd FullSnapshot operation - // +optional - EtcdSnapshotTimeout *metav1.Duration `json:"etcdSnapshotTimeout,omitempty"` -} - -// EtcdConfig defines parameters associated etcd deployed -type EtcdConfig struct { - // Quota defines the etcd DB quota. - // +optional - Quota *resource.Quantity `json:"quota,omitempty"` - // DefragmentationSchedule defines the cron standard schedule for defragmentation of etcd. - // +optional - DefragmentationSchedule *string `json:"defragmentationSchedule,omitempty"` - // +optional - ServerPort *int32 `json:"serverPort,omitempty"` - // +optional - ClientPort *int32 `json:"clientPort,omitempty"` - // Image defines the etcd container image and tag - // +optional - Image *string `json:"image,omitempty"` - // +optional - AuthSecretRef *corev1.SecretReference `json:"authSecretRef,omitempty"` - // Metrics defines the level of detail for exported metrics of etcd, specify 'extensive' to include histogram metrics. - // +optional - Metrics *MetricsLevel `json:"metrics,omitempty"` - // Resources defines the compute Resources required by etcd container. - // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - // +optional - Resources *corev1.ResourceRequirements `json:"resources,omitempty"` - // +optional - TLS *TLSConfig `json:"tls,omitempty"` - // EtcdDefragTimeout defines the timeout duration for etcd defrag call - // +optional - EtcdDefragTimeout *metav1.Duration `json:"etcdDefragTimeout,omitempty"` -} - -// SharedConfig defines parameters shared and used by Etcd as well as backup-restore sidecar. -type SharedConfig struct { - // AutoCompactionMode defines the auto-compaction-mode:'periodic' mode or 'revision' mode for etcd and embedded-Etcd of backup-restore sidecar. - // +optional - AutoCompactionMode *CompactionMode `json:"autoCompactionMode,omitempty"` - //AutoCompactionRetention defines the auto-compaction-retention length for etcd as well as for embedded-Etcd of backup-restore sidecar. - // +optional - AutoCompactionRetention *string `json:"autoCompactionRetention,omitempty"` -} - -// EtcdSpec defines the desired state of Etcd -type EtcdSpec struct { - // selector is a label query over pods that should match the replica count. - // It must match the pod template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - Selector *metav1.LabelSelector `json:"selector"` - // +required - Labels map[string]string `json:"labels"` - // +optional - Annotations map[string]string `json:"annotations,omitempty"` - // +required - Etcd EtcdConfig `json:"etcd"` - // +required - Backup BackupSpec `json:"backup"` - // +optional - Common SharedConfig `json:"sharedConfig,omitempty"` - // +required - Replicas int `json:"replicas"` - // PriorityClassName is the name of a priority class that shall be used for the etcd pods. - // +optional - PriorityClassName *string `json:"priorityClassName,omitempty"` - // StorageClass defines the name of the StorageClass required by the claim. - // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - // +optional - StorageClass *string `json:"storageClass,omitempty"` - // StorageCapacity defines the size of persistent volume. - // +optional - StorageCapacity *resource.Quantity `json:"storageCapacity,omitempty"` - // VolumeClaimTemplate defines the volume claim template to be created - // +optional - VolumeClaimTemplate *string `json:"volumeClaimTemplate,omitempty"` -} - -// CrossVersionObjectReference contains enough information to let you identify the referred resource. -type CrossVersionObjectReference struct { - // Kind of the referent - // +required - Kind string `json:"kind,omitempty"` - // Name of the referent - // +required - Name string `json:"name,omitempty"` - // API version of the referent - // +optional - APIVersion string `json:"apiVersion,omitempty"` -} - -// ConditionStatus is the status of a condition. -type ConditionStatus string - -const ( - // ConditionTrue means a resource is in the condition. - ConditionTrue ConditionStatus = "True" - // ConditionFalse means a resource is not in the condition. - ConditionFalse ConditionStatus = "False" - // ConditionUnknown means Gardener can't decide if a resource is in the condition or not. - ConditionUnknown ConditionStatus = "Unknown" - // ConditionProgressing means the condition was seen true, failed but stayed within a predefined failure threshold. - // In the future, we could add other intermediate conditions, e.g. ConditionDegraded. - ConditionProgressing ConditionStatus = "Progressing" - // ConditionCheckError is a constant for a reason in condition. - ConditionCheckError = "ConditionCheckError" -) - -// ConditionType is the type of a condition. -type ConditionType string - -const ( - // ConditionTypeReady is a constant for a condition type indicating that the etcd cluster is ready. - ConditionTypeReady ConditionType = "Ready" - // ConditionTypeAllMembersReady is a constant for a condition type indicating that all members of the etcd cluster are ready. - ConditionTypeAllMembersReady ConditionType = "AllMembersReady" - // ConditionTypeBackupReady is a constant for a condition type indicating that the etcd backup is ready. - ConditionTypeBackupReady ConditionType = "BackupReady" -) - -// Condition holds the information about the state of a resource. -type Condition struct { - // Type of the Etcd condition. - Type ConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. - Status ConditionStatus `json:"status"` - // Last time the condition transitioned from one status to another. - LastTransitionTime metav1.Time `json:"lastTransitionTime"` - // Last time the condition was updated. - LastUpdateTime metav1.Time `json:"lastUpdateTime"` - // The reason for the condition's last transition. - Reason string `json:"reason"` - // A human readable message indicating details about the transition. - Message string `json:"message"` -} - -// EtcdMemberConditionStatus is the status of an etcd cluster member. -type EtcdMemberConditionStatus string - -const ( - // EtcdMemberStatusReady means a etcd member is ready. - EtcdMemberStatusReady EtcdMemberConditionStatus = "Ready" - // EtcdMemberStatusNotReady means a etcd member is not ready. - EtcdMemberStatusNotReady EtcdMemberConditionStatus = "NotReady" - // EtcdMemberStatusUnknown means the status of an etcd member is unkown. - EtcdMemberStatusUnknown EtcdMemberConditionStatus = "Unknown" -) - -// EtcdRole is the role of an etcd cluster member. -type EtcdRole string - -const ( - // EtcdRoleLeader describes the etcd role `Leader`. - EtcdRoleLeader EtcdRole = "Leader" - // EtcdRoleMember describes the etcd role `Member`. - EtcdRoleMember EtcdRole = "Member" -) - -// EtcdMemberStatus holds information about a etcd cluster membership. -type EtcdMemberStatus struct { - // Name is the name of the etcd member. It is the name of the backing `Pod`. - Name string `json:"name"` - // ID is the ID of the etcd member. - // +optional - ID *string `json:"id,omitempty"` - // Role is the role in the etcd cluster, either `Leader` or `Member`. - // +optional - Role *EtcdRole `json:"role,omitempty"` - // Status of the condition, one of True, False, Unknown. - Status EtcdMemberConditionStatus `json:"status"` - // The reason for the condition's last transition. - Reason string `json:"reason"` - // LastTransitionTime is the last time the condition's status changed. - LastTransitionTime metav1.Time `json:"lastTransitionTime"` -} - -// EtcdStatus defines the observed state of Etcd. -type EtcdStatus struct { - // ObservedGeneration is the most recent generation observed for this resource. - // +optional - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` - // +optional - Etcd *CrossVersionObjectReference `json:"etcd,omitempty"` - // Conditions represents the latest available observations of an etcd's current state. - // +optional - Conditions []Condition `json:"conditions,omitempty"` - // ServiceName is the name of the etcd service. - // +optional - ServiceName *string `json:"serviceName,omitempty"` - // LastError represents the last occurred error. - // +optional - LastError *string `json:"lastError,omitempty"` - // Cluster size is the size of the etcd cluster. - // +optional - ClusterSize *int32 `json:"clusterSize,omitempty"` - // CurrentReplicas is the current replica count for the etcd cluster. - // +optional - CurrentReplicas int32 `json:"currentReplicas,omitempty"` - // Replicas is the replica count of the etcd resource. - // +optional - Replicas int32 `json:"replicas,omitempty"` - // ReadyReplicas is the count of replicas being ready in the etcd cluster. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - // Ready represents the readiness of the etcd resource. - // +optional - Ready *bool `json:"ready,omitempty"` - // UpdatedReplicas is the count of updated replicas in the etcd cluster. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` - // LabelSelector is a label query over pods that should match the replica count. - // It must match the pod template's labels. - // +optional - LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"` - // Members represents the members of the etcd cluster - // +optional - Members []EtcdMemberStatus `json:"members,omitempty"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.ready` -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector - -// Etcd is the Schema for the etcds API -type Etcd struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec EtcdSpec `json:"spec,omitempty"` - Status EtcdStatus `json:"status,omitempty"` -} - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// +kubebuilder:object:root=true - -// EtcdList contains a list of Etcd -type EtcdList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Etcd `json:"items"` -} diff --git a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/groupversion_info.go b/vendor/github.com/gardener/etcd-druid/api/v1alpha1/groupversion_info.go deleted file mode 100644 index cb517fb7a..000000000 --- a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package v1alpha1 contains API Schema definitions for the druid v1alpha1 API group -// +kubebuilder:object:generate=true -// +groupName=druid.gardener.cloud -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// nolint:gochecknoglobals -var ( - localSchemeBuilder = &SchemeBuilder - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "druid.gardener.cloud", Version: "v1alpha1"} - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, - &Etcd{}, - &EtcdList{}, - ) - metav1.AddToGroupVersion(scheme, GroupVersion) - - return nil -} diff --git a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/etcd-druid/api/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 957e9b61d..000000000 --- a/vendor/github.com/gardener/etcd-druid/api/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,506 +0,0 @@ -// +build !ignore_autogenerated - -// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. -// -// 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 controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { - *out = *in - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(int32) - **out = **in - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = new(TLSConfig) - **out = **in - } - if in.Image != nil { - in, out := &in.Image, &out.Image - *out = new(string) - **out = **in - } - if in.Store != nil { - in, out := &in.Store, &out.Store - *out = new(StoreSpec) - (*in).DeepCopyInto(*out) - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = new(v1.ResourceRequirements) - (*in).DeepCopyInto(*out) - } - if in.FullSnapshotSchedule != nil { - in, out := &in.FullSnapshotSchedule, &out.FullSnapshotSchedule - *out = new(string) - **out = **in - } - if in.GarbageCollectionPolicy != nil { - in, out := &in.GarbageCollectionPolicy, &out.GarbageCollectionPolicy - *out = new(GarbageCollectionPolicy) - **out = **in - } - if in.GarbageCollectionPeriod != nil { - in, out := &in.GarbageCollectionPeriod, &out.GarbageCollectionPeriod - *out = new(metav1.Duration) - **out = **in - } - if in.DeltaSnapshotPeriod != nil { - in, out := &in.DeltaSnapshotPeriod, &out.DeltaSnapshotPeriod - *out = new(metav1.Duration) - **out = **in - } - if in.DeltaSnapshotMemoryLimit != nil { - in, out := &in.DeltaSnapshotMemoryLimit, &out.DeltaSnapshotMemoryLimit - x := (*in).DeepCopy() - *out = &x - } - if in.SnapshotCompression != nil { - in, out := &in.SnapshotCompression, &out.SnapshotCompression - *out = new(CompressionSpec) - (*in).DeepCopyInto(*out) - } - if in.EnableProfiling != nil { - in, out := &in.EnableProfiling, &out.EnableProfiling - *out = new(bool) - **out = **in - } - if in.BackupCompactionSchedule != nil { - in, out := &in.BackupCompactionSchedule, &out.BackupCompactionSchedule - *out = new(string) - **out = **in - } - if in.EtcdSnapshotTimeout != nil { - in, out := &in.EtcdSnapshotTimeout, &out.EtcdSnapshotTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec. -func (in *BackupSpec) DeepCopy() *BackupSpec { - if in == nil { - return nil - } - out := new(BackupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CompressionSpec) DeepCopyInto(out *CompressionSpec) { - *out = *in - if in.Policy != nil { - in, out := &in.Policy, &out.Policy - *out = new(CompressionPolicy) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompressionSpec. -func (in *CompressionSpec) DeepCopy() *CompressionSpec { - if in == nil { - return nil - } - out := new(CompressionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossVersionObjectReference. -func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference { - if in == nil { - return nil - } - out := new(CrossVersionObjectReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Etcd) DeepCopyInto(out *Etcd) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd. -func (in *Etcd) DeepCopy() *Etcd { - if in == nil { - return nil - } - out := new(Etcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Etcd) 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 *EtcdConfig) DeepCopyInto(out *EtcdConfig) { - *out = *in - if in.Quota != nil { - in, out := &in.Quota, &out.Quota - x := (*in).DeepCopy() - *out = &x - } - if in.DefragmentationSchedule != nil { - in, out := &in.DefragmentationSchedule, &out.DefragmentationSchedule - *out = new(string) - **out = **in - } - if in.ServerPort != nil { - in, out := &in.ServerPort, &out.ServerPort - *out = new(int32) - **out = **in - } - if in.ClientPort != nil { - in, out := &in.ClientPort, &out.ClientPort - *out = new(int32) - **out = **in - } - if in.Image != nil { - in, out := &in.Image, &out.Image - *out = new(string) - **out = **in - } - if in.AuthSecretRef != nil { - in, out := &in.AuthSecretRef, &out.AuthSecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.Metrics != nil { - in, out := &in.Metrics, &out.Metrics - *out = new(MetricsLevel) - **out = **in - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = new(v1.ResourceRequirements) - (*in).DeepCopyInto(*out) - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = new(TLSConfig) - **out = **in - } - if in.EtcdDefragTimeout != nil { - in, out := &in.EtcdDefragTimeout, &out.EtcdDefragTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdConfig. -func (in *EtcdConfig) DeepCopy() *EtcdConfig { - if in == nil { - return nil - } - out := new(EtcdConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdList) DeepCopyInto(out *EtcdList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Etcd, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdList. -func (in *EtcdList) DeepCopy() *EtcdList { - if in == nil { - return nil - } - out := new(EtcdList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *EtcdList) 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 *EtcdMemberStatus) DeepCopyInto(out *EtcdMemberStatus) { - *out = *in - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Role != nil { - in, out := &in.Role, &out.Role - *out = new(EtcdRole) - **out = **in - } - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdMemberStatus. -func (in *EtcdMemberStatus) DeepCopy() *EtcdMemberStatus { - if in == nil { - return nil - } - out := new(EtcdMemberStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdSpec) DeepCopyInto(out *EtcdSpec) { - *out = *in - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - in.Etcd.DeepCopyInto(&out.Etcd) - in.Backup.DeepCopyInto(&out.Backup) - in.Common.DeepCopyInto(&out.Common) - if in.PriorityClassName != nil { - in, out := &in.PriorityClassName, &out.PriorityClassName - *out = new(string) - **out = **in - } - if in.StorageClass != nil { - in, out := &in.StorageClass, &out.StorageClass - *out = new(string) - **out = **in - } - if in.StorageCapacity != nil { - in, out := &in.StorageCapacity, &out.StorageCapacity - x := (*in).DeepCopy() - *out = &x - } - if in.VolumeClaimTemplate != nil { - in, out := &in.VolumeClaimTemplate, &out.VolumeClaimTemplate - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdSpec. -func (in *EtcdSpec) DeepCopy() *EtcdSpec { - if in == nil { - return nil - } - out := new(EtcdSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *EtcdStatus) DeepCopyInto(out *EtcdStatus) { - *out = *in - if in.ObservedGeneration != nil { - in, out := &in.ObservedGeneration, &out.ObservedGeneration - *out = new(int64) - **out = **in - } - if in.Etcd != nil { - in, out := &in.Etcd, &out.Etcd - *out = new(CrossVersionObjectReference) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ServiceName != nil { - in, out := &in.ServiceName, &out.ServiceName - *out = new(string) - **out = **in - } - if in.LastError != nil { - in, out := &in.LastError, &out.LastError - *out = new(string) - **out = **in - } - if in.ClusterSize != nil { - in, out := &in.ClusterSize, &out.ClusterSize - *out = new(int32) - **out = **in - } - if in.Ready != nil { - in, out := &in.Ready, &out.Ready - *out = new(bool) - **out = **in - } - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.Members != nil { - in, out := &in.Members, &out.Members - *out = make([]EtcdMemberStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdStatus. -func (in *EtcdStatus) DeepCopy() *EtcdStatus { - if in == nil { - return nil - } - out := new(EtcdStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SharedConfig) DeepCopyInto(out *SharedConfig) { - *out = *in - if in.AutoCompactionMode != nil { - in, out := &in.AutoCompactionMode, &out.AutoCompactionMode - *out = new(CompactionMode) - **out = **in - } - if in.AutoCompactionRetention != nil { - in, out := &in.AutoCompactionRetention, &out.AutoCompactionRetention - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedConfig. -func (in *SharedConfig) DeepCopy() *SharedConfig { - if in == nil { - return nil - } - out := new(SharedConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StoreSpec) DeepCopyInto(out *StoreSpec) { - *out = *in - if in.Container != nil { - in, out := &in.Container, &out.Container - *out = new(string) - **out = **in - } - if in.Provider != nil { - in, out := &in.Provider, &out.Provider - *out = new(StorageProvider) - **out = **in - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreSpec. -func (in *StoreSpec) DeepCopy() *StoreSpec { - if in == nil { - return nil - } - out := new(StoreSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TLSConfig) DeepCopyInto(out *TLSConfig) { - *out = *in - out.ServerTLSSecretRef = in.ServerTLSSecretRef - out.ClientTLSSecretRef = in.ClientTLSSecretRef - out.TLSCASecretRef = in.TLSCASecretRef -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig. -func (in *TLSConfig) DeepCopy() *TLSConfig { - if in == nil { - return nil - } - out := new(TLSConfig) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/gardener/etcd-druid/api/validation/etcd.go b/vendor/github.com/gardener/etcd-druid/api/validation/etcd.go deleted file mode 100644 index d00b632af..000000000 --- a/vendor/github.com/gardener/etcd-druid/api/validation/etcd.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package validation - -import ( - "strings" - - "github.com/gardener/etcd-druid/api/v1alpha1" - - apiequality "k8s.io/apimachinery/pkg/api/equality" - apivalidation "k8s.io/apimachinery/pkg/api/validation" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -// ValidateEtcd validates Etcd object. -func ValidateEtcd(etcd *v1alpha1.Etcd) field.ErrorList { - var allErrs field.ErrorList - - allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&etcd.ObjectMeta, true, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))...) - allErrs = append(allErrs, ValidateEtcdSpec(etcd, field.NewPath("spec"))...) - - return allErrs -} - -// ValidateEtcdUpdate validates a Etcd object before an update. -func ValidateEtcdUpdate(new, old *v1alpha1.Etcd) field.ErrorList { - var allErrs field.ErrorList - - allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&new.ObjectMeta, &old.ObjectMeta, field.NewPath("metadata"))...) - allErrs = append(allErrs, ValidateEtcdSpecUpdate(&new.Spec, &old.Spec, new.DeletionTimestamp != nil, field.NewPath("spec"))...) - allErrs = append(allErrs, ValidateEtcd(new)...) - - return allErrs -} - -// ValidateEtcdSpec validates the specification of an Etd object. -func ValidateEtcdSpec(etcd *v1alpha1.Etcd, path *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if etcd.Spec.Backup.Store != nil { - prefix := etcd.Spec.Backup.Store.Prefix - allErrs = append(allErrs, validateBackupStorePrefix(prefix, etcd.Name, etcd.Namespace, path.Child("backup.store"))...) - } - - return allErrs -} - -// ValidateEtcdSpecUpdate validates the specification of an Etcd before an update. -func ValidateEtcdSpecUpdate(new, old *v1alpha1.EtcdSpec, deletionTimestampSet bool, path *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if deletionTimestampSet && !apiequality.Semantic.DeepEqual(new, old) { - allErrs = append(allErrs, apivalidation.ValidateImmutableField(new, old, path)...) - return allErrs - } - - if new.Backup.Store != nil && old.Backup.Store != nil { - allErrs = append(allErrs, apivalidation.ValidateImmutableField(new.Backup.Store.Prefix, old.Backup.Store.Prefix, path.Child("backup.store.prefix"))...) - } - - return allErrs -} - -func validateBackupStorePrefix(prefix, name, ns string, path *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if !(strings.Contains(prefix, ns) && strings.Contains(prefix, name)) { - allErrs = append(allErrs, field.Invalid(path.Child("prefix"), prefix, "field value must contain object name and namespace")) - } - - return allErrs -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5bb25d972..3b1ac9048 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -34,10 +34,6 @@ github.com/evanphx/json-patch github.com/fatih/color # github.com/fsnotify/fsnotify v1.4.9 github.com/fsnotify/fsnotify -# github.com/gardener/etcd-druid/api v0.0.0-00010101000000-000000000000 => ./api -## explicit -github.com/gardener/etcd-druid/api/v1alpha1 -github.com/gardener/etcd-druid/api/validation # github.com/gardener/external-dns-management v0.7.18 github.com/gardener/external-dns-management/pkg/apis/dns github.com/gardener/external-dns-management/pkg/apis/dns/v1alpha1 @@ -809,7 +805,6 @@ sigs.k8s.io/controller-tools/pkg/webhook sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml -# github.com/gardener/etcd-druid/api => ./api # k8s.io/api => k8s.io/api v0.19.6 # k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.19.6 # k8s.io/apimachinery => k8s.io/apimachinery v0.19.6