From 780ef2e942e85125b72c3c481a3fb3265a21197e Mon Sep 17 00:00:00 2001 From: Mateusz Szostok Date: Fri, 10 Jan 2020 15:29:38 +0100 Subject: [PATCH] Bump kubernetes dependecies and apply required fixes --- Gopkg.lock | 285 +++--- Gopkg.toml | 31 +- Makefile | 13 +- .../crd/addons-configuration.crd.yaml | 44 +- .../crd/cluster-addons-configuration.crd.yaml | 50 +- charts/helm-broker/templates/crds.yaml | 208 ----- charts/helm-broker/templates/rbac.yaml | 2 +- charts/helm-broker/values.yaml | 4 +- hack/ci/lib/utilities.sh | 2 +- hack/ci/run-chart-test.sh | 13 +- hack/run-dev-kind.sh | 20 +- internal/controller/addons_controller_test.go | 50 +- internal/controller/broker/broker_facade.go | 2 +- .../controller/broker/broker_facade_test.go | 2 +- internal/controller/broker/broker_syncer.go | 2 +- .../controller/broker/broker_syncer_test.go | 2 +- .../broker/cluster_broker_facade.go | 2 +- .../broker/cluster_broker_facade_test.go | 2 +- .../broker/cluster_broker_syncer.go | 2 +- .../broker/cluster_broker_syncer_test.go | 2 +- internal/controller/broker_controller.go | 12 +- internal/controller/broker_controller_test.go | 2 +- .../cluster_addons_controller_test.go | 2 +- .../controller/cluster_broker_controller.go | 4 +- .../cluster_broker_controller_test.go | 2 +- internal/controller/common_client.go | 4 +- internal/controller/docs/cluster_provider.go | 2 +- .../controller/docs/cluster_provider_test.go | 2 +- internal/controller/docs/provider.go | 2 +- internal/controller/docs/provider_test.go | 2 +- internal/controller/instance/facade.go | 10 +- internal/controller/instance/facade_test.go | 2 +- internal/controller/setup.go | 4 +- internal/model.go | 2 +- pkg/apis/addons/v1alpha1/common.go | 2 +- pkg/apis/addons/v1alpha1/types.go | 12 +- .../addons/v1alpha1/zz_generated.deepcopy.go | 6 +- pkg/apis/rafter/v1beta1/asset_common_types.go | 163 ---- pkg/apis/rafter/v1beta1/asset_types.go | 50 -- pkg/apis/rafter/v1beta1/assetgroup_common.go | 119 --- pkg/apis/rafter/v1beta1/assetgroup_types.go | 49 -- .../rafter/v1beta1/bucket_common_types.go | 104 --- pkg/apis/rafter/v1beta1/bucket_types.go | 50 -- pkg/apis/rafter/v1beta1/clusterasset_types.go | 51 -- .../rafter/v1beta1/clusterassetgroup_types.go | 50 -- .../rafter/v1beta1/clusterbucket_types.go | 51 -- pkg/apis/rafter/v1beta1/groupversion_info.go | 24 - .../rafter/v1beta1/zz_generated.deepcopy.go | 814 ------------------ pkg/client/clientset/versioned/clientset.go | 17 +- pkg/client/clientset/versioned/doc.go | 2 +- .../versioned/fake/clientset_generated.go | 14 +- pkg/client/clientset/versioned/fake/doc.go | 2 +- .../clientset/versioned/fake/register.go | 2 +- pkg/client/clientset/versioned/scheme/doc.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- .../typed/addons/v1alpha1/addons_client.go | 5 +- .../addons/v1alpha1/addonsconfiguration.go | 19 +- .../v1alpha1/clusteraddonsconfiguration.go | 19 +- .../versioned/typed/addons/v1alpha1/doc.go | 2 +- .../typed/addons/v1alpha1/fake/doc.go | 2 +- .../v1alpha1/fake/fake_addons_client.go | 2 +- .../v1alpha1/fake/fake_addonsconfiguration.go | 4 +- .../fake/fake_clusteraddonsconfiguration.go | 4 +- .../addons/v1alpha1/generated_expansion.go | 2 +- .../externalversions/addons/interface.go | 2 +- .../addons/v1alpha1/addonsconfiguration.go | 2 +- .../v1alpha1/clusteraddonsconfiguration.go | 2 +- .../addons/v1alpha1/interface.go | 3 +- .../informers/externalversions/factory.go | 2 +- .../informers/externalversions/generic.go | 2 +- .../internalinterfaces/factory_interfaces.go | 4 +- .../addons/v1alpha1/addonsconfiguration.go | 2 +- .../v1alpha1/clusteraddonsconfiguration.go | 2 +- .../addons/v1alpha1/expansion_generated.go | 2 +- test/charts/helm_broker_test.go | 2 +- test/integration/suite_test.go | 8 +- 76 files changed, 461 insertions(+), 2007 deletions(-) rename config/crds/addonsconfiguration.yaml => charts/helm-broker/templates/crd/addons-configuration.crd.yaml (52%) rename config/crds/clusteraddonsconfiguration.yaml => charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml (51%) delete mode 100644 charts/helm-broker/templates/crds.yaml delete mode 100644 pkg/apis/rafter/v1beta1/asset_common_types.go delete mode 100644 pkg/apis/rafter/v1beta1/asset_types.go delete mode 100644 pkg/apis/rafter/v1beta1/assetgroup_common.go delete mode 100644 pkg/apis/rafter/v1beta1/assetgroup_types.go delete mode 100644 pkg/apis/rafter/v1beta1/bucket_common_types.go delete mode 100644 pkg/apis/rafter/v1beta1/bucket_types.go delete mode 100644 pkg/apis/rafter/v1beta1/clusterasset_types.go delete mode 100644 pkg/apis/rafter/v1beta1/clusterassetgroup_types.go delete mode 100644 pkg/apis/rafter/v1beta1/clusterbucket_types.go delete mode 100644 pkg/apis/rafter/v1beta1/groupversion_info.go delete mode 100644 pkg/apis/rafter/v1beta1/zz_generated.deepcopy.go diff --git a/Gopkg.lock b/Gopkg.lock index 60823e91..098e636f 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -103,14 +103,6 @@ revision = "41ac8693c5c10a92ea1ff5ac3a7f95646f6123b0" version = "v1.1.0" -[[projects]] - digest = "1:464aef731a5f82ded547c62e249a2e9ec59fbbc9ddab53cda7b9857852630a61" - name = "github.com/appscode/jsonpatch" - packages = ["."] - pruneopts = "UT" - revision = "7c0e3b262f30165a8ec3d0b4c6059fd92703bfb2" - version = "1.0.0" - [[projects]] digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709" name = "github.com/asaskevich/govalidator" @@ -359,6 +351,14 @@ revision = "026c730a0dcc5d11f93f1cf1cc65b01247ea7b6f" version = "v4.5.0" +[[projects]] + digest = "1:bde2a1ce1de28312f165a88926c12f4acd19dc4d7da96a445dfa5a29eae07a93" + name = "github.com/fatih/color" + packages = ["."] + pruneopts = "UT" + revision = "daf2830f2741ebb735b21709a520c5f37d642d85" + version = "v1.9.0" + [[projects]] digest = "1:af43bdaaf86655a2343f113e9b293bbc16b12099eaeb223982bbe4d4c22ba14d" name = "github.com/fatih/structs" @@ -383,14 +383,6 @@ revision = "9fb12b3b21c5415d16ac18dc5cd42c1cfdd40c4e" version = "v0.1.0" -[[projects]] - digest = "1:d81dfed1aa731d8e4a45d87154ec15ef18da2aa80fa9a2f95bec38577a244a99" - name = "github.com/go-logr/zapr" - packages = ["."] - pruneopts = "UT" - revision = "03f06a783fbb7dfaf3f629c7825480e43a7105e6" - version = "v0.1.1" - [[projects]] digest = "1:3199d542cd80a8505e4cd90bb6c7d0bca8a67948834239053c78f9e20b8caa5f" name = "github.com/go-openapi/jsonpointer" @@ -424,12 +416,12 @@ version = "v0.19.2" [[projects]] - digest = "1:d29ee5ef14a7e0253facd0bcebe6a69a7a4e02a67eb24d2aacd8ccb4a7cea6fc" - name = "github.com/gobuffalo/envy" + digest = "1:e748bfec95572a9d44308e48b8845888295c166303b8790a0dcccb367ddd9280" + name = "github.com/gobuffalo/flect" packages = ["."] pruneopts = "UT" - revision = "043cb4b8af871b49563291e32c66bb84378a60ac" - version = "v1.7.0" + revision = "89744b3e498c96c5566f5c86c032207ff49c3b96" + version = "v0.2.0" [[projects]] digest = "1:9ae31ce33b4bab257668963e844d98765b44160be4ee98cafc44637a213e530d" @@ -524,6 +516,20 @@ pruneopts = "UT" revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306" +[[projects]] + digest = "1:0aeda02073125667ac6c9df50c7921cb22c08a4accdc54589c697a7e76be65c2" + name = "github.com/google/go-cmp" + packages = [ + "cmp", + "cmp/internal/diff", + "cmp/internal/flags", + "cmp/internal/function", + "cmp/internal/value", + ] + pruneopts = "UT" + revision = "5a6f75716e1203a923a78c9efb94089d857df0f6" + version = "v0.4.0" + [[projects]] branch = "master" digest = "1:3ee90c0d94da31b442dde97c99635aaafec68d0b8a3c12ee2075c6bdabeec6bb" @@ -600,17 +606,6 @@ revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d" version = "v1.4.0" -[[projects]] - branch = "master" - digest = "1:5fc0e23b254a1bd7d8d2d42fa093ba33471d08f52fe04afd3713adabb5888dc3" - name = "github.com/gregjones/httpcache" - packages = [ - ".", - "diskcache", - ] - pruneopts = "UT" - revision = "901d90724c7919163f472a9812253fb26761123d" - [[projects]] digest = "1:1168584a5881d371e96cb0e66ef6db71d7cef0856cc7f311490bc856627f8328" name = "github.com/grpc-ecosystem/go-grpc-middleware" @@ -745,14 +740,6 @@ pruneopts = "UT" revision = "c2b33e84" -[[projects]] - digest = "1:ecd9aa82687cf31d1585d4ac61d0ba180e42e8a6182b85bd785fcca8dfeefc1b" - name = "github.com/joho/godotenv" - packages = ["."] - pruneopts = "UT" - revision = "23d116af351c84513e1946b527c88823e476be13" - version = "v1.3.0" - [[projects]] digest = "1:75ab90ae3f5d876167e60f493beadfe66f0ed861a710f283fb06c86437a09538" name = "github.com/jonboulle/clockwork" @@ -809,16 +796,16 @@ version = "v1.0.1" [[projects]] - digest = "1:9de6578e6595c79894a0803cca0b56ca76a55f25615f0dbd959c662aabe10075" - name = "github.com/kubernetes-incubator/service-catalog" + digest = "1:e942e1276619ff080d6932c160e3545a8d01425c97c1825d6a5cb64351b205bc" + name = "github.com/kubernetes-sigs/service-catalog" packages = [ "pkg/apis/servicecatalog", "pkg/apis/servicecatalog/v1beta1", "pkg/filter", ] pruneopts = "UT" - revision = "49e5cc4f90c6794d490eea4256061797223d9564" - version = "v0.1.42" + revision = "f950e6866b3dd192f7aef05336f6a20b9dce319f" + version = "v0.3.0-beta.2" [[projects]] digest = "1:3fd94c81ea1acc423bca554c0af861bca05bc602c2a8e9015c97b517041483d4" @@ -827,6 +814,13 @@ pruneopts = "UT" revision = "eed4ed1c60440b9118f4a97a96d52efdd5a3a336" +[[projects]] + digest = "1:6cc94db76fe3dfdcd62fff4eb247bd661a408b2df674a275f28666a70776033b" + name = "github.com/kyma-project/rafter" + packages = ["pkg/apis/rafter/v1beta1"] + pruneopts = "UT" + revision = "2756b8f673dea4b25b0ee0ae12b384704588f438" + [[projects]] branch = "master" digest = "1:927762c6729b4e72957ba3310e485ed09cf8451c5a637a52fd016a9fe09e7936" @@ -840,12 +834,20 @@ revision = "b2ccc519800e761ac8000b95e5d57c80a897ff9e" [[projects]] - digest = "1:3804a3a02964db8e6db3e5e7960ac1c1a9b12835642dd4f4ac4e56c749ec73eb" - name = "github.com/markbates/inflect" + digest = "1:4a29eeb25603debe8f2098a9902c4d3851034cf70d33be428826e86e8c30a1b0" + name = "github.com/mattn/go-colorable" + packages = ["."] + pruneopts = "UT" + revision = "98ec13f34aabf44cc914c65a1cfb7b9bc815aef1" + version = "v0.1.4" + +[[projects]] + digest = "1:29895093e370d9da5fd1c9ab12a5855ccb568f28766e0c3ff159c4b0f09aa127" + name = "github.com/mattn/go-isatty" packages = ["."] pruneopts = "UT" - revision = "24b83195037b3bc61fcda2d28b7b0518bce293b6" - version = "v1.0.4" + revision = "31745d66dd679ac0ac4f8d3ecff168fce6170c6a" + version = "v0.0.11" [[projects]] digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" @@ -1008,14 +1010,6 @@ pruneopts = "UT" revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" -[[projects]] - digest = "1:a8c2725121694dfbf6d552fb86fe6b46e3e7135ea05db580c28695b916162aad" - name = "github.com/peterbourgon/diskv" - packages = ["."] - pruneopts = "UT" - revision = "0be1b92a6df0e4f5cb0a5d15fb7f643d0ad93ce6" - version = "v3.0.0" - [[projects]] digest = "1:f690a0a27cefae695fa9587aa3ed23652e593be1d98b35f8184d10bccec30444" name = "github.com/pierrec/lz4" @@ -1104,18 +1098,6 @@ revision = "a1eba44eaecc89804e4b05ce2d17168eb353d524" version = "v1.0.0" -[[projects]] - digest = "1:e09ada96a5a41deda4748b1659cc8953961799e798aea557257b56baee4ecaf3" - name = "github.com/rogpeppe/go-internal" - packages = [ - "modfile", - "module", - "semver", - ] - pruneopts = "UT" - revision = "438578804ca6f31be148c27683afc419ce47c06e" - version = "v1.3.0" - [[projects]] digest = "1:69b1cc331fca23d702bd72f860c6a647afd0aa9fcbc1d0659b1365e26546dd70" name = "github.com/sirupsen/logrus" @@ -1132,17 +1114,6 @@ revision = "e09e9389d85d8492d313d73d1469c029e710623f" version = "v0.1.4" -[[projects]] - digest = "1:bb495ec276ab82d3dd08504bbc0594a65de8c3b22c6f2aaa92d05b73fbf3a82e" - name = "github.com/spf13/afero" - packages = [ - ".", - "mem", - ] - pruneopts = "UT" - revision = "588a75ec4f32903aa5e39a2619ba6a4631e28424" - version = "v1.2.2" - [[projects]] digest = "1:e096613fb7cf34743d49af87d197663cfccd61876e2219853005a57baedfa562" name = "github.com/spf13/cobra" @@ -1414,14 +1385,12 @@ revision = "85acf8d2951cb2a3bde7632f9ff273ef0379bcbd" [[projects]] - branch = "master" - digest = "1:13899577f16a312423dfb8734a50351fe128282f022ae4ffbcac1524db085e13" + digest = "1:45fc7687800448c3b1ae18371c3ff11e2ffa23f797c756463fa237bfdb234e08" name = "golang.org/x/tools" packages = [ "cmd/goimports", "go/ast/astutil", "go/gcexportdata", - "go/internal/cgo", "go/internal/gcimporter", "go/internal/packagesdriver", "go/packages", @@ -1429,10 +1398,32 @@ "imports", "internal/fastwalk", "internal/gopathwalk", + "internal/imports", + "internal/module", "internal/semver", ] pruneopts = "UT" - revision = "8a6051197512ff9cbf65108d80613b631fe0b4f3" + revision = "070c9d21b343a20c0bdefdce25202726f506f089" + version = "gopls/v0.2.2" + +[[projects]] + branch = "master" + digest = "1:918a46e4a2fb83df33f668f5a6bd51b2996775d073fce1800d3ec01b0a5ddd2b" + name = "golang.org/x/xerrors" + packages = [ + ".", + "internal", + ] + pruneopts = "UT" + revision = "9bdfabe68543c54f90421aeb9a60ef8061b5b544" + +[[projects]] + digest = "1:7d4fd782f2a710d08834b2c01742b3bba7fb0248383f9cc6c3dc95b3025689d7" + name = "gomodules.xyz/jsonpatch" + packages = ["v2"] + pruneopts = "UT" + revision = "e8422f09d27ee2c8cfb2c7f8089eb9eeb0764849" + version = "v2.0.1" [[projects]] digest = "1:a7e4acda410127f8e14d451bfb86bb843eec1a991c5e80f88926fe619296bed1" @@ -1569,11 +1560,19 @@ version = "v2.2.2" [[projects]] - digest = "1:684a27f12acc943bee24373b4e8f4acde803990add2fc5dde602c27b58207d3b" + branch = "v3" + digest = "1:3f3455f22627a44aab35023af8336ffc40df4d6180ef56bfceb7f51ecada3ef2" + name = "gopkg.in/yaml.v3" + packages = ["."] + pruneopts = "UT" + revision = "4206685974f28e3178b35fa198a59899aa4dee3a" + +[[projects]] + digest = "1:41a8785ce0732e00b09a1a95f23c826e2864e6f6b2a5d305f412687f4f936c76" name = "k8s.io/api" packages = [ "admission/v1beta1", - "admissionregistration/v1alpha1", + "admissionregistration/v1", "admissionregistration/v1beta1", "apps/v1", "apps/v1beta1", @@ -1590,15 +1589,21 @@ "batch/v1beta1", "batch/v2alpha1", "certificates/v1beta1", + "coordination/v1", "coordination/v1beta1", "core/v1", + "discovery/v1alpha1", "events/v1beta1", "extensions/v1beta1", "networking/v1", + "networking/v1beta1", + "node/v1alpha1", + "node/v1beta1", "policy/v1beta1", "rbac/v1", "rbac/v1alpha1", "rbac/v1beta1", + "scheduling/v1", "scheduling/v1alpha1", "scheduling/v1beta1", "settings/v1alpha1", @@ -1607,27 +1612,30 @@ "storage/v1beta1", ] pruneopts = "UT" - revision = "5cb15d34447165a97c76ed5a60e4e99c8a01ecfe" - version = "kubernetes-1.13.4" + revision = "2a24ef1ce092b529249c747df24d66a55fe97ad0" + version = "kubernetes-1.16.4" [[projects]] - digest = "1:db0e48e58e92eddc9ae08e9efb3dfaa1d61e32de690fff0dae5bccf4b45ebcce" + digest = "1:f0b431fe72d7510dfe7f3f177317391621ddb500843f5661dab7520d22735a66" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", + "pkg/apis/apiextensions/v1", "pkg/apis/apiextensions/v1beta1", "pkg/client/clientset/clientset", "pkg/client/clientset/clientset/scheme", + "pkg/client/clientset/clientset/typed/apiextensions/v1", "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", ] pruneopts = "UT" - revision = "d002e88f6236312f0289d9d1deab106751718ff0" - version = "kubernetes-1.13.4" + revision = "ea07e0496fdfc3befebe481bd6f850febc41cdae" + version = "v0.17.0" [[projects]] - digest = "1:624e30badeaacfc1631c6cd241d023df84a9db5c91bb0b7ad8cf9dcefd8b4016" + digest = "1:1fa9148e929c763423934073d6ebb11d8c6e0d3204d9b76dee9e13711cf2cf63" name = "k8s.io/apimachinery" packages = [ + "pkg/api/equality", "pkg/api/errors", "pkg/api/meta", "pkg/api/resource", @@ -1674,11 +1682,11 @@ "third_party/forked/golang/reflect", ] pruneopts = "UT" - revision = "86fb29eff6288413d76bd8506874fddd9fccdff0" - version = "kubernetes-1.13.4" + revision = "72ed19daf4bb788ae595ae4103c404cb0fa09c84" + version = "kubernetes-1.16.4" [[projects]] - digest = "1:a10b42dfe23745faaa448d1e3269dbf8f514a542b37e3d3bf703609ff423d10f" + digest = "1:8301af11de863595475e22e7f1a414c46359d9b30404482b4bcd35cbb2b94f4c" name = "k8s.io/client-go" packages = [ "discovery", @@ -1687,8 +1695,8 @@ "kubernetes", "kubernetes/fake", "kubernetes/scheme", - "kubernetes/typed/admissionregistration/v1alpha1", - "kubernetes/typed/admissionregistration/v1alpha1/fake", + "kubernetes/typed/admissionregistration/v1", + "kubernetes/typed/admissionregistration/v1/fake", "kubernetes/typed/admissionregistration/v1beta1", "kubernetes/typed/admissionregistration/v1beta1/fake", "kubernetes/typed/apps/v1", @@ -1721,16 +1729,26 @@ "kubernetes/typed/batch/v2alpha1/fake", "kubernetes/typed/certificates/v1beta1", "kubernetes/typed/certificates/v1beta1/fake", + "kubernetes/typed/coordination/v1", + "kubernetes/typed/coordination/v1/fake", "kubernetes/typed/coordination/v1beta1", "kubernetes/typed/coordination/v1beta1/fake", "kubernetes/typed/core/v1", "kubernetes/typed/core/v1/fake", + "kubernetes/typed/discovery/v1alpha1", + "kubernetes/typed/discovery/v1alpha1/fake", "kubernetes/typed/events/v1beta1", "kubernetes/typed/events/v1beta1/fake", "kubernetes/typed/extensions/v1beta1", "kubernetes/typed/extensions/v1beta1/fake", "kubernetes/typed/networking/v1", "kubernetes/typed/networking/v1/fake", + "kubernetes/typed/networking/v1beta1", + "kubernetes/typed/networking/v1beta1/fake", + "kubernetes/typed/node/v1alpha1", + "kubernetes/typed/node/v1alpha1/fake", + "kubernetes/typed/node/v1beta1", + "kubernetes/typed/node/v1beta1/fake", "kubernetes/typed/policy/v1beta1", "kubernetes/typed/policy/v1beta1/fake", "kubernetes/typed/rbac/v1", @@ -1739,6 +1757,8 @@ "kubernetes/typed/rbac/v1alpha1/fake", "kubernetes/typed/rbac/v1beta1", "kubernetes/typed/rbac/v1beta1/fake", + "kubernetes/typed/scheduling/v1", + "kubernetes/typed/scheduling/v1/fake", "kubernetes/typed/scheduling/v1alpha1", "kubernetes/typed/scheduling/v1alpha1/fake", "kubernetes/typed/scheduling/v1beta1", @@ -1777,24 +1797,24 @@ "tools/metrics", "tools/pager", "tools/record", + "tools/record/util", "tools/reference", "transport", - "util/buffer", "util/cert", "util/connrotation", "util/flowcontrol", "util/homedir", - "util/integer", "util/jsonpath", + "util/keyutil", "util/retry", "util/workqueue", ] pruneopts = "UT" - revision = "b40b2a5939e43f7ffe0028ad67586b7ce50bb675" - version = "kubernetes-1.13.4" + revision = "20ea64f01e4d4026bce06d61d697368390aeda4e" + version = "kubernetes-1.16.4" [[projects]] - digest = "1:7da092f0db865971167f1fff512029643e7b23a5afb415c032d6a9615efdc917" + digest = "1:c356f6621f6e5e5b980faa61dfaafb216639f6cc069b615b3cae1911778e724e" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -1819,12 +1839,12 @@ "cmd/lister-gen/args", "cmd/lister-gen/generators", "cmd/openapi-gen", - "cmd/openapi-gen/args", + "pkg/namer", "pkg/util", ] pruneopts = "UT" - revision = "3dcf91f64f638563e5106f21f50c31fa361c918d" - version = "kubernetes-1.12.3" + revision = "e95606b614f049ef6087115cb340d8d5805b8da7" + version = "kubernetes-1.17.0" [[projects]] branch = "master" @@ -1892,7 +1912,20 @@ revision = "d7c86cdc46e3a4fcf892b32dd7bc3aa775e0870e" [[projects]] - digest = "1:e06b8ce47dfcd74cf6c677eb98a10685429d9acf4f52542568f11500bd813640" + branch = "master" + digest = "1:bb09c1841fd8100fe09b784fa13563ebffd9921d18012e72c8727ce9d4ea0144" + name = "k8s.io/utils" + packages = [ + "buffer", + "integer", + "pointer", + "trace", + ] + pruneopts = "UT" + revision = "94aeca20bf0991bf33922a5938174b9147ab8ca7" + +[[projects]] + digest = "1:ee1fdeb12a7c045abf512dcd56edf586e089cc75796d5f25d5d1bf33256a482d" name = "sigs.k8s.io/controller-runtime" packages = [ "pkg/cache", @@ -1906,49 +1939,57 @@ "pkg/envtest/printer", "pkg/event", "pkg/handler", + "pkg/healthz", "pkg/internal/controller", "pkg/internal/controller/metrics", + "pkg/internal/log", "pkg/internal/objectutil", "pkg/internal/recorder", "pkg/leaderelection", + "pkg/log", "pkg/manager", + "pkg/manager/signals", "pkg/metrics", - "pkg/patch", "pkg/predicate", "pkg/reconcile", "pkg/recorder", "pkg/runtime/inject", - "pkg/runtime/log", "pkg/runtime/scheme", "pkg/runtime/signals", + "pkg/scheme", "pkg/source", "pkg/source/internal", + "pkg/webhook", "pkg/webhook/admission", - "pkg/webhook/admission/types", + "pkg/webhook/internal/certwatcher", "pkg/webhook/internal/metrics", - "pkg/webhook/types", ] pruneopts = "UT" - revision = "f1eaba5087d69cebb154c6a48193e6667f5b512c" - version = "v0.1.12" + revision = "198197fe0fd7553cadd8afcd3338f8ee4b8a7e3f" + version = "v0.4.0" [[projects]] - digest = "1:767ce3278b1fe82e3c713bc701b1ada60c8b9301213472c73f65a8955dec8980" + digest = "1:36f245ab86da0d7014dd72af986ec1d9957e814a97d4ea12c969c080c0f3c03a" name = "sigs.k8s.io/controller-tools" packages = [ "cmd/controller-gen", - "pkg/crd/generator", - "pkg/crd/util", - "pkg/internal/codegen", - "pkg/internal/codegen/parse", - "pkg/internal/general", + "pkg/crd", + "pkg/crd/markers", + "pkg/deepcopy", + "pkg/genall", + "pkg/genall/help", + "pkg/genall/help/pretty", + "pkg/loader", + "pkg/markers", "pkg/rbac", - "pkg/util", + "pkg/schemapatcher", + "pkg/schemapatcher/internal/yaml", + "pkg/version", "pkg/webhook", ] pruneopts = "UT" - revision = "464fbed97efaced33902e262f09c5eae7315c3e3" - version = "v0.1.11" + revision = "00e41399e96f29ac5a53e2dc91bb5526a1960300" + version = "v0.2.4" [[projects]] digest = "1:9070222ca967d09b3966552a161dd4420d62315964bf5e1efd8cc4c7c30ebca8" @@ -1994,8 +2035,9 @@ "github.com/hashicorp/go-getter/helper/url", "github.com/hashicorp/go-multierror", "github.com/imdario/mergo", - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1", + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1", "github.com/kyma-project/kyma/components/application-gateway/pkg/httpconsts", + "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1", "github.com/mcuadros/go-defaults", "github.com/meatballhat/negroni-logrus", "github.com/mholt/archiver", @@ -2070,13 +2112,14 @@ "sigs.k8s.io/controller-runtime/pkg/envtest", "sigs.k8s.io/controller-runtime/pkg/event", "sigs.k8s.io/controller-runtime/pkg/handler", + "sigs.k8s.io/controller-runtime/pkg/healthz", "sigs.k8s.io/controller-runtime/pkg/manager", "sigs.k8s.io/controller-runtime/pkg/predicate", "sigs.k8s.io/controller-runtime/pkg/reconcile", "sigs.k8s.io/controller-runtime/pkg/runtime/scheme", "sigs.k8s.io/controller-runtime/pkg/runtime/signals", "sigs.k8s.io/controller-runtime/pkg/source", - "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types", + "sigs.k8s.io/controller-runtime/pkg/webhook", "sigs.k8s.io/controller-tools/cmd/controller-gen", "sigs.k8s.io/testing_frameworks/integration", ] diff --git a/Gopkg.toml b/Gopkg.toml index 32e50a50..e6f99671 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -82,17 +82,22 @@ required= [ version = "2.8.2" [[constraint]] - name = "github.com/kubernetes-incubator/service-catalog" - version = "=v0.1.42" + name = "github.com/kubernetes-sigs/service-catalog" + version = "=v0.3.0-beta.2" [[constraint]] name="sigs.k8s.io/controller-runtime" - version = "=v0.1.12" + version = "=v0.4.0" [[constraint]] name = "github.com/kyma-project/kyma" revision = "eed4ed1c60440b9118f4a97a96d52efdd5a3a336" +# Does not have official release yet +[[constraint]] + name = "github.com/kyma-project/rafter" + revision = "2756b8f673dea4b25b0ee0ae12b384704588f438" + [[constraint]] name = "github.com/SpectoLabs/hoverfly" revision = "fc31737b316a35bd2a15da3e36c1baa325e87854" @@ -105,23 +110,33 @@ required= [ [[override]] name="sigs.k8s.io/controller-tools" - version="v0.1.1" + version="=v0.2.4" [[override]] name = "k8s.io/api" - version = "kubernetes-1.13.4" + version = "kubernetes-1.16.4" [[override]] name = "k8s.io/apimachinery" - version = "kubernetes-1.13.4" + version = "kubernetes-1.16.4" [[override]] name = "k8s.io/client-go" - version = "kubernetes-1.13.4" + version = "kubernetes-1.16.4" [[override]] name = "k8s.io/code-generator" - version = "kubernetes-1.12.3" + # Needs to be at least 1.17 to solve the issue with ignoring the `genclient:nonNamespaced` + # https://github.com/kubernetes/kubernetes/issues/80457 + version = "kubernetes-1.17.0" + +[[override]] + name="sigs.k8s.io/controller-runtime" + version = "=v0.4.0" + +[[override]] + name="golang.org/x/tools" + version = "gopls/v0.2.2" # For dependency below: Refer to issue https://github.com/golang/dep/issues/1799 [[override]] diff --git a/Makefile b/Makefile index eaea3c5a..71b8d426 100644 --- a/Makefile +++ b/Makefile @@ -32,17 +32,20 @@ else mkdir -p licenses endif -# Caution! Remove the “namespace: v.namespace” parameter after regeneration of -# “components/helm-broker/pkg/client/informers/externalversions/addons/v1alpha1/interface.go” file. -# clusterAddonsConfigurationInformer doesn’t have the “namespace” field .PHONY: generates # Generate CRD manifests, clients etc. generates: crd-manifests client .PHONY: crd-manifests # Generate CRD manifests -crd-manifests: - go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd --domain kyma-project.io +crd-manifests: get-yaml-editor + go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd paths=./pkg/apis/... output:crd:dir=charts/helm-broker/templates/crd + mv charts/helm-broker/templates/crd/addons.kyma-project.io_addonsconfigurations.yaml charts/helm-broker/templates/crd/addons-configuration.crd.yaml + mv charts/helm-broker/templates/crd/addons.kyma-project.io_clusteraddonsconfigurations.yaml charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml + $(YAML_EDITOR) d -i charts/helm-broker/templates/crd/addons-configuration.crd.yaml metadata.annotations + $(YAML_EDITOR) w -i charts/helm-broker/templates/crd/addons-configuration.crd.yaml metadata.annotations["helm.sh/hook"] "crd-install" + $(YAML_EDITOR) d -i charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml metadata.annotations + $(YAML_EDITOR) w -i charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml metadata.annotations["helm.sh/hook"] "crd-install" .PHONY: client client: diff --git a/config/crds/addonsconfiguration.yaml b/charts/helm-broker/templates/crd/addons-configuration.crd.yaml similarity index 52% rename from config/crds/addonsconfiguration.yaml rename to charts/helm-broker/templates/crd/addons-configuration.crd.yaml index 783b5dd2..e5423b2b 100644 --- a/config/crds/addonsconfiguration.yaml +++ b/charts/helm-broker/templates/crd/addons-configuration.crd.yaml @@ -2,9 +2,9 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" name: addonsconfigurations.addons.kyma-project.io + annotations: + helm.sh/hook: crd-install spec: group: addons.kyma-project.io names: @@ -12,33 +12,49 @@ spec: - all - addons kind: AddonsConfiguration + listKind: AddonsConfigurationList plural: addonsconfigurations + singular: addonsconfiguration scope: Namespaced subresources: status: {} validation: openAPIV3Schema: + description: AddonsConfiguration is the Schema for the addonsconfigurations + API properties: apiVersion: + 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/sig-architecture/api-conventions.md#resources' type: string kind: + 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/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: + description: AddonsConfigurationSpec defines the desired state of AddonsConfiguration properties: repositories: items: + description: SpecRepository define the addon repository properties: secretRef: - type: object - required: - - "name" + description: SecretReference represents a Secret Reference. It + has enough information to retrieve secret in any namespace properties: name: + description: Name is unique within a namespace to reference + a secret resource. type: string namespace: + description: Namespace defines the space within which the + secret name must be unique. type: string + type: object url: type: string required: @@ -46,12 +62,17 @@ spec: type: object type: array reprocessRequest: + description: 'ReprocessRequest is strictly increasing, non-negative + integer counter that can be incremented by a user to manually trigger + the reprocessing action of given CR. TODO: Use validation webhook + to block negative values, explanation: https://github.com/kubernetes/community/blob/db7f270f2d04b497767ebbc59c5aea595d67ea2c/contributors/devel/sig-architecture/api-conventions.md#primitive-types' format: int64 type: integer required: - repositories type: object status: + description: AddonsConfigurationStatus defines the observed state of AddonsConfiguration properties: lastProcessedTime: format: date-time @@ -60,12 +81,16 @@ spec: format: int64 type: integer phase: + description: AddonsConfigurationPhase defines the addons configuration + phase type: string repositories: items: + description: StatusRepository define the addon repository properties: addons: items: + description: Addon holds information about single addon properties: message: type: string @@ -74,6 +99,7 @@ spec: reason: type: string status: + description: AddonStatus define the addon status enum: - Ready - Failed @@ -90,18 +116,24 @@ spec: reason: type: string status: + description: RepositoryStatus define the repository status type: string url: type: string required: - - url - addons + - url type: object type: array required: - phase type: object + type: object version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true status: acceptedNames: kind: "" diff --git a/config/crds/clusteraddonsconfiguration.yaml b/charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml similarity index 51% rename from config/crds/clusteraddonsconfiguration.yaml rename to charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml index 1efd06ce..93b7af1f 100644 --- a/config/crds/clusteraddonsconfiguration.yaml +++ b/charts/helm-broker/templates/crd/cluster-addons-configuration.crd.yaml @@ -2,44 +2,57 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" name: clusteraddonsconfigurations.addons.kyma-project.io + annotations: + helm.sh/hook: crd-install spec: group: addons.kyma-project.io names: - categories: - - all - - addons kind: ClusterAddonsConfiguration + listKind: ClusterAddonsConfigurationList plural: clusteraddonsconfigurations + singular: clusteraddonsconfiguration scope: Cluster subresources: status: {} validation: openAPIV3Schema: + description: ClusterAddonsConfiguration is the Schema for the addonsconfigurations + API properties: apiVersion: + 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/sig-architecture/api-conventions.md#resources' type: string kind: + 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/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object spec: + description: ClusterAddonsConfigurationSpec defines the desired state of + ClusterAddonsConfiguration properties: repositories: items: + description: SpecRepository define the addon repository properties: secretRef: - type: object - required: - - "name" - - "namespace" + description: SecretReference represents a Secret Reference. It + has enough information to retrieve secret in any namespace properties: name: + description: Name is unique within a namespace to reference + a secret resource. type: string namespace: + description: Namespace defines the space within which the + secret name must be unique. type: string + type: object url: type: string required: @@ -47,12 +60,18 @@ spec: type: object type: array reprocessRequest: + description: 'ReprocessRequest is strictly increasing, non-negative + integer counter that can be incremented by a user to manually trigger + the reprocessing action of given CR. TODO: Use validation webhook + to block negative values, explanation: https://github.com/kubernetes/community/blob/db7f270f2d04b497767ebbc59c5aea595d67ea2c/contributors/devel/sig-architecture/api-conventions.md#primitive-types' format: int64 type: integer required: - repositories type: object status: + description: ClusterAddonsConfigurationStatus defines the observed state + of ClusterAddonsConfiguration properties: lastProcessedTime: format: date-time @@ -61,12 +80,16 @@ spec: format: int64 type: integer phase: + description: AddonsConfigurationPhase defines the addons configuration + phase type: string repositories: items: + description: StatusRepository define the addon repository properties: addons: items: + description: Addon holds information about single addon properties: message: type: string @@ -75,6 +98,7 @@ spec: reason: type: string status: + description: AddonStatus define the addon status enum: - Ready - Failed @@ -91,18 +115,24 @@ spec: reason: type: string status: + description: RepositoryStatus define the repository status type: string url: type: string required: - - url - addons + - url type: object type: array required: - phase type: object + type: object version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true status: acceptedNames: kind: "" diff --git a/charts/helm-broker/templates/crds.yaml b/charts/helm-broker/templates/crds.yaml deleted file mode 100644 index 4670b88e..00000000 --- a/charts/helm-broker/templates/crds.yaml +++ /dev/null @@ -1,208 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: addonsconfigurations.addons.kyma-project.io - annotations: - "helm.sh/hook": crd-install -spec: - group: addons.kyma-project.io - names: - categories: - - all - - addons - kind: AddonsConfiguration - plural: addonsconfigurations - scope: Namespaced - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - repositories: - items: - properties: - url: - type: string - required: - - url - type: object - type: array - reprocessRequest: - format: int64 - type: integer - required: - - repositories - type: object - status: - properties: - lastProcessedTime: - format: date-time - type: string - observedGeneration: - format: int64 - type: integer - phase: - type: string - repositories: - items: - properties: - addons: - items: - properties: - message: - type: string - name: - type: string - reason: - type: string - status: - enum: - - Ready - - Failed - type: string - version: - type: string - required: - - name - - version - type: object - type: array - message: - type: string - reason: - type: string - status: - type: string - url: - type: string - required: - - url - - addons - type: object - type: array - required: - - phase - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] - ---- -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - labels: - controller-tools.k8s.io: "1.0" - name: clusteraddonsconfigurations.addons.kyma-project.io - annotations: - "helm.sh/hook": crd-install -spec: - group: addons.kyma-project.io - names: - categories: - - all - - addons - kind: ClusterAddonsConfiguration - plural: clusteraddonsconfigurations - scope: Cluster - subresources: - status: {} - validation: - openAPIV3Schema: - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - spec: - properties: - repositories: - items: - properties: - url: - type: string - required: - - url - type: object - type: array - reprocessRequest: - format: int64 - type: integer - required: - - repositories - type: object - status: - properties: - lastProcessedTime: - format: date-time - type: string - observedGeneration: - format: int64 - type: integer - phase: - type: string - repositories: - items: - properties: - addons: - items: - properties: - message: - type: string - name: - type: string - reason: - type: string - status: - enum: - - Ready - - Failed - type: string - version: - type: string - required: - - name - - version - type: object - type: array - message: - type: string - reason: - type: string - status: - type: string - url: - type: string - required: - - url - - addons - type: object - type: array - required: - - phase - type: object - version: v1alpha1 -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/charts/helm-broker/templates/rbac.yaml b/charts/helm-broker/templates/rbac.yaml index 20eba348..0ebd4dea 100644 --- a/charts/helm-broker/templates/rbac.yaml +++ b/charts/helm-broker/templates/rbac.yaml @@ -18,7 +18,7 @@ rules: resources: ["servicebrokers", "clusterservicebrokers"] verbs: ["create","delete","list","get","update", "watch"] - apiGroups: ["servicecatalog.k8s.io"] - resources: ["serviceinstance", "serviceclass", "clusterserviceclass"] + resources: ["serviceinstances", "serviceclasses", "clusterserviceclasses"] verbs: ["list","get","update", "watch"] - apiGroups: ["rafter.kyma-project.io"] resources: ["clusterassetgroups", "assetgroups"] diff --git a/charts/helm-broker/values.yaml b/charts/helm-broker/values.yaml index 8b33144f..ca5fb1c7 100644 --- a/charts/helm-broker/values.yaml +++ b/charts/helm-broker/values.yaml @@ -13,11 +13,11 @@ global: helm_broker: image: helm-broker dir: /pr - version: PR-71 + version: PR-80 helm_controller: image: helm-controller dir: /pr - version: PR-71 + version: PR-80 # helm broker service parameters service: type: NodePort diff --git a/hack/ci/lib/utilities.sh b/hack/ci/lib/utilities.sh index be375c35..1c0e1fdc 100644 --- a/hack/ci/lib/utilities.sh +++ b/hack/ci/lib/utilities.sh @@ -55,7 +55,7 @@ function start_docker() { # - KIND_VERSION # - INSTALL_DIR # -# usage: env INSTALL_DIR=/tmp KIND_VERSION=v0.4.0 install::local::kind +# usage: env INSTALL_DIR=/tmp KIND_VERSION=v0.4.0 install::kind install::kind() { mkdir -p "${INSTALL_DIR}/bin" export PATH="${INSTALL_DIR}/bin:${PATH}" diff --git a/hack/ci/run-chart-test.sh b/hack/ci/run-chart-test.sh index 62ca1cab..f9cff496 100755 --- a/hack/ci/run-chart-test.sh +++ b/hack/ci/run-chart-test.sh @@ -6,6 +6,9 @@ set -o pipefail readonly TMP_DIR=$(mktemp -d) +readonly SC_RELEASE_NAMESPACE="catalog" +readonly SC_RELEASE_NAME="catalog" + readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) readonly LOCAL_REPO_ROOT_DIR=$( cd ${CURRENT_DIR}/../../ && pwd ) readonly CONTAINER_REPO_ROOT_DIR="/workdir" @@ -68,6 +71,14 @@ install::tiller() { docker_ct_exec helm init --service-account tiller --upgrade --wait } +# Installs service catalog on cluster. +install::service_catalog() { + shout "- Provisioning Service Catalog chart in ${SC_RELEASE_NAMESPACE} namespace..." + + docker_ct_exec helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com + docker_ct_exec helm install svc-cat/catalog --name "${SC_RELEASE_NAME}" --namespace "${SC_RELEASE_NAMESPACE}" --wait +} + install_local-path-provisioner() { # kind doesn't support Dynamic PVC provisioning yet https://github.com/kubernetes-sigs/kind/issues/118, # this is one ways to get it working @@ -106,8 +117,8 @@ main() { setup_kubectl_in_ct_container install_local-path-provisioner install::tiller + install::service_catalog - docker_ct_exec kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/service-catalog/master/charts/catalog/templates/crds/clusterservicebroker.yaml chart::lint chart::install_and_test } diff --git a/hack/run-dev-kind.sh b/hack/run-dev-kind.sh index 66565c43..e8c2d86e 100755 --- a/hack/run-dev-kind.sh +++ b/hack/run-dev-kind.sh @@ -5,8 +5,9 @@ set -o errexit readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) readonly REPO_ROOT_DIR=$( cd ${CURRENT_DIR}/../ && pwd ) -readonly SC_NAMESPACE="catalog" -readonly SC_CHART_NAME="catalog" +readonly SC_RELEASE_NAMESPACE="catalog" +readonly SC_RELEASE_NAME="catalog" + readonly HB_NAMESPACE="helm-broker" readonly HB_CHART_NAME="helm-broker" @@ -68,19 +69,20 @@ tiller::assert_tiller_is_up() { done } -install::service_catalog() { - shout '- Provisioning Service Catalog chart...' - - helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com - helm install svc-cat/catalog --name ${SC_CHART_NAME} --namespace ${SC_NAMESPACE} --wait -} - install::helm_broker() { shout '- Provisioning Helm Broker chart...' helm install ${REPO_ROOT_DIR}/charts/helm-broker --name ${HB_CHART_NAME} --namespace ${HB_NAMESPACE} --wait } +# Installs service catalog on cluster. +install::service_catalog() { + shout "- Provisioning Service Catalog chart in ${SC_RELEASE_NAMESPACE} namespace..." + + helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com + helm install svc-cat/catalog --name "${SC_RELEASE_NAME}" --namespace "${SC_RELEASE_NAMESPACE}" --wait +} + main() { # check if docker is running; docker ps -q should only work if the daemon is ready docker ps -q > /dev/null diff --git a/internal/controller/addons_controller_test.go b/internal/controller/addons_controller_test.go index 7250a356..84b4648e 100644 --- a/internal/controller/addons_controller_test.go +++ b/internal/controller/addons_controller_test.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "github.com/Masterminds/semver" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal" "github.com/kyma-project/helm-broker/internal/controller/automock" "github.com/kyma-project/helm-broker/internal/controller/repository" @@ -18,7 +16,10 @@ import ( "github.com/kyma-project/helm-broker/internal/storage" "github.com/kyma-project/helm-broker/pkg/apis" "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" - rafter "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + + "github.com/Masterminds/semver" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" + rafter "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" @@ -32,9 +33,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" + "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - runtimeTypes "sigs.k8s.io/controller-runtime/pkg/webhook/admission/types" + "sigs.k8s.io/controller-runtime/pkg/webhook" ) func TestReconcileAddonsConfiguration_AddAddonsProcess(t *testing.T) { @@ -461,12 +463,6 @@ func getTestSuite(t *testing.T, objects ...runtime.Object) *testSuite { return ts } -type fakeManager struct { - t *testing.T - client client.Client - sch *runtime.Scheme -} - func (ts *testSuite) assertExpectations() { ts.addonGetter.AssertExpectations(ts.t) ts.brokerFacade.AssertExpectations(ts.t) @@ -475,6 +471,32 @@ func (ts *testSuite) assertExpectations() { ts.addonGetterFactory.AssertExpectations(ts.t) } +type fakeManager struct { + t *testing.T + client client.Client + sch *runtime.Scheme +} + +func (f fakeManager) AddHealthzCheck(name string, check healthz.Checker) error { + return nil +} + +func (f fakeManager) AddReadyzCheck(name string, check healthz.Checker) error { + return nil +} + +func (f fakeManager) GetEventRecorderFor(name string) record.EventRecorder { + return nil +} + +func (f fakeManager) GetAPIReader() client.Reader { + return nil +} + +func (f fakeManager) GetWebhookServer() *webhook.Server { + return nil +} + func (fakeManager) Add(manager.Runnable) error { return nil } @@ -496,10 +518,6 @@ func (f *fakeManager) GetScheme() *runtime.Scheme { return f.sch } -func (fakeManager) GetAdmissionDecoder() runtimeTypes.Decoder { - return nil -} - func (f *fakeManager) GetClient() client.Client { return f.client } @@ -512,10 +530,6 @@ func (fakeManager) GetCache() cache.Cache { return nil } -func (fakeManager) GetRecorder(name string) record.EventRecorder { - return nil -} - func (fakeManager) GetRESTMapper() meta.RESTMapper { return nil } diff --git a/internal/controller/broker/broker_facade.go b/internal/controller/broker/broker_facade.go index 67d62180..85cfda42 100644 --- a/internal/controller/broker/broker_facade.go +++ b/internal/controller/broker/broker_facade.go @@ -6,7 +6,7 @@ import ( "context" multierror "github.com/hashicorp/go-multierror" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/broker/broker_facade_test.go b/internal/controller/broker/broker_facade_test.go index f7a95e76..3078bba4 100644 --- a/internal/controller/broker/broker_facade_test.go +++ b/internal/controller/broker/broker_facade_test.go @@ -6,7 +6,7 @@ import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/controller/broker/broker_syncer.go b/internal/controller/broker/broker_syncer.go index f76140bc..8759df70 100644 --- a/internal/controller/broker/broker_syncer.go +++ b/internal/controller/broker/broker_syncer.go @@ -5,7 +5,7 @@ import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" apiErrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/broker/broker_syncer_test.go b/internal/controller/broker/broker_syncer_test.go index 6148d00f..a34fe880 100644 --- a/internal/controller/broker/broker_syncer_test.go +++ b/internal/controller/broker/broker_syncer_test.go @@ -3,7 +3,7 @@ package broker import ( "testing" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/controller/broker/cluster_broker_facade.go b/internal/controller/broker/cluster_broker_facade.go index cb80f499..fda0b6bf 100644 --- a/internal/controller/broker/cluster_broker_facade.go +++ b/internal/controller/broker/cluster_broker_facade.go @@ -6,7 +6,7 @@ import ( "context" multierror "github.com/hashicorp/go-multierror" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/broker/cluster_broker_facade_test.go b/internal/controller/broker/cluster_broker_facade_test.go index 03185033..440e5d8b 100644 --- a/internal/controller/broker/cluster_broker_facade_test.go +++ b/internal/controller/broker/cluster_broker_facade_test.go @@ -6,7 +6,7 @@ import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/controller/broker/cluster_broker_syncer.go b/internal/controller/broker/cluster_broker_syncer.go index 5952adf3..a4eedb82 100644 --- a/internal/controller/broker/cluster_broker_syncer.go +++ b/internal/controller/broker/cluster_broker_syncer.go @@ -5,7 +5,7 @@ import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" apiErrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/broker/cluster_broker_syncer_test.go b/internal/controller/broker/cluster_broker_syncer_test.go index 187a9295..12dcb4e6 100644 --- a/internal/controller/broker/cluster_broker_syncer_test.go +++ b/internal/controller/broker/cluster_broker_syncer_test.go @@ -3,7 +3,7 @@ package broker import ( "testing" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/controller/broker_controller.go b/internal/controller/broker_controller.go index 3cb8a0b7..3388365f 100644 --- a/internal/controller/broker_controller.go +++ b/internal/controller/broker_controller.go @@ -3,7 +3,7 @@ package controller import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller/broker" "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" "k8s.io/apimachinery/pkg/types" @@ -90,7 +90,7 @@ func (sbc *BrokerController) Reconcile(request reconcile.Request) (reconcile.Res } // list addons configurations acList := v1alpha1.AddonsConfigurationList{} - err = sbc.cli.List(context.TODO(), &client.ListOptions{Namespace: currentNamespace}, &acList) + err = sbc.cli.List(context.TODO(), &acList, client.InNamespace(currentNamespace)) if err != nil { return reconcile.Result{}, err } @@ -101,10 +101,14 @@ func (sbc *BrokerController) Reconcile(request reconcile.Request) (reconcile.Res return reconcile.Result{}, err } if sbExists && !anyNamespacedConfigExists && !instanceByNamespacedExists { - sbc.namespacedBrokerFacade.Delete() + if err := sbc.namespacedBrokerFacade.Delete(); err != nil { + return reconcile.Result{}, err + } } if !sbExists && (anyNamespacedConfigExists || instanceByNamespacedExists) { - sbc.namespacedBrokerFacade.Create() + if err := sbc.namespacedBrokerFacade.Create(); err != nil { + return reconcile.Result{}, err + } } return reconcile.Result{}, nil diff --git a/internal/controller/broker_controller_test.go b/internal/controller/broker_controller_test.go index 5434559d..c229d616 100644 --- a/internal/controller/broker_controller_test.go +++ b/internal/controller/broker_controller_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller" "github.com/kyma-project/helm-broker/internal/controller/broker" "github.com/kyma-project/helm-broker/internal/controller/instance" diff --git a/internal/controller/cluster_addons_controller_test.go b/internal/controller/cluster_addons_controller_test.go index 2dbb987b..f580b0d4 100644 --- a/internal/controller/cluster_addons_controller_test.go +++ b/internal/controller/cluster_addons_controller_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller/automock" "github.com/kyma-project/helm-broker/internal/controller/repository" "github.com/kyma-project/helm-broker/internal/platform/logger/spy" diff --git a/internal/controller/cluster_broker_controller.go b/internal/controller/cluster_broker_controller.go index 08155c96..18190080 100644 --- a/internal/controller/cluster_broker_controller.go +++ b/internal/controller/cluster_broker_controller.go @@ -3,7 +3,7 @@ package controller import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -73,7 +73,7 @@ func (sbc *ClusterBrokerController) Reconcile(request reconcile.Request) (reconc return reconcile.Result{}, err } cacList := v1alpha1.ClusterAddonsConfigurationList{} - err = sbc.cli.List(context.TODO(), &client.ListOptions{}, &cacList) + err = sbc.cli.List(context.TODO(), &cacList) if err != nil { return reconcile.Result{}, err } diff --git a/internal/controller/cluster_broker_controller_test.go b/internal/controller/cluster_broker_controller_test.go index 6e155063..ad160c93 100644 --- a/internal/controller/cluster_broker_controller_test.go +++ b/internal/controller/cluster_broker_controller_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller" "github.com/kyma-project/helm-broker/internal/controller/broker" "github.com/kyma-project/helm-broker/internal/controller/instance" diff --git a/internal/controller/common_client.go b/internal/controller/common_client.go index b4e39609..6fbda166 100644 --- a/internal/controller/common_client.go +++ b/internal/controller/common_client.go @@ -108,7 +108,7 @@ func (a *CommonClient) ListConfigurations() ([]internal.CommonAddon, error) { if a.IsNamespaceScoped() { addonsConfigurationList := &v1alpha1.AddonsConfigurationList{} - err := a.List(context.TODO(), &client.ListOptions{Namespace: a.namespace}, addonsConfigurationList) + err := a.List(context.TODO(), addonsConfigurationList, client.InNamespace(a.namespace)) if err != nil { return nil, errors.Wrapf(err, "while fetching AddonConfiguration list from namespace %s", a.namespace) } @@ -123,7 +123,7 @@ func (a *CommonClient) ListConfigurations() ([]internal.CommonAddon, error) { } else { addonsConfigurationList := &v1alpha1.ClusterAddonsConfigurationList{} - err := a.List(context.TODO(), &client.ListOptions{}, addonsConfigurationList) + err := a.List(context.TODO(), addonsConfigurationList) if err != nil { return nil, errors.Wrap(err, "while fetching ClusterAddonConfiguration list") } diff --git a/internal/controller/docs/cluster_provider.go b/internal/controller/docs/cluster_provider.go index 4b6ccb42..06aa9548 100644 --- a/internal/controller/docs/cluster_provider.go +++ b/internal/controller/docs/cluster_provider.go @@ -8,7 +8,7 @@ import ( "time" "github.com/kyma-project/helm-broker/internal" - "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" apiErrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/docs/cluster_provider_test.go b/internal/controller/docs/cluster_provider_test.go index 1569362e..6cc9a7e5 100644 --- a/internal/controller/docs/cluster_provider_test.go +++ b/internal/controller/docs/cluster_provider_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/kyma-project/helm-broker/internal" - "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/controller/docs/provider.go b/internal/controller/docs/provider.go index f2bb7aca..171a523a 100644 --- a/internal/controller/docs/provider.go +++ b/internal/controller/docs/provider.go @@ -8,7 +8,7 @@ import ( "time" "github.com/kyma-project/helm-broker/internal" - "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" apiErrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/controller/docs/provider_test.go b/internal/controller/docs/provider_test.go index 018d32f7..e4d69208 100644 --- a/internal/controller/docs/provider_test.go +++ b/internal/controller/docs/provider_test.go @@ -8,7 +8,7 @@ import ( "github.com/Masterminds/semver" "github.com/kyma-project/helm-broker/internal" - "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/internal/controller/instance/facade.go b/internal/controller/instance/facade.go index 11c8a307..e35562e1 100644 --- a/internal/controller/instance/facade.go +++ b/internal/controller/instance/facade.go @@ -3,7 +3,7 @@ package instance import ( "context" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller/broker" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -25,7 +25,7 @@ func New(c client.Client, clusterBrokerName string) *Facade { // AnyServiceInstanceExistsForNamespacedServiceBroker checks whether there is at least one service instance created with helm broker service class. func (f *Facade) AnyServiceInstanceExistsForNamespacedServiceBroker(namespace string) (bool, error) { instanceList := &v1beta1.ServiceInstanceList{} - err := f.client.List(context.TODO(), &client.ListOptions{Namespace: namespace}, instanceList) + err := f.client.List(context.TODO(), instanceList, client.InNamespace(namespace)) if err != nil { return false, err } @@ -34,7 +34,7 @@ func (f *Facade) AnyServiceInstanceExistsForNamespacedServiceBroker(namespace st } classList := &v1beta1.ServiceClassList{} - err = f.client.List(context.TODO(), &client.ListOptions{Namespace: namespace}, classList) + err = f.client.List(context.TODO(), classList, client.InNamespace(namespace)) if err != nil { return false, err } @@ -61,7 +61,7 @@ func (f *Facade) AnyServiceInstanceExistsForNamespacedServiceBroker(namespace st // AnyServiceInstanceExistsForClusterServiceBroker checks whether there is at least one service instance created with helm broker cluster service class. func (f *Facade) AnyServiceInstanceExistsForClusterServiceBroker() (bool, error) { instanceList := &v1beta1.ServiceInstanceList{} - err := f.client.List(context.TODO(), &client.ListOptions{}, instanceList) + err := f.client.List(context.TODO(), instanceList) if err != nil { return false, err } @@ -70,7 +70,7 @@ func (f *Facade) AnyServiceInstanceExistsForClusterServiceBroker() (bool, error) } classList := &v1beta1.ClusterServiceClassList{} - err = f.client.List(context.TODO(), &client.ListOptions{}, classList) + err = f.client.List(context.TODO(), classList) if err != nil { return false, err } diff --git a/internal/controller/instance/facade_test.go b/internal/controller/instance/facade_test.go index 1793a88b..18d71250 100644 --- a/internal/controller/instance/facade_test.go +++ b/internal/controller/instance/facade_test.go @@ -3,7 +3,7 @@ package instance_test import ( "testing" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/controller/broker" "github.com/kyma-project/helm-broker/internal/controller/instance" "github.com/stretchr/testify/assert" diff --git a/internal/controller/setup.go b/internal/controller/setup.go index 166df0ba..b7e483ab 100644 --- a/internal/controller/setup.go +++ b/internal/controller/setup.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" "github.com/kyma-project/helm-broker/internal/addon" "github.com/kyma-project/helm-broker/internal/addon/provider" "github.com/kyma-project/helm-broker/internal/config" @@ -15,7 +15,7 @@ import ( "github.com/kyma-project/helm-broker/internal/rafter" "github.com/kyma-project/helm-broker/internal/storage" "github.com/kyma-project/helm-broker/pkg/apis" - rafterv1beta1 "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + rafterv1beta1 "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/sirupsen/logrus" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/manager" diff --git a/internal/model.go b/internal/model.go index 7181140f..8b05a8e6 100644 --- a/internal/model.go +++ b/internal/model.go @@ -10,7 +10,7 @@ import ( "github.com/fatih/structs" google_protobuf "github.com/golang/protobuf/ptypes/timestamp" "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" - rafter "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + rafter "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/addons/v1alpha1/common.go b/pkg/apis/addons/v1alpha1/common.go index 2785a755..ae70da88 100644 --- a/pkg/apis/addons/v1alpha1/common.go +++ b/pkg/apis/addons/v1alpha1/common.go @@ -21,6 +21,7 @@ const ( ) // AddonStatus define the addon status +// +kubebuilder:validation:Enum=Ready;Failed type AddonStatus string const ( @@ -61,7 +62,6 @@ type CommonAddonsConfigurationSpec struct { type Addon struct { Name string `json:"name"` Version string `json:"version"` - // +kubebuilder:validation:Enum=Ready,Failed Status AddonStatus `json:"status,omitempty"` Reason AddonStatusReason `json:"reason,omitempty"` Message string `json:"message,omitempty"` diff --git a/pkg/apis/addons/v1alpha1/types.go b/pkg/apis/addons/v1alpha1/types.go index 2c1bda07..90e1df6e 100644 --- a/pkg/apis/addons/v1alpha1/types.go +++ b/pkg/apis/addons/v1alpha1/types.go @@ -5,15 +5,17 @@ import ( ) // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +// Important: Run "make generates" to regenerate files after modifying those structs + // +kubebuilder:object:root=true // AddonsConfiguration is the Schema for the addonsconfigurations API -// Important: Run "make generates" to regenerate files after modifying this struct // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:categories=all,addons +// +kubebuilder:resource:categories=all;addons +// +kubebuilder:subresource:status type AddonsConfiguration struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -33,7 +35,6 @@ type AddonsConfigurationStatus struct { } // AddonsConfigurationList contains a list of AddonsConfiguration -// Important: Run "make generates" to regenerate files after modifying this struct // // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type AddonsConfigurationList struct { @@ -45,18 +46,18 @@ type AddonsConfigurationList struct { // +kubebuilder:object:root=true // ClusterAddonsConfiguration is the Schema for the addonsconfigurations API -// Important: Run "make generates" to regenerate files after modifying this struct // // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:categories=all,addons +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster type ClusterAddonsConfiguration struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec ClusterAddonsConfigurationSpec `json:"spec,omitempty"` - // +optional Status ClusterAddonsConfigurationStatus `json:"status,omitempty"` } @@ -71,7 +72,6 @@ type ClusterAddonsConfigurationStatus struct { } // ClusterAddonsConfigurationList contains a list of ClusterAddonsConfiguration -// Important: Run "make generates" to regenerate files after modifying this struct // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ClusterAddonsConfigurationList struct { diff --git a/pkg/apis/addons/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/addons/v1alpha1/zz_generated.deepcopy.go index bada9d26..5116c8b7 100644 --- a/pkg/apis/addons/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/addons/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ func (in *AddonsConfiguration) DeepCopyObject() runtime.Object { func (in *AddonsConfigurationList) DeepCopyInto(out *AddonsConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AddonsConfiguration, len(*in)) @@ -168,7 +168,7 @@ func (in *ClusterAddonsConfiguration) DeepCopyObject() runtime.Object { func (in *ClusterAddonsConfigurationList) DeepCopyInto(out *ClusterAddonsConfigurationList) { *out = *in out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]ClusterAddonsConfiguration, len(*in)) diff --git a/pkg/apis/rafter/v1beta1/asset_common_types.go b/pkg/apis/rafter/v1beta1/asset_common_types.go deleted file mode 100644 index e76208e0..00000000 --- a/pkg/apis/rafter/v1beta1/asset_common_types.go +++ /dev/null @@ -1,163 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// CommonAssetSpec defines the desired state of Asset -type CommonAssetSpec struct { - Source AssetSource `json:"source"` - BucketRef AssetBucketRef `json:"bucketRef,omitempty"` - // +optional - Parameters *runtime.RawExtension `json:"parameters,omitempty"` -} - -// CommonAssetStatus defines the observed state of Asset -type CommonAssetStatus struct { - Phase AssetPhase `json:"phase"` - Message string `json:"message,omitempty"` - Reason AssetReason `json:"reason,omitempty"` - AssetRef AssetStatusRef `json:"assetRef,omitempty"` - LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime"` - ObservedGeneration int64 `json:"observedGeneration"` -} - -type AssetPhase string - -const ( - AssetReady AssetPhase = "Ready" - AssetPending AssetPhase = "Pending" - AssetFailed AssetPhase = "Failed" -) - -type AssetStatusRef struct { - BaseURL string `json:"baseUrl"` - Files []AssetFile `json:"files,omitempty"` -} - -type AssetFile struct { - Name string `json:"name"` - Metadata *runtime.RawExtension `json:"metadata,omitempty"` -} - -type WebhookService struct { - Name string `json:"name"` - Namespace string `json:"namespace"` - - // +optional - Endpoint string `json:"endpoint,omitempty"` - // +optional - Filter string `json:"filter,omitempty"` -} - -type AssetWebhookService struct { - WebhookService `json:",inline"` - Parameters *runtime.RawExtension `json:"parameters,omitempty"` -} - -// +kubebuilder:validation:Enum=single;package;index -type AssetMode string - -const ( - AssetSingle AssetMode = "single" - AssetPackage AssetMode = "package" - AssetIndex AssetMode = "index" -) - -type AssetBucketRef struct { - Name string `json:"name"` -} - -type AssetSource struct { - Mode AssetMode `json:"mode"` - URL string `json:"url"` - // +optional - Filter string `json:"filter,omitempty"` - - // +optional - ValidationWebhookService []AssetWebhookService `json:"validationWebhookService,omitempty"` - - // +optional - MutationWebhookService []AssetWebhookService `json:"mutationWebhookService,omitempty"` - - // +optional - MetadataWebhookService []WebhookService `json:"metadataWebhookService,omitempty"` -} - -type AssetReason string - -const ( - AssetPulled AssetReason = "Pulled" - AssetPullingFailed AssetReason = "PullingFailed" - AssetUploaded AssetReason = "Uploaded" - AssetUploadFailed AssetReason = "UploadFailed" - AssetBucketNotReady AssetReason = "BucketNotReady" - AssetBucketError AssetReason = "BucketError" - AssetMutated AssetReason = "Mutated" - AssetMutationFailed AssetReason = "MutationFailed" - AssetMutationError AssetReason = "MutationError" - AssetMetadataExtracted AssetReason = "MetadataExtracted" - AssetMetadataExtractionFailed AssetReason = "MetadataExtractionFailed" - AssetValidated AssetReason = "Validated" - AssetValidationFailed AssetReason = "ValidationFailed" - AssetValidationError AssetReason = "ValidationError" - AssetMissingContent AssetReason = "MissingContent" - AssetRemoteContentVerificationError AssetReason = "RemoteContentVerificationError" - AssetCleanupError AssetReason = "CleanupError" - AssetCleaned AssetReason = "Cleaned" - AssetScheduled AssetReason = "Scheduled" -) - -func (r AssetReason) String() string { - return string(r) -} - -func (r AssetReason) Message() string { - switch r { - case AssetPulled: - return "Asset content has been pulled" - case AssetPullingFailed: - return "Asset content pulling failed due to error %s" - case AssetUploaded: - return "Asset content has been uploaded" - case AssetUploadFailed: - return "Asset content uploading failed due to error %s" - case AssetBucketNotReady: - return "Referenced bucket is not ready" - case AssetBucketError: - return "Reading bucket status failed due to error %s" - case AssetMutated: - return "Asset content has been mutated" - case AssetMutationFailed: - return "Asset mutation failed due to %+v" - case AssetMutationError: - return "Asset mutation failed due to error %s" - case AssetMetadataExtracted: - return "Metadata has been extracted from asset content" - case AssetMetadataExtractionFailed: - return "Metadata extraction failed due to error %s" - case AssetValidated: - return "Asset content has been validated" - case AssetValidationFailed: - return "Asset validation failed due to %+v" - case AssetValidationError: - return "Asset validation failed due to error %s" - case AssetMissingContent: - return "Asset content has been removed from remote storage" - case AssetRemoteContentVerificationError: - return "Asset content verification failed due to error %s" - case AssetCleanupError: - return "Removing old asset content failed due to error %s" - case AssetCleaned: - return "Old asset content hes been removed" - case AssetScheduled: - return "Asset scheduled for processing" - default: - return "" - } -} diff --git a/pkg/apis/rafter/v1beta1/asset_types.go b/pkg/apis/rafter/v1beta1/asset_types.go deleted file mode 100644 index 0477dfd0..00000000 --- a/pkg/apis/rafter/v1beta1/asset_types.go +++ /dev/null @@ -1,50 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// AssetSpec defines the desired state of Asset -type AssetSpec struct { - CommonAssetSpec `json:",inline"` -} - -// AssetStatus defines the observed state of Asset -type AssetStatus struct { - CommonAssetStatus `json:",inline"` -} - -// +kubebuilder:object:root=true - -// Asset is the Schema for the assets API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="Base URL",type="string",JSONPath=".status.assetRef.baseUrl" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type Asset struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AssetSpec `json:"spec,omitempty"` - Status AssetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// AssetList contains a list of Asset -type AssetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Asset `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Asset{}, &AssetList{}) -} diff --git a/pkg/apis/rafter/v1beta1/assetgroup_common.go b/pkg/apis/rafter/v1beta1/assetgroup_common.go deleted file mode 100644 index 8d0622a2..00000000 --- a/pkg/apis/rafter/v1beta1/assetgroup_common.go +++ /dev/null @@ -1,119 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -type CommonAssetGroupSpec struct { - DisplayName string `json:"displayName,omitempty"` - Description string `json:"description,omitempty"` - // +kubebuilder:validation:MinItems=1 - Sources []Source `json:"sources"` -} - -// +kubebuilder:validation:Enum=single;package;index -type AssetGroupSourceMode string - -const ( - AssetGroupSingle AssetGroupSourceMode = "single" - AssetGroupPackage AssetGroupSourceMode = "package" - AssetGroupIndex AssetGroupSourceMode = "index" -) - -// +kubebuilder:validation:Pattern=^[a-z][a-zA-Z0-9-]*[a-zA-Z0-9]$ -type AssetGroupSourceName string - -// +kubebuilder:validation:Pattern=^[a-z][a-zA-Z0-9\._-]*[a-zA-Z0-9]$ -type AssetGroupSourceType string - -type Source struct { - Name AssetGroupSourceName `json:"name"` - Type AssetGroupSourceType `json:"type"` - URL string `json:"url"` - Mode AssetGroupSourceMode `json:"mode"` - Filter string `json:"filter,omitempty"` - // +optional - Parameters *runtime.RawExtension `json:"parameters,omitempty"` -} - -// +kubebuilder:validation:Enum=Pending;Ready;Failed -type AssetGroupPhase string - -const ( - AssetGroupPending AssetGroupPhase = "Pending" - AssetGroupReady AssetGroupPhase = "Ready" - AssetGroupFailed AssetGroupPhase = "Failed" -) - -type CommonAssetGroupStatus struct { - Phase AssetGroupPhase `json:"phase"` - Reason AssetGroupReason `json:"reason,omitempty"` - Message string `json:"message,omitempty"` - LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime"` -} - -type AssetGroupReason string - -const ( - AssetGroupAssetCreated AssetGroupReason = "AssetCreated" - AssetGroupAssetCreationFailed AssetGroupReason = "AssetCreationFailed" - AssetGroupAssetsCreationFailed AssetGroupReason = "AssetsCreationFailed" - AssetGroupAssetsListingFailed AssetGroupReason = "AssetsListingFailed" - AssetGroupAssetDeleted AssetGroupReason = "AssetDeleted" - AssetGroupAssetDeletionFailed AssetGroupReason = "AssetDeletionFailed" - AssetGroupAssetsDeletionFailed AssetGroupReason = "AssetsDeletionFailed" - AssetGroupAssetUpdated AssetGroupReason = "AssetUpdated" - AssetGroupAssetUpdateFailed AssetGroupReason = "AssetUpdateFailed" - AssetGroupAssetsUpdateFailed AssetGroupReason = "AssetsUpdateFailed" - AssetGroupAssetsReady AssetGroupReason = "AssetsReady" - AssetGroupWaitingForAssets AssetGroupReason = "WaitingForAssets" - AssetGroupBucketError AssetGroupReason = "BucketError" - AssetGroupAssetsWebhookGetFailed AssetGroupReason = "AssetsWebhookGetFailed" - AssetGroupAssetsSpecValidationFailed AssetGroupReason = "AssetsSpecValidationFailed" -) - -func (r AssetGroupReason) String() string { - return string(r) -} - -func (r AssetGroupReason) Message() string { - switch r { - case AssetGroupAssetCreated: - return "Asset %s has been created" - case AssetGroupAssetCreationFailed: - return "Asset %s couldn't be created due to error %s" - case AssetGroupAssetsCreationFailed: - return "Assets couldn't be created due to error %s" - case AssetGroupAssetsListingFailed: - return "Assets couldn't be listed due to error %s" - case AssetGroupAssetDeleted: - return "Assets %s has been deleted" - case AssetGroupAssetDeletionFailed: - return "Assets %s couldn't be deleted due to error %s" - case AssetGroupAssetsDeletionFailed: - return "Assets couldn't be deleted due to error %s" - case AssetGroupAssetUpdated: - return "Asset %s has been updated" - case AssetGroupAssetUpdateFailed: - return "Asset %s couldn't be updated due to error %s" - case AssetGroupAssetsUpdateFailed: - return "Assets couldn't be updated due to error %s" - case AssetGroupAssetsReady: - return "Assets are ready to use" - case AssetGroupWaitingForAssets: - return "Waiting for assets to be in Ready phase" - case AssetGroupBucketError: - return "Couldn't ensure if bucket exist due to error %s" - case AssetGroupAssetsWebhookGetFailed: - return "Unable to get webhook configuration %s" - case AssetGroupAssetsSpecValidationFailed: - return "Invalid asset specification, %s" - default: - return "" - } -} diff --git a/pkg/apis/rafter/v1beta1/assetgroup_types.go b/pkg/apis/rafter/v1beta1/assetgroup_types.go deleted file mode 100644 index 807f0555..00000000 --- a/pkg/apis/rafter/v1beta1/assetgroup_types.go +++ /dev/null @@ -1,49 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// AssetGroupSpec defines the desired state of AssetGroup -type AssetGroupSpec struct { - CommonAssetGroupSpec `json:",inline"` -} - -// AssetGroupStatus defines the observed state of AssetGroup -type AssetGroupStatus struct { - CommonAssetGroupStatus `json:",inline"` -} - -// +kubebuilder:object:root=true - -// AssetGroup is the Schema for the assetgroups API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type AssetGroup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AssetGroupSpec `json:"spec,omitempty"` - Status AssetGroupStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// AssetGroupList contains a list of AssetGroup -type AssetGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AssetGroup `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AssetGroup{}, &AssetGroupList{}) -} diff --git a/pkg/apis/rafter/v1beta1/bucket_common_types.go b/pkg/apis/rafter/v1beta1/bucket_common_types.go deleted file mode 100644 index 28970a87..00000000 --- a/pkg/apis/rafter/v1beta1/bucket_common_types.go +++ /dev/null @@ -1,104 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CommonBucketSpec defines the desired state of Bucket -type CommonBucketSpec struct { - // +optional - Region BucketRegion `json:"region,omitempty"` - - // +optional - Policy BucketPolicy `json:"policy,omitempty"` -} - -// +kubebuilder:validation:Enum=us-east-1;us-west-1;us-west-2;eu-west-1;eu-central-1;ap-southeast-1;ap-southeast-2;ap-northeast-1;sa-east-1;"" -type BucketRegion string - -const ( - BucketRegionUSEast1 BucketRegion = "us-east-1" - BucketRegionUSWest1 = "us-west-1" - BucketRegionUSWest2 = "us-west-2" - BucketRegionEUEast1 = "eu-west-1" - BucketRegionEUCentral1 = "eu-central-1" - BucketRegionAPSoutheast1 = "ap-southeast-1" - BucketRegionAPSoutheast2 = "ap-southeast-2" - BucketRegionAPNortheast1 = "ap-northeast-1" - BucketRegionSAEast1 = "sa-east-1" -) - -// +kubebuilder:validation:Enum=none;readonly;writeonly;readwrite;"" -type BucketPolicy string - -const ( - BucketPolicyNone BucketPolicy = "none" - BucketPolicyReadOnly BucketPolicy = "readonly" - BucketPolicyWriteOnly BucketPolicy = "writeonly" - BucketPolicyReadWrite BucketPolicy = "readwrite" -) - -// CommonBucketStatus defines the observed state of Bucket -type CommonBucketStatus struct { - URL string `json:"url,omitempty"` - Phase BucketPhase `json:"phase,omitempty"` - Message string `json:"message,omitempty"` - Reason BucketReason `json:"reason,omitempty"` - RemoteName string `json:"remoteName,omitempty"` - LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty"` - ObservedGeneration int64 `json:"observedGeneration"` -} - -type BucketPhase string - -const ( - // BucketReady means that the bucket has been successfully created - BucketReady BucketPhase = "Ready" - - // BucketFailed means that the bucket couldn't be created or has been deleted manually - BucketFailed BucketPhase = "Failed" -) - -type BucketReason string - -const ( - BucketNotFound BucketReason = "BucketNotFound" - BucketCreationFailure BucketReason = "BucketCreationFailure" - BucketVerificationFailure BucketReason = "BucketVerificationFailure" - BucketCreated BucketReason = "BucketCreated" - BucketPolicyUpdated BucketReason = "BucketPolicyUpdated" - BucketPolicyUpdateFailed BucketReason = "BucketPolicyUpdateFailed" - BucketPolicyVerificationFailed BucketReason = "BucketPolicyVerificationFailed" - BucketPolicyHasBeenChanged BucketReason = "BucketPolicyHasBeenChanged" -) - -func (r BucketReason) String() string { - return string(r) -} - -func (r BucketReason) Message() string { - switch r { - case BucketCreated: - return "Bucket has been created" - case BucketNotFound: - return "Bucket %s doesn't exist anymore" - case BucketCreationFailure: - return "Bucket couldn't be created due to error %s" - case BucketVerificationFailure: - return "Bucket couldn't be verified due to error %s" - case BucketPolicyUpdated: - return "Bucket policy has been updated" - case BucketPolicyUpdateFailed: - return "Bucket policy couldn't be set due to error %s" - case BucketPolicyVerificationFailed: - return "Bucket policy couldn't be verified due to error %s" - case BucketPolicyHasBeenChanged: - return "Remote bucket policy has been changed" - default: - return "" - } -} diff --git a/pkg/apis/rafter/v1beta1/bucket_types.go b/pkg/apis/rafter/v1beta1/bucket_types.go deleted file mode 100644 index adce1c24..00000000 --- a/pkg/apis/rafter/v1beta1/bucket_types.go +++ /dev/null @@ -1,50 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// BucketSpec defines the desired state of Bucket -type BucketSpec struct { - CommonBucketSpec `json:",inline"` -} - -// BucketStatus defines the observed state of Bucket -type BucketStatus struct { - CommonBucketStatus `json:",inline"` -} - -// +kubebuilder:object:root=true - -// Bucket is the Schema for the buckets API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.url" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type Bucket struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec BucketSpec `json:"spec,omitempty"` - Status BucketStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// BucketList contains a list of Bucket -type BucketList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Bucket `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Bucket{}, &BucketList{}) -} diff --git a/pkg/apis/rafter/v1beta1/clusterasset_types.go b/pkg/apis/rafter/v1beta1/clusterasset_types.go deleted file mode 100644 index 9b84c7f2..00000000 --- a/pkg/apis/rafter/v1beta1/clusterasset_types.go +++ /dev/null @@ -1,51 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// ClusterAssetSpec defines the desired state of ClusterAsset -type ClusterAssetSpec struct { - CommonAssetSpec `json:",inline"` -} - -// ClusterAssetStatus defines the observed state of ClusterAsset -type ClusterAssetStatus struct { - CommonAssetStatus `json:",inline"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Cluster - -// ClusterAsset is the Schema for the clusterassets API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="Base URL",type="string",JSONPath=".status.assetRef.baseUrl" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type ClusterAsset struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterAssetSpec `json:"spec,omitempty"` - Status ClusterAssetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ClusterAssetList contains a list of ClusterAsset -type ClusterAssetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterAsset `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterAsset{}, &ClusterAssetList{}) -} diff --git a/pkg/apis/rafter/v1beta1/clusterassetgroup_types.go b/pkg/apis/rafter/v1beta1/clusterassetgroup_types.go deleted file mode 100644 index 53619a0e..00000000 --- a/pkg/apis/rafter/v1beta1/clusterassetgroup_types.go +++ /dev/null @@ -1,50 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// ClusterAssetGroupSpec defines the desired state of ClusterAssetGroup -type ClusterAssetGroupSpec struct { - CommonAssetGroupSpec `json:",inline"` -} - -// ClusterAssetGroupStatus defines the observed state of ClusterAssetGroup -type ClusterAssetGroupStatus struct { - CommonAssetGroupStatus `json:",inline"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Cluster - -// ClusterAssetGroup is the Schema for the clusterassetgroups API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type ClusterAssetGroup struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterAssetGroupSpec `json:"spec,omitempty"` - Status ClusterAssetGroupStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ClusterAssetGroupList contains a list of ClusterAssetGroup -type ClusterAssetGroupList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterAssetGroup `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterAssetGroup{}, &ClusterAssetGroupList{}) -} diff --git a/pkg/apis/rafter/v1beta1/clusterbucket_types.go b/pkg/apis/rafter/v1beta1/clusterbucket_types.go deleted file mode 100644 index 003b80c0..00000000 --- a/pkg/apis/rafter/v1beta1/clusterbucket_types.go +++ /dev/null @@ -1,51 +0,0 @@ -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// ClusterBucketSpec defines the desired state of ClusterBucket -type ClusterBucketSpec struct { - CommonBucketSpec `json:",inline"` -} - -// ClusterBucketStatus defines the observed state of ClusterBucket -type ClusterBucketStatus struct { - CommonBucketStatus `json:",inline"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:scope=Cluster - -// ClusterBucket is the Schema for the clusterbuckets API -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase" -// +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.url" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -type ClusterBucket struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterBucketSpec `json:"spec,omitempty"` - Status ClusterBucketStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ClusterBucketList contains a list of ClusterBucket -type ClusterBucketList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterBucket `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterBucket{}, &ClusterBucketList{}) -} diff --git a/pkg/apis/rafter/v1beta1/groupversion_info.go b/pkg/apis/rafter/v1beta1/groupversion_info.go deleted file mode 100644 index c25e8f90..00000000 --- a/pkg/apis/rafter/v1beta1/groupversion_info.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package v1beta1 contains API Schema definitions for the rafter v1beta1 API group -// +kubebuilder:object:generate=true -// +groupName=rafter.kyma-project.io -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/runtime/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "rafter.kyma-project.io", Version: "v1beta1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/pkg/apis/rafter/v1beta1/zz_generated.deepcopy.go b/pkg/apis/rafter/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index d1d2e606..00000000 --- a/pkg/apis/rafter/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,814 +0,0 @@ -// +build !ignore_autogenerated - -// autogenerated by controller-gen object, do not modify manually - -package v1beta1 - -//Copied from https://github.com/kyma-project/rafter/tree/9c356a443bda8b324ad4cefbf16cf449985c880a/pkg/apis/rafter/v1beta1 -//Because of conflicts of the dependencies (especially api-machinery) -//Could be removed after update helm-brokers api-machinery version to >=0.2.0 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Asset) DeepCopyInto(out *Asset) { - *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 Asset. -func (in *Asset) DeepCopy() *Asset { - if in == nil { - return nil - } - out := new(Asset) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Asset) 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 *AssetBucketRef) DeepCopyInto(out *AssetBucketRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetBucketRef. -func (in *AssetBucketRef) DeepCopy() *AssetBucketRef { - if in == nil { - return nil - } - out := new(AssetBucketRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetFile) DeepCopyInto(out *AssetFile) { - *out = *in - if in.Metadata != nil { - in, out := &in.Metadata, &out.Metadata - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetFile. -func (in *AssetFile) DeepCopy() *AssetFile { - if in == nil { - return nil - } - out := new(AssetFile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetGroup) DeepCopyInto(out *AssetGroup) { - *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 AssetGroup. -func (in *AssetGroup) DeepCopy() *AssetGroup { - if in == nil { - return nil - } - out := new(AssetGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AssetGroup) 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 *AssetGroupList) DeepCopyInto(out *AssetGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AssetGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetGroupList. -func (in *AssetGroupList) DeepCopy() *AssetGroupList { - if in == nil { - return nil - } - out := new(AssetGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AssetGroupList) 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 *AssetGroupSpec) DeepCopyInto(out *AssetGroupSpec) { - *out = *in - in.CommonAssetGroupSpec.DeepCopyInto(&out.CommonAssetGroupSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetGroupSpec. -func (in *AssetGroupSpec) DeepCopy() *AssetGroupSpec { - if in == nil { - return nil - } - out := new(AssetGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetGroupStatus) DeepCopyInto(out *AssetGroupStatus) { - *out = *in - in.CommonAssetGroupStatus.DeepCopyInto(&out.CommonAssetGroupStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetGroupStatus. -func (in *AssetGroupStatus) DeepCopy() *AssetGroupStatus { - if in == nil { - return nil - } - out := new(AssetGroupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetList) DeepCopyInto(out *AssetList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Asset, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetList. -func (in *AssetList) DeepCopy() *AssetList { - if in == nil { - return nil - } - out := new(AssetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AssetList) 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 *AssetSource) DeepCopyInto(out *AssetSource) { - *out = *in - if in.ValidationWebhookService != nil { - in, out := &in.ValidationWebhookService, &out.ValidationWebhookService - *out = make([]AssetWebhookService, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.MutationWebhookService != nil { - in, out := &in.MutationWebhookService, &out.MutationWebhookService - *out = make([]AssetWebhookService, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.MetadataWebhookService != nil { - in, out := &in.MetadataWebhookService, &out.MetadataWebhookService - *out = make([]WebhookService, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetSource. -func (in *AssetSource) DeepCopy() *AssetSource { - if in == nil { - return nil - } - out := new(AssetSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetSpec) DeepCopyInto(out *AssetSpec) { - *out = *in - in.CommonAssetSpec.DeepCopyInto(&out.CommonAssetSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetSpec. -func (in *AssetSpec) DeepCopy() *AssetSpec { - if in == nil { - return nil - } - out := new(AssetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetStatus) DeepCopyInto(out *AssetStatus) { - *out = *in - in.CommonAssetStatus.DeepCopyInto(&out.CommonAssetStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetStatus. -func (in *AssetStatus) DeepCopy() *AssetStatus { - if in == nil { - return nil - } - out := new(AssetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetStatusRef) DeepCopyInto(out *AssetStatusRef) { - *out = *in - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]AssetFile, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetStatusRef. -func (in *AssetStatusRef) DeepCopy() *AssetStatusRef { - if in == nil { - return nil - } - out := new(AssetStatusRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AssetWebhookService) DeepCopyInto(out *AssetWebhookService) { - *out = *in - out.WebhookService = in.WebhookService - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetWebhookService. -func (in *AssetWebhookService) DeepCopy() *AssetWebhookService { - if in == nil { - return nil - } - out := new(AssetWebhookService) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bucket) DeepCopyInto(out *Bucket) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bucket. -func (in *Bucket) DeepCopy() *Bucket { - if in == nil { - return nil - } - out := new(Bucket) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Bucket) 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 *BucketList) DeepCopyInto(out *BucketList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Bucket, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketList. -func (in *BucketList) DeepCopy() *BucketList { - if in == nil { - return nil - } - out := new(BucketList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BucketList) 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 *BucketSpec) DeepCopyInto(out *BucketSpec) { - *out = *in - out.CommonBucketSpec = in.CommonBucketSpec -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketSpec. -func (in *BucketSpec) DeepCopy() *BucketSpec { - if in == nil { - return nil - } - out := new(BucketSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BucketStatus) DeepCopyInto(out *BucketStatus) { - *out = *in - in.CommonBucketStatus.DeepCopyInto(&out.CommonBucketStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketStatus. -func (in *BucketStatus) DeepCopy() *BucketStatus { - if in == nil { - return nil - } - out := new(BucketStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAsset) DeepCopyInto(out *ClusterAsset) { - *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 ClusterAsset. -func (in *ClusterAsset) DeepCopy() *ClusterAsset { - if in == nil { - return nil - } - out := new(ClusterAsset) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAsset) 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 *ClusterAssetGroup) DeepCopyInto(out *ClusterAssetGroup) { - *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 ClusterAssetGroup. -func (in *ClusterAssetGroup) DeepCopy() *ClusterAssetGroup { - if in == nil { - return nil - } - out := new(ClusterAssetGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAssetGroup) 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 *ClusterAssetGroupList) DeepCopyInto(out *ClusterAssetGroupList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAssetGroup, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetGroupList. -func (in *ClusterAssetGroupList) DeepCopy() *ClusterAssetGroupList { - if in == nil { - return nil - } - out := new(ClusterAssetGroupList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAssetGroupList) 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 *ClusterAssetGroupSpec) DeepCopyInto(out *ClusterAssetGroupSpec) { - *out = *in - in.CommonAssetGroupSpec.DeepCopyInto(&out.CommonAssetGroupSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetGroupSpec. -func (in *ClusterAssetGroupSpec) DeepCopy() *ClusterAssetGroupSpec { - if in == nil { - return nil - } - out := new(ClusterAssetGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAssetGroupStatus) DeepCopyInto(out *ClusterAssetGroupStatus) { - *out = *in - in.CommonAssetGroupStatus.DeepCopyInto(&out.CommonAssetGroupStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetGroupStatus. -func (in *ClusterAssetGroupStatus) DeepCopy() *ClusterAssetGroupStatus { - if in == nil { - return nil - } - out := new(ClusterAssetGroupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAssetList) DeepCopyInto(out *ClusterAssetList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterAsset, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetList. -func (in *ClusterAssetList) DeepCopy() *ClusterAssetList { - if in == nil { - return nil - } - out := new(ClusterAssetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterAssetList) 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 *ClusterAssetSpec) DeepCopyInto(out *ClusterAssetSpec) { - *out = *in - in.CommonAssetSpec.DeepCopyInto(&out.CommonAssetSpec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetSpec. -func (in *ClusterAssetSpec) DeepCopy() *ClusterAssetSpec { - if in == nil { - return nil - } - out := new(ClusterAssetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterAssetStatus) DeepCopyInto(out *ClusterAssetStatus) { - *out = *in - in.CommonAssetStatus.DeepCopyInto(&out.CommonAssetStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAssetStatus. -func (in *ClusterAssetStatus) DeepCopy() *ClusterAssetStatus { - if in == nil { - return nil - } - out := new(ClusterAssetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterBucket) DeepCopyInto(out *ClusterBucket) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBucket. -func (in *ClusterBucket) DeepCopy() *ClusterBucket { - if in == nil { - return nil - } - out := new(ClusterBucket) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterBucket) 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 *ClusterBucketList) DeepCopyInto(out *ClusterBucketList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterBucket, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBucketList. -func (in *ClusterBucketList) DeepCopy() *ClusterBucketList { - if in == nil { - return nil - } - out := new(ClusterBucketList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterBucketList) 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 *ClusterBucketSpec) DeepCopyInto(out *ClusterBucketSpec) { - *out = *in - out.CommonBucketSpec = in.CommonBucketSpec -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBucketSpec. -func (in *ClusterBucketSpec) DeepCopy() *ClusterBucketSpec { - if in == nil { - return nil - } - out := new(ClusterBucketSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterBucketStatus) DeepCopyInto(out *ClusterBucketStatus) { - *out = *in - in.CommonBucketStatus.DeepCopyInto(&out.CommonBucketStatus) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterBucketStatus. -func (in *ClusterBucketStatus) DeepCopy() *ClusterBucketStatus { - if in == nil { - return nil - } - out := new(ClusterBucketStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonAssetGroupSpec) DeepCopyInto(out *CommonAssetGroupSpec) { - *out = *in - if in.Sources != nil { - in, out := &in.Sources, &out.Sources - *out = make([]Source, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonAssetGroupSpec. -func (in *CommonAssetGroupSpec) DeepCopy() *CommonAssetGroupSpec { - if in == nil { - return nil - } - out := new(CommonAssetGroupSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonAssetGroupStatus) DeepCopyInto(out *CommonAssetGroupStatus) { - *out = *in - in.LastHeartbeatTime.DeepCopyInto(&out.LastHeartbeatTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonAssetGroupStatus. -func (in *CommonAssetGroupStatus) DeepCopy() *CommonAssetGroupStatus { - if in == nil { - return nil - } - out := new(CommonAssetGroupStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonAssetSpec) DeepCopyInto(out *CommonAssetSpec) { - *out = *in - in.Source.DeepCopyInto(&out.Source) - out.BucketRef = in.BucketRef - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonAssetSpec. -func (in *CommonAssetSpec) DeepCopy() *CommonAssetSpec { - if in == nil { - return nil - } - out := new(CommonAssetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonAssetStatus) DeepCopyInto(out *CommonAssetStatus) { - *out = *in - in.AssetRef.DeepCopyInto(&out.AssetRef) - in.LastHeartbeatTime.DeepCopyInto(&out.LastHeartbeatTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonAssetStatus. -func (in *CommonAssetStatus) DeepCopy() *CommonAssetStatus { - if in == nil { - return nil - } - out := new(CommonAssetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonBucketSpec) DeepCopyInto(out *CommonBucketSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonBucketSpec. -func (in *CommonBucketSpec) DeepCopy() *CommonBucketSpec { - if in == nil { - return nil - } - out := new(CommonBucketSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonBucketStatus) DeepCopyInto(out *CommonBucketStatus) { - *out = *in - in.LastHeartbeatTime.DeepCopyInto(&out.LastHeartbeatTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonBucketStatus. -func (in *CommonBucketStatus) DeepCopy() *CommonBucketStatus { - if in == nil { - return nil - } - out := new(CommonBucketStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Source) DeepCopyInto(out *Source) { - *out = *in - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source. -func (in *Source) DeepCopy() *Source { - if in == nil { - return nil - } - out := new(Source) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WebhookService) DeepCopyInto(out *WebhookService) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookService. -func (in *WebhookService) DeepCopy() *WebhookService { - if in == nil { - return nil - } - out := new(WebhookService) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 4f02582c..612c1391 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ limitations under the License. package versioned import ( + "fmt" + addonsv1alpha1 "github.com/kyma-project/helm-broker/pkg/client/clientset/versioned/typed/addons/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" @@ -28,8 +30,6 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface AddonsV1alpha1() addonsv1alpha1.AddonsV1alpha1Interface - // Deprecated: please explicitly pick a version if possible. - Addons() addonsv1alpha1.AddonsV1alpha1Interface } // Clientset contains the clients for groups. Each group has exactly one @@ -44,12 +44,6 @@ func (c *Clientset) AddonsV1alpha1() addonsv1alpha1.AddonsV1alpha1Interface { return c.addonsV1alpha1 } -// Deprecated: Addons retrieves the default version of AddonsClient. -// Please explicitly pick a version. -func (c *Clientset) Addons() addonsv1alpha1.AddonsV1alpha1Interface { - return c.addonsV1alpha1 -} - // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -59,9 +53,14 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { } // NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } var cs Clientset diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go index 5d0041a4..5b26b2fc 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/pkg/client/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 5191637a..99c7bf1f 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { } } - cs := &Clientset{} + cs := &Clientset{tracker: o} cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { @@ -63,20 +63,20 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { type Clientset struct { testing.Fake discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker } func (c *Clientset) Discovery() discovery.DiscoveryInterface { return c.discovery } +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + var _ clientset.Interface = &Clientset{} // AddonsV1alpha1 retrieves the AddonsV1alpha1Client func (c *Clientset) AddonsV1alpha1() addonsv1alpha1.AddonsV1alpha1Interface { return &fakeaddonsv1alpha1.FakeAddonsV1alpha1{Fake: &c.Fake} } - -// Addons retrieves the AddonsV1alpha1Client -func (c *Clientset) Addons() addonsv1alpha1.AddonsV1alpha1Interface { - return &fakeaddonsv1alpha1.FakeAddonsV1alpha1{Fake: &c.Fake} -} diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index e4244f18..2cab8c2b 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 650f8e0d..6a89b492 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index 9310e812..ff0d0c51 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index fc13d458..33f50b44 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/addons_client.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/addons_client.go index 32494e6a..49be064c 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/addons_client.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/addons_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ package v1alpha1 import ( v1alpha1 "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" "github.com/kyma-project/helm-broker/pkg/client/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) @@ -76,7 +75,7 @@ func setConfigDefaults(config *rest.Config) error { gv := v1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/addonsconfiguration.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/addonsconfiguration.go index ef860b84..98f4f19a 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/addonsconfiguration.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/addonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" scheme "github.com/kyma-project/helm-broker/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -76,11 +78,16 @@ func (c *addonsConfigurations) Get(name string, options v1.GetOptions) (result * // List takes label and field selectors, and returns the list of AddonsConfigurations that match those selectors. func (c *addonsConfigurations) List(opts v1.ListOptions) (result *v1alpha1.AddonsConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.AddonsConfigurationList{} err = c.client.Get(). Namespace(c.ns). Resource("addonsconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *addonsConfigurations) List(opts v1.ListOptions) (result *v1alpha1.Addon // Watch returns a watch.Interface that watches the requested addonsConfigurations. func (c *addonsConfigurations) 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("addonsconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *addonsConfigurations) Delete(name string, options *v1.DeleteOptions) er // DeleteCollection deletes a collection of objects. func (c *addonsConfigurations) 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("addonsconfigurations"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/clusteraddonsconfiguration.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/clusteraddonsconfiguration.go index 7313f714..482097bd 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/clusteraddonsconfiguration.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/clusteraddonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1alpha1 "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" scheme "github.com/kyma-project/helm-broker/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -73,10 +75,15 @@ func (c *clusterAddonsConfigurations) Get(name string, options v1.GetOptions) (r // List takes label and field selectors, and returns the list of ClusterAddonsConfigurations that match those selectors. func (c *clusterAddonsConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ClusterAddonsConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.ClusterAddonsConfigurationList{} err = c.client.Get(). Resource("clusteraddonsconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -84,10 +91,15 @@ func (c *clusterAddonsConfigurations) List(opts v1.ListOptions) (result *v1alpha // Watch returns a watch.Interface that watches the requested clusterAddonsConfigurations. func (c *clusterAddonsConfigurations) 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(). Resource("clusteraddonsconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -141,9 +153,14 @@ func (c *clusterAddonsConfigurations) Delete(name string, options *v1.DeleteOpti // DeleteCollection deletes a collection of objects. func (c *clusterAddonsConfigurations) 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(). Resource("clusteraddonsconfigurations"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error() diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/doc.go index 3d21ea7d..2769e188 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/doc.go index 32f983f2..6eb84980 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addons_client.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addons_client.go index e1f01d5a..7a484245 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addons_client.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addons_client.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addonsconfiguration.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addonsconfiguration.go index e5dcd388..3589b640 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addonsconfiguration.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_addonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -131,7 +131,7 @@ func (c *FakeAddonsConfigurations) DeleteCollection(options *v1.DeleteOptions, l // Patch applies the patch and returns the patched addonsConfiguration. func (c *FakeAddonsConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AddonsConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(addonsconfigurationsResource, c.ns, name, data, subresources...), &v1alpha1.AddonsConfiguration{}) + Invokes(testing.NewPatchSubresourceAction(addonsconfigurationsResource, c.ns, name, pt, data, subresources...), &v1alpha1.AddonsConfiguration{}) if obj == nil { return nil, err diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_clusteraddonsconfiguration.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_clusteraddonsconfiguration.go index 31c305ce..472399d8 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_clusteraddonsconfiguration.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/fake/fake_clusteraddonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -123,7 +123,7 @@ func (c *FakeClusterAddonsConfigurations) DeleteCollection(options *v1.DeleteOpt // Patch applies the patch and returns the patched clusterAddonsConfiguration. func (c *FakeClusterAddonsConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterAddonsConfiguration, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusteraddonsconfigurationsResource, name, data, subresources...), &v1alpha1.ClusterAddonsConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(clusteraddonsconfigurationsResource, name, pt, data, subresources...), &v1alpha1.ClusterAddonsConfiguration{}) if obj == nil { return nil, err } diff --git a/pkg/client/clientset/versioned/typed/addons/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/addons/v1alpha1/generated_expansion.go index faaa6558..119af4ef 100644 --- a/pkg/client/clientset/versioned/typed/addons/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/addons/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/addons/interface.go b/pkg/client/informers/externalversions/addons/interface.go index 9bc5a369..4b87b513 100644 --- a/pkg/client/informers/externalversions/addons/interface.go +++ b/pkg/client/informers/externalversions/addons/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/addons/v1alpha1/addonsconfiguration.go b/pkg/client/informers/externalversions/addons/v1alpha1/addonsconfiguration.go index 3e3d5a4d..4c3bf00b 100644 --- a/pkg/client/informers/externalversions/addons/v1alpha1/addonsconfiguration.go +++ b/pkg/client/informers/externalversions/addons/v1alpha1/addonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/addons/v1alpha1/clusteraddonsconfiguration.go b/pkg/client/informers/externalversions/addons/v1alpha1/clusteraddonsconfiguration.go index 5058330b..4285bccb 100644 --- a/pkg/client/informers/externalversions/addons/v1alpha1/clusteraddonsconfiguration.go +++ b/pkg/client/informers/externalversions/addons/v1alpha1/clusteraddonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/addons/v1alpha1/interface.go b/pkg/client/informers/externalversions/addons/v1alpha1/interface.go index 1470bbca..4fbef246 100644 --- a/pkg/client/informers/externalversions/addons/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/addons/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -47,7 +47,6 @@ func (v *version) AddonsConfigurations() AddonsConfigurationInformer { } // ClusterAddonsConfigurations returns a ClusterAddonsConfigurationInformer. -// Caution! remove "namespace: v.namespace" after file regeneration. clusterAddonsConfigurationInformer doesn't have the “namespace” field func (v *version) ClusterAddonsConfigurations() ClusterAddonsConfigurationInformer { return &clusterAddonsConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 93d67efa..132d4629 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index e9a8589e..c54c3be0 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 27832315..6093df4f 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import ( cache "k8s.io/client-go/tools/cache" ) +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle @@ -35,4 +36,5 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer } +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/client/listers/addons/v1alpha1/addonsconfiguration.go b/pkg/client/listers/addons/v1alpha1/addonsconfiguration.go index 0a1cdeb4..be948c8a 100644 --- a/pkg/client/listers/addons/v1alpha1/addonsconfiguration.go +++ b/pkg/client/listers/addons/v1alpha1/addonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/addons/v1alpha1/clusteraddonsconfiguration.go b/pkg/client/listers/addons/v1alpha1/clusteraddonsconfiguration.go index f7224993..8ad8e067 100644 --- a/pkg/client/listers/addons/v1alpha1/clusteraddonsconfiguration.go +++ b/pkg/client/listers/addons/v1alpha1/clusteraddonsconfiguration.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/addons/v1alpha1/expansion_generated.go b/pkg/client/listers/addons/v1alpha1/expansion_generated.go index 3a553158..007dec7d 100644 --- a/pkg/client/listers/addons/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/addons/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Helm Broker Authors. +Copyright 2020 The Helm Broker Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/test/charts/helm_broker_test.go b/test/charts/helm_broker_test.go index db11ca42..11081a6c 100644 --- a/test/charts/helm_broker_test.go +++ b/test/charts/helm_broker_test.go @@ -108,7 +108,7 @@ func (s *TestSuite) createSampleClusterAddonsConfiguration() { }, }) - require.NoError(s.t, err, "while creating cluster addons configuration") + require.NoErrorf(s.t, err, "while creating cluster addons configuration") s.t.Logf("ClusterAddonsConfigurations %q is created", s.sampleClusterAddonsCfgName) } diff --git a/test/integration/suite_test.go b/test/integration/suite_test.go index 2351b1a7..09e0d12b 100644 --- a/test/integration/suite_test.go +++ b/test/integration/suite_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1" + "github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1" osb "github.com/pmorie/go-open-service-broker-client/v2" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" @@ -44,7 +44,7 @@ import ( "github.com/kyma-project/helm-broker/internal/storage/testdata" "github.com/kyma-project/helm-broker/pkg/apis" "github.com/kyma-project/helm-broker/pkg/apis/addons/v1alpha1" - dtv1beta1 "github.com/kyma-project/helm-broker/pkg/apis/rafter/v1beta1" + dtv1beta1 "github.com/kyma-project/rafter/pkg/apis/rafter/v1beta1" helm2 "k8s.io/helm/pkg/helm" ) @@ -760,7 +760,7 @@ func (ts *testSuite) assertAssetGroupListIsEmpty() { var assetGroupList dtv1beta1.AssetGroupList err := wait.Poll(1*time.Second, 30*time.Second, func() (done bool, err error) { - err = ts.dynamicClient.List(context.TODO(), &client.ListOptions{}, &assetGroupList) + err = ts.dynamicClient.List(context.TODO(), &assetGroupList) if err != nil { return false, err } @@ -779,7 +779,7 @@ func (ts *testSuite) assertClusterAssetGroupListIsEmpty() { var clusterAssetGroupList dtv1beta1.ClusterAssetGroupList err := wait.Poll(1*time.Second, 30*time.Second, func() (done bool, err error) { - err = ts.dynamicClient.List(context.TODO(), &client.ListOptions{}, &clusterAssetGroupList) + err = ts.dynamicClient.List(context.TODO(), &clusterAssetGroupList) if err != nil { return false, err }