diff --git a/Gopkg.lock b/Gopkg.lock index 9c6ae1e3ad..7bd6b47f0e 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -285,14 +285,6 @@ revision = "1624edc4454b8682399def8740d46db5e4362ba4" version = "v1.1.5" -[[projects]] - digest = "1:5a4ced6c2dc0b2b1b03fb21bca0529d1edd467d6f5c0e6876089211fba98af6f" - name = "github.com/kubernetes-incubator/apiserver-builder" - packages = ["pkg/controller"] - pruneopts = "NUT" - revision = "83b2c178a8f935a738cebbf41aa5b8af1f19162d" - version = "v0.2-alpha.0" - [[projects]] branch = "master" digest = "1:84a5a2b67486d5d67060ac393aa255d05d24ed5ee41daecd5635ec22657b6492" @@ -888,16 +880,14 @@ [[projects]] branch = "release-1.10" - digest = "1:75e1496de1243a3dff20bc54a68f3836cae5dcb7e56e88a13bdf16683af03ab9" + digest = "1:b56c1de127f5d15fed8024c5a049d2f371463cfeb8a7fcd2a87979f053feb9b4" name = "k8s.io/kube-aggregator" packages = [ "pkg/apis/apiregistration", "pkg/apis/apiregistration/v1", "pkg/apis/apiregistration/v1beta1", - "pkg/client/clientset_generated/clientset", "pkg/client/clientset_generated/clientset/scheme", "pkg/client/clientset_generated/clientset/typed/apiregistration/v1", - "pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1", ] pruneopts = "NUT" revision = "d29de253f8ba40ab4f8ee7eb50b522c0d83caff2" @@ -925,8 +915,7 @@ revision = "045dc31ee5c40e8240241ce28dc24d7b56130373" [[projects]] - branch = "master" - digest = "1:f014b8fdec7cafcb7016d64f5fa2d1efc83eb2f91ed6661ce000da736a282df1" + digest = "1:06e72e0584260bfbd3f221c9bff1b9676df283c306cbe97600dabbf6727933e9" name = "sigs.k8s.io/cluster-api" packages = [ "pkg/apis/cluster/common", @@ -939,10 +928,9 @@ "pkg/client/informers_generated/externalversions/cluster/v1alpha1", "pkg/client/informers_generated/externalversions/internalinterfaces", "pkg/client/listers_generated/cluster/v1alpha1", - "pkg/controller/config", ] pruneopts = "NUT" - revision = "0a0313c785b36a81ffc74c486128ac8b0c12ab3b" + revision = "cba244b06de7d29777036551e6b32817878d1fcd" [[projects]] digest = "1:2c27ba82e6c5027fb2412bdb8f91a68a02128864b1b62ebb2fd4749a0bdfe719" @@ -991,7 +979,6 @@ "github.com/blang/semver", "github.com/ghodss/yaml", "github.com/golang/glog", - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller", "github.com/openshift/api/config/v1", "github.com/openshift/client-go/config/clientset/versioned", "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1", @@ -1005,21 +992,18 @@ "k8s.io/api/apps/v1", "k8s.io/api/apps/v1beta2", "k8s.io/api/core/v1", - "k8s.io/api/rbac/v1", "k8s.io/api/rbac/v1beta1", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset", "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme", - "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1", - "k8s.io/apimachinery/pkg/api/equality", "k8s.io/apimachinery/pkg/api/errors", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/labels", "k8s.io/apimachinery/pkg/runtime", "k8s.io/apimachinery/pkg/runtime/schema", - "k8s.io/apimachinery/pkg/runtime/serializer", "k8s.io/apimachinery/pkg/types", "k8s.io/apimachinery/pkg/util/runtime", + "k8s.io/apimachinery/pkg/util/sets", "k8s.io/apimachinery/pkg/util/uuid", "k8s.io/apimachinery/pkg/util/wait", "k8s.io/client-go/informers", @@ -1028,9 +1012,7 @@ "k8s.io/client-go/informers/rbac/v1", "k8s.io/client-go/kubernetes", "k8s.io/client-go/kubernetes/scheme", - "k8s.io/client-go/kubernetes/typed/apps/v1", "k8s.io/client-go/kubernetes/typed/core/v1", - "k8s.io/client-go/kubernetes/typed/rbac/v1", "k8s.io/client-go/listers/apps/v1", "k8s.io/client-go/listers/core/v1", "k8s.io/client-go/plugin/pkg/client/auth/gcp", @@ -1049,8 +1031,6 @@ "k8s.io/code-generator/cmd/lister-gen", "k8s.io/code-generator/cmd/openapi-gen", "k8s.io/gengo/args", - "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1", - "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset", "k8s.io/utils/pointer", "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1", "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset", @@ -1058,7 +1038,6 @@ "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions", "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1", "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1", - "sigs.k8s.io/cluster-api/pkg/controller/config", "sigs.k8s.io/controller-runtime/pkg/client", "sigs.k8s.io/controller-runtime/pkg/client/config", "sigs.k8s.io/controller-runtime/pkg/client/fake", diff --git a/Gopkg.toml b/Gopkg.toml index e74e4eea5c..facc6c522b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -32,7 +32,8 @@ required = [ [[override]] name = "sigs.k8s.io/cluster-api" - branch = "master" + # Pin to the same revision as aws actuator has + revision = "cba244b06de7d29777036551e6b32817878d1fcd" [[override]] name = "k8s.io/code-generator" diff --git a/cmd/nodelink-controller/main.go b/cmd/nodelink-controller/main.go index f6de645bc6..f25d7dea65 100644 --- a/cmd/nodelink-controller/main.go +++ b/cmd/nodelink-controller/main.go @@ -23,11 +23,15 @@ import ( "sync" "time" + "github.com/golang/glog" + "github.com/spf13/pflag" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" coreinformers "k8s.io/client-go/informers/core/v1" + "k8s.io/client-go/kubernetes" kubeclientset "k8s.io/client-go/kubernetes" v1core "k8s.io/client-go/kubernetes/typed/core/v1" corelister "k8s.io/client-go/listers/core/v1" @@ -35,20 +39,16 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "github.com/golang/glog" - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller" - "github.com/spf13/pflag" - "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + "sigs.k8s.io/controller-runtime/pkg/client/config" capiv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" capiclient "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + capiinformersfactory "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions" capiinformers "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1" lister "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - "sigs.k8s.io/cluster-api/pkg/controller/config" kubeinformers "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - capiinformersfactory "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions" ) const ( @@ -429,16 +429,12 @@ var ( logLevel string ) -func init() { - config.ControllerConfig.AddFlags(pflag.CommandLine) -} - func main() { pflag.CommandLine.AddGoFlagSet(flag.CommandLine) pflag.Parse() - config, err := controller.GetConfig(config.ControllerConfig.Kubeconfig) + config, err := config.GetConfig() if err != nil { glog.Fatalf("Could not create Config for talking to the apiserver: %v", err) } diff --git a/install/0000_50_machine-api-operator_02_machine.crd.yaml b/install/0000_50_machine-api-operator_02_machine.crd.yaml index 67e7e6be77..9ae6a8d798 100644 --- a/install/0000_50_machine-api-operator_02_machine.crd.yaml +++ b/install/0000_50_machine-api-operator_02_machine.crd.yaml @@ -22,75 +22,40 @@ spec: metadata: type: object spec: - anyOf: - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + properties: + configSource: + type: object + metadata: + type: object + providerSpec: + properties: + value: type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerConfig: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + valueFrom: + properties: + machineClass: + properties: + provider: + type: string + type: object type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet + type: object + taints: + items: type: object - required: - - providerConfig + type: array + versions: + properties: + controlPlane: + type: string + kubelet: + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object status: properties: addresses: diff --git a/install/0000_50_machine-api-operator_03_machineset.crd.yaml b/install/0000_50_machine-api-operator_03_machineset.crd.yaml index f2abb508b5..8b7f574ab4 100644 --- a/install/0000_50_machine-api-operator_03_machineset.crd.yaml +++ b/install/0000_50_machine-api-operator_03_machineset.crd.yaml @@ -26,7 +26,6 @@ spec: metadata: type: object spec: - type: object properties: minReadySeconds: format: int32 @@ -37,82 +36,48 @@ spec: selector: type: object template: - type: object properties: metadata: type: object spec: - anyOf: - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + properties: + configSource: + type: object + metadata: + type: object + providerSpec: + properties: + value: type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerConfig: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + valueFrom: + properties: + machineClass: + properties: + provider: + type: string + type: object type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet + type: object + taints: + items: type: object - required: - - providerConfig + type: array + versions: + properties: + controlPlane: + type: string + kubelet: + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object required: - selector + type: object status: properties: availableReplicas: diff --git a/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml b/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml index 8f5f467490..167075c86d 100644 --- a/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml +++ b/install/0000_50_machine-api-operator_04_machinedeployment.crd.yaml @@ -26,7 +26,6 @@ spec: metadata: type: object spec: - type: object properties: minReadySeconds: format: int32 @@ -55,83 +54,49 @@ spec: type: string type: object template: - type: object properties: metadata: type: object spec: - anyOf: - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerSpec: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + properties: + configSource: + type: object + metadata: + type: object + providerSpec: + properties: + value: type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet - type: object - required: - - providerSpec - - type: object - properties: - configSource: - type: object - metadata: - type: object - providerConfig: - properties: - value: - type: object - valueFrom: - properties: - machineClass: - properties: - provider: - type: string - type: object - type: object - type: object - taints: - items: + valueFrom: + properties: + machineClass: + properties: + provider: + type: string + type: object type: object - type: array - versions: - properties: - controlPlane: - type: string - kubelet: - type: string - required: - - kubelet + type: object + taints: + items: type: object - required: - - providerConfig + type: array + versions: + properties: + controlPlane: + type: string + kubelet: + type: string + required: + - kubelet + type: object + required: + - providerSpec + type: object + type: object required: - selector - template + type: object status: properties: availableReplicas: diff --git a/install/0000_50_machine-api-operator_06_machineclass.crd.yaml b/install/0000_50_machine-api-operator_06_machineclass.crd.yaml index 8ae883f292..1c37256124 100644 --- a/install/0000_50_machine-api-operator_06_machineclass.crd.yaml +++ b/install/0000_50_machine-api-operator_06_machineclass.crd.yaml @@ -12,29 +12,17 @@ spec: scope: Namespaced validation: openAPIV3Schema: - anyOf: - - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - providerSpec: - type: object - required: - - providerSpec - - properties: - apiVersion: - type: string - kind: - type: string - metadata: - type: object - providerConfig: - type: object - required: - - providerConfig + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + providerSpec: + type: object + required: + - providerSpec version: v1alpha1 status: acceptedNames: diff --git a/test/integration/main.go b/test/integration/main.go index 33ee04fb4a..f72317e240 100644 --- a/test/integration/main.go +++ b/test/integration/main.go @@ -13,7 +13,6 @@ import ( log "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "github.com/kubernetes-incubator/apiserver-builder/pkg/controller" appsv1beta2 "k8s.io/api/apps/v1beta2" apiv1 "k8s.io/api/core/v1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -24,6 +23,8 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/tools/clientcmd" + capiv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" capiv1alpha1scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" @@ -58,7 +59,7 @@ type TestConfig struct { // NewTestConfig creates new test config with clients func NewTestConfig(kubeconfig string) *TestConfig { - config, err := controller.GetConfig(kubeconfig) + config, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { glog.Fatalf("Could not create Config for talking to the apiserver: %v", err) } diff --git a/test/integration/manifests/machineset.yaml b/test/integration/manifests/machineset.yaml index b463163e33..cabd583a33 100644 --- a/test/integration/manifests/machineset.yaml +++ b/test/integration/manifests/machineset.yaml @@ -21,7 +21,7 @@ spec: sigs.k8s.io/cluster-api-machine-type: worker sigs.k8s.io/cluster-api-machineset: worker spec: - providerConfig: + providerSpec: value: credentialsSecret: name: aws-credentials-secret diff --git a/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE b/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/vendor/github.com/kubernetes-incubator/apiserver-builder/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go b/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go deleted file mode 100644 index 88084586fb..0000000000 --- a/vendor/github.com/kubernetes-incubator/apiserver-builder/pkg/controller/controller.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controller - -import ( - "time" - - "github.com/golang/glog" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/util/workqueue" -) - -// QueueingEventHandler queues the key for the object on add and update events -type QueueingEventHandler struct { - Queue workqueue.RateLimitingInterface -} - -func (c *QueueingEventHandler) enqueue(obj interface{}) { - key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) - if err != nil { - glog.Errorf("Couldn't get key for object %+v: %v", obj, err) - return - } - c.Queue.Add(key) -} - -func (c *QueueingEventHandler) OnAdd(obj interface{}) { - glog.V(6).Infof("Add event for %+v\n", obj) - c.enqueue(obj) -} - -func (c *QueueingEventHandler) OnUpdate(oldObj, newObj interface{}) { - glog.V(6).Infof("Update event for %+v\n", newObj) - c.enqueue(newObj) -} - -func (c *QueueingEventHandler) OnDelete(obj interface{}) { - glog.V(6).Infof("Delete event for %+v\n", obj) -} - -// QueueWorker continuously runs a Reconcile function against a message Queue -type QueueWorker struct { - Queue workqueue.RateLimitingInterface - MaxRetries int - Name string - Reconcile func(key string) error -} - -// Run schedules a routine to continuously process Queue messages -// until shutdown is closed -func (q *QueueWorker) Run(shutdown <-chan struct{}) { - defer runtime.HandleCrash() - - // Every second, process all messages in the Queue until it is time to shutdown - go wait.Until(q.ProcessAllMessages, time.Second, shutdown) - - go func() { - <-shutdown - - // Stop accepting messages into the Queue - glog.V(1).Infof("Shutting down %s Queue\n", q.Name) - q.Queue.ShutDown() - }() -} - -// ProcessAllMessages tries to process all messages in the Queue -func (q *QueueWorker) ProcessAllMessages() { - for done := false; !done; { - // Process all messages in the Queue - done = q.ProcessMessage() - } -} - -// ProcessMessage tries to process the next message in the Queue, and requeues on an error -func (q *QueueWorker) ProcessMessage() bool { - key, quit := q.Queue.Get() - if quit { - // Queue is empty - return true - } - defer q.Queue.Done(key) - - // Do the work - err := q.Reconcile(key.(string)) - if err == nil { - // Success. Clear the requeue count for this key. - q.Queue.Forget(key) - return false - } - - // Error. Maybe retry if haven't hit the limit. - if q.Queue.NumRequeues(key) < q.MaxRetries { - glog.V(4).Infof("Error handling %s Queue message %v: %v", q.Name, key, err) - q.Queue.AddRateLimited(key) - return false - } - - glog.V(4).Infof("Too many retries for %s Queue message %v: %v", q.Name, key, err) - q.Queue.Forget(key) - return false -} - -type Controller interface { - Run(stopCh <-chan struct{}) - GetName() string -} - -// StartControllerManager -func StartControllerManager(controllers ...Controller) <-chan struct{} { - shutdown := make(chan struct{}) - for _, c := range controllers { - c.Run(shutdown) - } - return shutdown -} - -func GetConfig(kubeconfig string) (*rest.Config, error) { - if len(kubeconfig) > 0 { - return clientcmd.BuildConfigFromFlags("", kubeconfig) - } else { - return rest.InClusterConfig() - } -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go deleted file mode 100644 index 598cfbb2ec..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/clientset.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package clientset - -import ( - glog "github.com/golang/glog" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - apiregistrationv1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1" - apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ApiregistrationV1beta1() apiregistrationv1beta1.ApiregistrationV1beta1Interface - ApiregistrationV1() apiregistrationv1.ApiregistrationV1Interface - // Deprecated: please explicitly pick a version if possible. - Apiregistration() apiregistrationv1.ApiregistrationV1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - apiregistrationV1beta1 *apiregistrationv1beta1.ApiregistrationV1beta1Client - apiregistrationV1 *apiregistrationv1.ApiregistrationV1Client -} - -// ApiregistrationV1beta1 retrieves the ApiregistrationV1beta1Client -func (c *Clientset) ApiregistrationV1beta1() apiregistrationv1beta1.ApiregistrationV1beta1Interface { - return c.apiregistrationV1beta1 -} - -// ApiregistrationV1 retrieves the ApiregistrationV1Client -func (c *Clientset) ApiregistrationV1() apiregistrationv1.ApiregistrationV1Interface { - return c.apiregistrationV1 -} - -// Deprecated: Apiregistration retrieves the default version of ApiregistrationClient. -// Please explicitly pick a version. -func (c *Clientset) Apiregistration() apiregistrationv1.ApiregistrationV1Interface { - return c.apiregistrationV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.apiregistrationV1beta1, err = apiregistrationv1beta1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.apiregistrationV1, err = apiregistrationv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - glog.Errorf("failed to create the DiscoveryClient: %v", err) - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.apiregistrationV1beta1 = apiregistrationv1beta1.NewForConfigOrDie(c) - cs.apiregistrationV1 = apiregistrationv1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.apiregistrationV1beta1 = apiregistrationv1beta1.New(c) - cs.apiregistrationV1 = apiregistrationv1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go deleted file mode 100644 index 3421911a75..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package clientset diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go deleted file mode 100644 index 553953da65..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiregistration_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" - v1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" - "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -type ApiregistrationV1beta1Interface interface { - RESTClient() rest.Interface - APIServicesGetter -} - -// ApiregistrationV1beta1Client is used to interact with features provided by the apiregistration.k8s.io group. -type ApiregistrationV1beta1Client struct { - restClient rest.Interface -} - -func (c *ApiregistrationV1beta1Client) APIServices() APIServiceInterface { - return newAPIServices(c) -} - -// NewForConfig creates a new ApiregistrationV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*ApiregistrationV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ApiregistrationV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new ApiregistrationV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ApiregistrationV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ApiregistrationV1beta1Client for the given RESTClient. -func New(c rest.Interface) *ApiregistrationV1beta1Client { - return &ApiregistrationV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ApiregistrationV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go deleted file mode 100644 index bd42b17c33..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/apiservice.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" - scheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -) - -// APIServicesGetter has a method to return a APIServiceInterface. -// A group's client should implement this interface. -type APIServicesGetter interface { - APIServices() APIServiceInterface -} - -// APIServiceInterface has methods to work with APIService resources. -type APIServiceInterface interface { - Create(*v1beta1.APIService) (*v1beta1.APIService, error) - Update(*v1beta1.APIService) (*v1beta1.APIService, error) - UpdateStatus(*v1beta1.APIService) (*v1beta1.APIService, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.APIService, error) - List(opts v1.ListOptions) (*v1beta1.APIServiceList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.APIService, err error) - APIServiceExpansion -} - -// aPIServices implements APIServiceInterface -type aPIServices struct { - client rest.Interface -} - -// newAPIServices returns a APIServices -func newAPIServices(c *ApiregistrationV1beta1Client) *aPIServices { - return &aPIServices{ - client: c.RESTClient(), - } -} - -// Get takes name of the aPIService, and returns the corresponding aPIService object, and an error if there is any. -func (c *aPIServices) Get(name string, options v1.GetOptions) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Get(). - Resource("apiservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of APIServices that match those selectors. -func (c *aPIServices) List(opts v1.ListOptions) (result *v1beta1.APIServiceList, err error) { - result = &v1beta1.APIServiceList{} - err = c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested aPIServices. -func (c *aPIServices) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("apiservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a aPIService and creates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Create(aPIService *v1beta1.APIService) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Post(). - Resource("apiservices"). - Body(aPIService). - Do(). - Into(result) - return -} - -// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any. -func (c *aPIServices) Update(aPIService *v1beta1.APIService) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - Body(aPIService). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *aPIServices) UpdateStatus(aPIService *v1beta1.APIService) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Put(). - Resource("apiservices"). - Name(aPIService.Name). - SubResource("status"). - Body(aPIService). - Do(). - Into(result) - return -} - -// Delete takes name of the aPIService and deletes it. Returns an error if one occurs. -func (c *aPIServices) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("apiservices"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *aPIServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("apiservices"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched aPIService. -func (c *aPIServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.APIService, err error) { - result = &v1beta1.APIService{} - err = c.client.Patch(pt). - Resource("apiservices"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go deleted file mode 100644 index 11ae7049d1..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go b/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go deleted file mode 100644 index 3b8d40eb2f..0000000000 --- a/vendor/k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1beta1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type APIServiceExpansion interface{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go index 6990f76ebb..81fed067fe 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/consts.go @@ -25,7 +25,7 @@ const ( // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // - // Example: the ProviderConfig specifies an instance type that doesn't exist, + // Example: the ProviderSpec specifies an instance type that doesn't exist, InvalidConfigurationMachineError MachineStatusError = "InvalidConfiguration" // This indicates that the MachineSpec has been updated in a way that @@ -92,7 +92,7 @@ const ( // is not supported by this cluster. This is not a transient error, but // indicates a state that must be fixed before progress can be made. // - // Example: the ProviderConfig specifies an instance type that doesn't exist. + // Example: the ProviderSpec specifies an instance type that doesn't exist. InvalidConfigurationMachineSetError MachineSetStatusError = "InvalidConfiguration" ) @@ -100,6 +100,6 @@ type MachineDeploymentStrategyType string const ( // Replace the old MachineSet by new one using rolling update - // i.e gradually scale down the old MachineSet and scale up the new one. + // i.e. gradually scale down the old MachineSet and scale up the new one. RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" ) diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go index 1ef4543d89..276cbe9be5 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common/plugins.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/golang/glog" + "k8s.io/klog" ) var ( @@ -34,9 +34,9 @@ func RegisterClusterProvisioner(name string, provisioner interface{}) { providersMutex.Lock() defer providersMutex.Unlock() if _, found := providers[name]; found { - glog.Fatalf("Cluster provisioner %q was registered twice", name) + klog.Fatalf("Cluster provisioner %q was registered twice", name) } - glog.V(1).Infof("Registered cluster provisioner %q", name) + klog.V(1).Infof("Registered cluster provisioner %q", name) providers[name] = provisioner } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go index 0aabc0c98f..c0cd29a46b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/cluster_types.go @@ -29,6 +29,7 @@ const ClusterFinalizer = "cluster.cluster.k8s.io" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +/// [Cluster] // Cluster is the Schema for the clusters API // +k8s:openapi-gen=true // +kubebuilder:subresource:status @@ -40,6 +41,9 @@ type Cluster struct { Status ClusterStatus `json:"status,omitempty"` } +/// [Cluster] + +/// [ClusterSpec] // ClusterSpec defines the desired state of Cluster type ClusterSpec struct { // Cluster network configuration @@ -50,27 +54,36 @@ type ClusterSpec struct { // their own versioned API types that should be // serialized/deserialized from this field. // +optional - ProviderConfig ProviderConfig `json:"providerConfig,omitempty"` + ProviderSpec ProviderSpec `json:"providerSpec,omitempty"` } +/// [ClusterSpec] + +/// [ClusterNetworkingConfig] // ClusterNetworkingConfig specifies the different networking // parameters for a cluster. type ClusterNetworkingConfig struct { // The network ranges from which service VIPs are allocated. Services NetworkRanges `json:"services"` - // The network ranges from which POD networks are allocated. + // The network ranges from which Pod networks are allocated. Pods NetworkRanges `json:"pods"` // Domain name for services. ServiceDomain string `json:"serviceDomain"` } +/// [ClusterNetworkingConfig] + +/// [NetworkRanges] // NetworkRanges represents ranges of network addresses. type NetworkRanges struct { CIDRBlocks []string `json:"cidrBlocks"` } +/// [NetworkRanges] + +/// [ClusterStatus] // ClusterStatus defines the observed state of Cluster type ClusterStatus struct { // APIEndpoint represents the endpoint to communicate with the IP. @@ -100,6 +113,9 @@ type ClusterStatus struct { ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` } +/// [ClusterStatus] + +/// [APIEndpoint] // APIEndpoint represents a reachable Kubernetes API endpoint. type APIEndpoint struct { // The hostname on which the API server is serving. @@ -109,6 +125,8 @@ type APIEndpoint struct { Port int `json:"port"` } +/// [APIEndpoint] + func (o *Cluster) Validate() field.ErrorList { errors := field.ErrorList{} // perform validation here and add to errors using field.Invalid diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go index 8f9d36fc43..7a9c647fe2 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/common_types.go @@ -16,10 +16,13 @@ limitations under the License. package v1alpha1 -import "k8s.io/apimachinery/pkg/runtime" +import ( + corev1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) -// ProviderConfig defines the configuration to use during node creation. -type ProviderConfig struct { +// ProviderSpec defines the configuration to use during node creation. +type ProviderSpec struct { // No more than one of the following may be specified. @@ -33,11 +36,23 @@ type ProviderConfig struct { // Source for the provider configuration. Cannot be used if value is // not empty. // +optional - ValueFrom *ProviderConfigSource `json:"valueFrom,omitempty"` + ValueFrom *ProviderSpecSource `json:"valueFrom,omitempty"` } -// ProviderConfigSource represents a source for the provider-specific +// ProviderSpecSource represents a source for the provider-specific // resource configuration. -type ProviderConfigSource struct { - // TODO(roberthbailey): Fill these in later +type ProviderSpecSource struct { + // The machine class from which the provider config should be sourced. + // +optional + MachineClass *MachineClassRef `json:"machineClass,omitempty"` +} + +// MachineClassRef is a reference to the MachineClass object. Controllers should find the right MachineClass using this reference. +type MachineClassRef struct { + // +optional + *corev1.ObjectReference `json:",inline"` + + // Provider is the name of the cloud-provider which MachineClass is intended for. + // +optional + Provider string `json:"provider,omitempty"` } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go new file mode 100644 index 0000000000..f9aeb4b438 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/defaults.go @@ -0,0 +1,74 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" + "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" +) + +// PopulateDefaultsMachineDeployment fills in default field values +// Currently it is called after reading objects, but it could be called in an admission webhook also +func PopulateDefaultsMachineDeployment(d *MachineDeployment) { + if d.Spec.Replicas == nil { + d.Spec.Replicas = new(int32) + *d.Spec.Replicas = 1 + } + + if d.Spec.MinReadySeconds == nil { + d.Spec.MinReadySeconds = new(int32) + *d.Spec.MinReadySeconds = 0 + } + + if d.Spec.RevisionHistoryLimit == nil { + d.Spec.RevisionHistoryLimit = new(int32) + *d.Spec.RevisionHistoryLimit = 1 + } + + if d.Spec.ProgressDeadlineSeconds == nil { + d.Spec.ProgressDeadlineSeconds = new(int32) + *d.Spec.ProgressDeadlineSeconds = 600 + } + + if d.Spec.Strategy == nil { + d.Spec.Strategy = &MachineDeploymentStrategy{} + } + + if d.Spec.Strategy.Type == "" { + d.Spec.Strategy.Type = common.RollingUpdateMachineDeploymentStrategyType + } + + // Default RollingUpdate strategy only if strategy type is RollingUpdate. + if d.Spec.Strategy.Type == common.RollingUpdateMachineDeploymentStrategyType { + if d.Spec.Strategy.RollingUpdate == nil { + d.Spec.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + } + if d.Spec.Strategy.RollingUpdate.MaxSurge == nil { + ios1 := intstr.FromInt(1) + d.Spec.Strategy.RollingUpdate.MaxSurge = &ios1 + } + if d.Spec.Strategy.RollingUpdate.MaxUnavailable == nil { + ios0 := intstr.FromInt(0) + d.Spec.Strategy.RollingUpdate.MaxUnavailable = &ios0 + } + } + + if len(d.Namespace) == 0 { + d.Namespace = metav1.NamespaceDefault + } +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go index 76b87b378f..5a10bba39f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machine_types.go @@ -24,12 +24,13 @@ import ( "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) -// Finalizer is set on PreareForCreate callback +// Finalizer is set on PrepareForCreate callback const MachineFinalizer = "machine.cluster.k8s.io" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +/// [Machine] // Machine is the Schema for the machines API // +k8s:openapi-gen=true // +kubebuilder:subresource:status @@ -41,6 +42,9 @@ type Machine struct { Status MachineStatus `json:"status,omitempty"` } +/// [Machine] + +/// [MachineSpec] // MachineSpec defines the desired state of Machine type MachineSpec struct { // This ObjectMeta will autopopulate the Node created. Use this to @@ -57,7 +61,7 @@ type MachineSpec struct { // Provider-specific configuration to use during node creation. // +optional - ProviderConfig ProviderConfig `json:"providerConfig"` + ProviderSpec ProviderSpec `json:"providerSpec"` // Versions of key software to use. This field is optional at cluster // creation time, and omitting the field indicates that the cluster @@ -70,13 +74,16 @@ type MachineSpec struct { // To populate in the associated Node for dynamic kubelet config. This // field already exists in Node, so any updates to it in the Machine - // spec will be automatially copied to the linked NodeRef from the + // spec will be automatically copied to the linked NodeRef from the // status. The rest of dynamic kubelet config support should then work // as-is. // +optional ConfigSource *corev1.NodeConfigSource `json:"configSource,omitempty"` } +/// [MachineSpec] + +/// [MachineStatus] // MachineStatus defines the observed state of Machine type MachineStatus struct { // If the corresponding Node exists, this will point to its object. @@ -144,8 +151,40 @@ type MachineStatus struct { // Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition // +optional Conditions []corev1.NodeCondition `json:"conditions,omitempty"` + + // LastOperation describes the last-operation performed by the machine-controller. + // This API should be useful as a history in terms of the latest operation performed on the + // specific machine. It should also convey the state of the latest-operation for example if + // it is still on-going, failed or completed successfully. + // +optional + LastOperation *LastOperation `json:"lastOperation,omitempty"` + + // Phase represents the current phase of machine actuation. + // E.g. Pending, Running, Terminating, Failed etc. + // +optional + Phase *string `json:"phase,omitempty"` +} + +// LastOperation represents the detail of the last performed operation on the MachineObject. +type LastOperation struct { + // Description is the human-readable description of the last operation. + Description *string `json:"description,omitempty"` + + // LastUpdateTime is the timestamp at which LastOperation API was last-updated. + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + + // State is the current status of the last performed operation. + // E.g. Processing, Failed, Successful etc + State *string `json:"state,omitempty"` + + // Type is the type of operation which was last performed. + // E.g. Create, Delete, Update etc + Type *string `json:"type,omitempty"` } +/// [MachineStatus] + +/// [MachineVersionInfo] type MachineVersionInfo struct { // Semantic version of kubelet to run Kubelet string `json:"kubelet"` @@ -157,6 +196,8 @@ type MachineVersionInfo struct { ControlPlane string `json:"controlPlane,omitempty"` } +/// [MachineVersionInfo] + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineList contains a list of Machine diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go new file mode 100644 index 0000000000..7844f6cfa4 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineclass_types.go @@ -0,0 +1,78 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +/// [MachineClass] +// MachineClass can be used to templatize and re-use provider configuration +// across multiple Machines / MachineSets / MachineDeployments. +// +k8s:openapi-gen=true +// +resource:path=machineclasses +type MachineClass struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // The total capacity available on this machine type (cpu/memory/disk). + // + // WARNING: It is up to the creator of the MachineClass to ensure that + // this field is consistent with the underlying machine that will + // be provisioned when this class is used, to inform higher level + // automation (e.g. the cluster autoscaler). + // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. + // Capacity corev1.ResourceList `json:"capacity"` + + // How much capacity is actually allocatable on this machine. + // Must be equal to or less than the capacity, and when less + // indicates the resources reserved for system overhead. + // + // WARNING: It is up to the creator of the MachineClass to ensure that + // this field is consistent with the underlying machine that will + // be provisioned when this class is used, to inform higher level + // automation (e.g. the cluster autoscaler). + // TODO(hardikdr) Add allocatable field once requirements are clear from autoscaler-clusterapi // integration topic. + // Allocatable corev1.ResourceList `json:"allocatable"` + + // Provider-specific configuration to use during node creation. + ProviderSpec runtime.RawExtension `json:"providerSpec"` + + // TODO: should this use an api.ObjectReference to a 'MachineTemplate' instead? + // A link to the MachineTemplate that will be used to create provider + // specific configuration for Machines of this class. + // MachineTemplate corev1.ObjectReference `json:machineTemplate` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// MachineClassList contains a list of MachineClasses +type MachineClassList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineClass `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineClass{}, &MachineClassList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go index d3017c05d7..690d095ad0 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machinedeployment_types.go @@ -23,6 +23,7 @@ import ( "sigs.k8s.io/cluster-api/pkg/apis/cluster/common" ) +/// [MachineDeploymentSpec] // MachineDeploymentSpec defines the desired state of MachineDeployment type MachineDeploymentSpec struct { // Number of desired machines. Defaults to 1. @@ -40,7 +41,7 @@ type MachineDeploymentSpec struct { // The deployment strategy to use to replace existing machines with // new ones. // +optional - Strategy MachineDeploymentStrategy `json:"strategy,omitempty"` + Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` // Minimum number of seconds for which a newly created machine should // be ready. @@ -67,6 +68,9 @@ type MachineDeploymentSpec struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } +/// [MachineDeploymentSpec] + +/// [MachineDeploymentStrategy] // MachineDeploymentStrategy describes how to replace existing machines // with new ones. type MachineDeploymentStrategy struct { @@ -82,6 +86,9 @@ type MachineDeploymentStrategy struct { RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` } +/// [MachineDeploymentStrategy] + +/// [MachineRollingUpdateDeployment] // Spec to control the desired behavior of rolling update. type MachineRollingUpdateDeployment struct { // The maximum number of machines that can be unavailable during the update. @@ -116,6 +123,9 @@ type MachineRollingUpdateDeployment struct { MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"` } +/// [MachineRollingUpdateDeployment] + +/// [MachineDeploymentStatus] // MachineDeploymentStatus defines the observed state of MachineDeployment type MachineDeploymentStatus struct { // The generation observed by the deployment controller. @@ -150,12 +160,16 @@ type MachineDeploymentStatus struct { UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"` } +/// [MachineDeploymentStatus] + // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +/// [MachineDeployment] // MachineDeployment is the Schema for the machinedeployments API // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector type MachineDeployment struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -164,6 +178,8 @@ type MachineDeployment struct { Status MachineDeploymentStatus `json:"status,omitempty"` } +/// [MachineDeployment] + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // MachineDeploymentList contains a list of MachineDeployment diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go index de5d52dae9..40c04286a3 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/machineset_types.go @@ -30,9 +30,11 @@ import ( // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +/// [MachineSet] // MachineSet ensures that a specified number of machines replicas are running at any given time. // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.labelSelector type MachineSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -41,6 +43,9 @@ type MachineSet struct { Status MachineSetStatus `json:"status,omitempty"` } +/// [MachineSet] + +/// [MachineSetSpec] // MachineSetSpec defines the desired state of MachineSet type MachineSetSpec struct { // Replicas is the number of desired replicas. @@ -49,7 +54,7 @@ type MachineSetSpec struct { // +optional Replicas *int32 `json:"replicas,omitempty"` - // Minimum number of seconds for which a newly created machine should be ready. + // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. // Defaults to 0 (machine will be considered available as soon as it is ready) // +optional MinReadySeconds int32 `json:"minReadySeconds,omitempty"` @@ -66,7 +71,10 @@ type MachineSetSpec struct { Template MachineTemplateSpec `json:"template,omitempty"` } -// MachineTemplateSpec describes the data a machine should have when created from a template +/// [MachineSetSpec] // doxygen marker + +/// [MachineTemplateSpec] // doxygen marker +// MachineTemplateSpec describes the data needed to create a Machine from a template type MachineTemplateSpec struct { // Standard object's metadata. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata @@ -79,6 +87,9 @@ type MachineTemplateSpec struct { Spec MachineSpec `json:"spec,omitempty"` } +/// [MachineTemplateSpec] + +/// [MachineSetStatus] // MachineSetStatus defines the observed state of MachineSet type MachineSetStatus struct { // Replicas is the most recently observed number of replicas. @@ -109,7 +120,7 @@ type MachineSetStatus struct { // These fields should not be set for transitive errors that a // controller faces that are expected to be fixed automatically over // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachineTemplates's spec or the configuration of + // fundamentally wrong with the MachineTemplate's spec or the configuration of // the machine controller, and that manual intervention is required. Examples // of terminal errors would be invalid combinations of settings in the // spec, values that are unsupported by the machine controller, or the @@ -124,6 +135,8 @@ type MachineSetStatus struct { ErrorMessage *string `json:"errorMessage,omitempty"` } +/// [MachineSetStatus] + func (machineSet *MachineSet) Validate() field.ErrorList { errors := field.ErrorList{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go index 24c00b0cde..9b0a035208 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go @@ -126,7 +126,7 @@ func (in *ClusterNetworkingConfig) DeepCopy() *ClusterNetworkingConfig { func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in in.ClusterNetwork.DeepCopyInto(&out.ClusterNetwork) - in.ProviderConfig.DeepCopyInto(&out.ProviderConfig) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) return } @@ -166,6 +166,41 @@ func (in *ClusterStatus) DeepCopy() *ClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LastOperation) DeepCopyInto(out *LastOperation) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LastOperation. +func (in *LastOperation) DeepCopy() *LastOperation { + if in == nil { + return nil + } + out := new(LastOperation) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Machine) DeepCopyInto(out *Machine) { *out = *in @@ -194,6 +229,87 @@ func (in *Machine) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineClass) DeepCopyInto(out *MachineClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClass. +func (in *MachineClass) DeepCopy() *MachineClass { + if in == nil { + return nil + } + out := new(MachineClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClass) 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 *MachineClassList) DeepCopyInto(out *MachineClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassList. +func (in *MachineClassList) DeepCopy() *MachineClassList { + if in == nil { + return nil + } + out := new(MachineClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineClassList) 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 *MachineClassRef) DeepCopyInto(out *MachineClassRef) { + *out = *in + if in.ObjectReference != nil { + in, out := &in.ObjectReference, &out.ObjectReference + *out = new(v1.ObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineClassRef. +func (in *MachineClassRef) DeepCopy() *MachineClassRef { + if in == nil { + return nil + } + out := new(MachineClassRef) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { *out = *in @@ -265,7 +381,11 @@ func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { } in.Selector.DeepCopyInto(&out.Selector) in.Template.DeepCopyInto(&out.Template) - in.Strategy.DeepCopyInto(&out.Strategy) + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(MachineDeploymentStrategy) + (*in).DeepCopyInto(*out) + } if in.MinReadySeconds != nil { in, out := &in.MinReadySeconds, &out.MinReadySeconds *out = new(int32) @@ -511,7 +631,7 @@ func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - in.ProviderConfig.DeepCopyInto(&out.ProviderConfig) + in.ProviderSpec.DeepCopyInto(&out.ProviderSpec) out.Versions = in.Versions if in.ConfigSource != nil { in, out := &in.ConfigSource, &out.ConfigSource @@ -575,6 +695,16 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.LastOperation != nil { + in, out := &in.LastOperation, &out.LastOperation + *out = new(LastOperation) + (*in).DeepCopyInto(*out) + } + if in.Phase != nil { + in, out := &in.Phase, &out.Phase + *out = new(string) + **out = **in + } return } @@ -644,7 +774,7 @@ func (in *NetworkRanges) DeepCopy() *NetworkRanges { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig) { +func (in *ProviderSpec) DeepCopyInto(out *ProviderSpec) { *out = *in if in.Value != nil { in, out := &in.Value, &out.Value @@ -653,34 +783,39 @@ func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig) { } if in.ValueFrom != nil { in, out := &in.ValueFrom, &out.ValueFrom - *out = new(ProviderConfigSource) - **out = **in + *out = new(ProviderSpecSource) + (*in).DeepCopyInto(*out) } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfig. -func (in *ProviderConfig) DeepCopy() *ProviderConfig { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpec. +func (in *ProviderSpec) DeepCopy() *ProviderSpec { if in == nil { return nil } - out := new(ProviderConfig) + out := new(ProviderSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProviderConfigSource) DeepCopyInto(out *ProviderConfigSource) { +func (in *ProviderSpecSource) DeepCopyInto(out *ProviderSpecSource) { *out = *in + if in.MachineClass != nil { + in, out := &in.MachineClass, &out.MachineClass + *out = new(MachineClassRef) + (*in).DeepCopyInto(*out) + } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigSource. -func (in *ProviderConfigSource) DeepCopy() *ProviderConfigSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderSpecSource. +func (in *ProviderSpecSource) DeepCopy() *ProviderSpecSource { if in == nil { return nil } - out := new(ProviderConfigSource) + out := new(ProviderSpecSource) in.DeepCopyInto(out) return out } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go index 232a365f60..1d5483d3f6 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/clientset.go @@ -19,7 +19,6 @@ limitations under the License. package clientset import ( - glog "github.com/golang/glog" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -74,7 +73,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { - glog.Errorf("failed to create the DiscoveryClient: %v", err) return nil, err } return &cs, nil diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go index 0b7d494e66..ecb609f771 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme/register.go @@ -23,16 +23,15 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + clusterv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -40,16 +39,18 @@ func init() { // // import ( // "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -func AddToScheme(scheme *runtime.Scheme) { - clusterv1alpha1.AddToScheme(scheme) +var AddToScheme = localSchemeBuilder.AddToScheme +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go index 74705e452e..85c29d2fb7 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/cluster_client.go @@ -29,6 +29,7 @@ type ClusterV1alpha1Interface interface { RESTClient() rest.Interface ClustersGetter MachinesGetter + MachineClassesGetter MachineDeploymentsGetter MachineSetsGetter } @@ -46,6 +47,10 @@ func (c *ClusterV1alpha1Client) Machines(namespace string) MachineInterface { return newMachines(c, namespace) } +func (c *ClusterV1alpha1Client) MachineClasses(namespace string) MachineClassInterface { + return newMachineClasses(c, namespace) +} + func (c *ClusterV1alpha1Client) MachineDeployments(namespace string) MachineDeploymentInterface { return newMachineDeployments(c, namespace) } diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go index 6a549b01a9..2bb55c714f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/generated_expansion.go @@ -22,6 +22,8 @@ type ClusterExpansion interface{} type MachineExpansion interface{} +type MachineClassExpansion interface{} + type MachineDeploymentExpansion interface{} type MachineSetExpansion interface{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go new file mode 100644 index 0000000000..9d685d94fd --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/typed/cluster/v1alpha1/machineclass.go @@ -0,0 +1,157 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + scheme "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset/scheme" +) + +// MachineClassesGetter has a method to return a MachineClassInterface. +// A group's client should implement this interface. +type MachineClassesGetter interface { + MachineClasses(namespace string) MachineClassInterface +} + +// MachineClassInterface has methods to work with MachineClass resources. +type MachineClassInterface interface { + Create(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) + Update(*v1alpha1.MachineClass) (*v1alpha1.MachineClass, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.MachineClass, error) + List(opts v1.ListOptions) (*v1alpha1.MachineClassList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) + MachineClassExpansion +} + +// machineClasses implements MachineClassInterface +type machineClasses struct { + client rest.Interface + ns string +} + +// newMachineClasses returns a MachineClasses +func newMachineClasses(c *ClusterV1alpha1Client, namespace string) *machineClasses { + return &machineClasses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. +func (c *machineClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. +func (c *machineClasses) List(opts v1.ListOptions) (result *v1alpha1.MachineClassList, err error) { + result = &v1alpha1.MachineClassList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineClasses. +func (c *machineClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Create(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machineclasses"). + Body(machineClass). + Do(). + Into(result) + return +} + +// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. +func (c *machineClasses) Update(machineClass *v1alpha1.MachineClass) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machineclasses"). + Name(machineClass.Name). + Body(machineClass). + Do(). + Into(result) + return +} + +// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. +func (c *machineClasses) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machineclasses"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched machineClass. +func (c *machineClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MachineClass, err error) { + result = &v1alpha1.MachineClass{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machineclasses"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go index f73276b80f..945aef05d6 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package cluster diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go index 5fcd7c4acb..e5c750411c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/cluster.go @@ -14,20 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - cluster_v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - time "time" ) // ClusterInformer provides access to a shared informer and lister for @@ -69,7 +70,7 @@ func NewFilteredClusterInformer(client clientset.Interface, namespace string, re return client.ClusterV1alpha1().Clusters(namespace).Watch(options) }, }, - &cluster_v1alpha1.Cluster{}, + &clusterv1alpha1.Cluster{}, resyncPeriod, indexers, ) @@ -80,7 +81,7 @@ func (f *clusterInformer) defaultInformer(client clientset.Interface, resyncPeri } func (f *clusterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cluster_v1alpha1.Cluster{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha1.Cluster{}, f.defaultInformer) } func (f *clusterInformer) Lister() v1alpha1.ClusterLister { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go index 5667ff4a74..40562f0dfb 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/interface.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 @@ -28,6 +28,8 @@ type Interface interface { Clusters() ClusterInformer // Machines returns a MachineInformer. Machines() MachineInformer + // MachineClasses returns a MachineClassInformer. + MachineClasses() MachineClassInformer // MachineDeployments returns a MachineDeploymentInformer. MachineDeployments() MachineDeploymentInformer // MachineSets returns a MachineSetInformer. @@ -55,6 +57,11 @@ func (v *version) Machines() MachineInformer { return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// MachineClasses returns a MachineClassInformer. +func (v *version) MachineClasses() MachineClassInformer { + return &machineClassInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // MachineDeployments returns a MachineDeploymentInformer. func (v *version) MachineDeployments() MachineDeploymentInformer { return &machineDeploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go index 8df5041553..c0be887be8 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machine.go @@ -14,20 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - cluster_v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - time "time" ) // MachineInformer provides access to a shared informer and lister for @@ -69,7 +70,7 @@ func NewFilteredMachineInformer(client clientset.Interface, namespace string, re return client.ClusterV1alpha1().Machines(namespace).Watch(options) }, }, - &cluster_v1alpha1.Machine{}, + &clusterv1alpha1.Machine{}, resyncPeriod, indexers, ) @@ -80,7 +81,7 @@ func (f *machineInformer) defaultInformer(client clientset.Interface, resyncPeri } func (f *machineInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cluster_v1alpha1.Machine{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha1.Machine{}, f.defaultInformer) } func (f *machineInformer) Lister() v1alpha1.MachineLister { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go new file mode 100644 index 0000000000..d224d5516f --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineclass.go @@ -0,0 +1,89 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" + internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" + v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" +) + +// MachineClassInformer provides access to a shared informer and lister for +// MachineClasses. +type MachineClassInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.MachineClassLister +} + +type machineClassInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineClassInformer constructs a new informer for MachineClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMachineClassInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineClassInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineClassInformer constructs a new informer for MachineClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMachineClassInformer(client clientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ClusterV1alpha1().MachineClasses(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ClusterV1alpha1().MachineClasses(namespace).Watch(options) + }, + }, + &clusterv1alpha1.MachineClass{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineClassInformer) defaultInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineClassInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&clusterv1alpha1.MachineClass{}, f.defaultInformer) +} + +func (f *machineClassInformer) Lister() v1alpha1.MachineClassLister { + return v1alpha1.NewMachineClassLister(f.Informer().GetIndexer()) +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go index 2264bc59f1..5c574e7cde 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machinedeployment.go @@ -14,20 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - cluster_v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - time "time" ) // MachineDeploymentInformer provides access to a shared informer and lister for @@ -69,7 +70,7 @@ func NewFilteredMachineDeploymentInformer(client clientset.Interface, namespace return client.ClusterV1alpha1().MachineDeployments(namespace).Watch(options) }, }, - &cluster_v1alpha1.MachineDeployment{}, + &clusterv1alpha1.MachineDeployment{}, resyncPeriod, indexers, ) @@ -80,7 +81,7 @@ func (f *machineDeploymentInformer) defaultInformer(client clientset.Interface, } func (f *machineDeploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cluster_v1alpha1.MachineDeployment{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha1.MachineDeployment{}, f.defaultInformer) } func (f *machineDeploymentInformer) Lister() v1alpha1.MachineDeploymentLister { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go index 9397d1a395..b24fc14a5f 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster/v1alpha1/machineset.go @@ -14,20 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha1 import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" - cluster_v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" + clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" v1alpha1 "sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1" - time "time" ) // MachineSetInformer provides access to a shared informer and lister for @@ -69,7 +70,7 @@ func NewFilteredMachineSetInformer(client clientset.Interface, namespace string, return client.ClusterV1alpha1().MachineSets(namespace).Watch(options) }, }, - &cluster_v1alpha1.MachineSet{}, + &clusterv1alpha1.MachineSet{}, resyncPeriod, indexers, ) @@ -80,7 +81,7 @@ func (f *machineSetInformer) defaultInformer(client clientset.Interface, resyncP } func (f *machineSetInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cluster_v1alpha1.MachineSet{}, f.defaultInformer) + return f.factory.InformerFor(&clusterv1alpha1.MachineSet{}, f.defaultInformer) } func (f *machineSetInformer) Lister() v1alpha1.MachineSetLister { diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go index 479bdd7be6..29dfc9a45c 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/factory.go @@ -14,29 +14,34 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( + reflect "reflect" + sync "sync" + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - reflect "reflect" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" cluster "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/cluster" internalinterfaces "sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces" - sync "sync" - time "time" ) +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + type sharedInformerFactory struct { client clientset.Interface namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc lock sync.Mutex defaultResync time.Duration + customResync map[reflect.Type]time.Duration informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -44,23 +49,62 @@ type sharedInformerFactory struct { startedInformers map[reflect.Type]bool } -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client clientset.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) + return NewSharedInformerFactoryWithOptions(client, defaultResync) } // NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. // Listers obtained via this SharedInformerFactory will be subject to the same filters // as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead func NewFilteredSharedInformerFactory(client clientset.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return &sharedInformerFactory{ + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client clientset.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ client: client, - namespace: namespace, - tweakListOptions: tweakListOptions, + namespace: v1.NamespaceAll, defaultResync: defaultResync, informers: make(map[reflect.Type]cache.SharedIndexInformer), startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory } // Start initializes all requested informers. @@ -109,7 +153,13 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal if exists { return informer } - informer = newFunc(f.client, f.defaultResync) + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) f.informers[informerType] = informer return informer diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go index 2edc65a5b6..a51e0ed76b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/generic.go @@ -14,12 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions import ( "fmt" + schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" @@ -56,6 +57,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().Clusters().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("machines"): return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().Machines().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("machineclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineClasses().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("machinedeployments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Cluster().V1alpha1().MachineDeployments().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("machinesets"): diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go index bd8ddd811c..272ebb1980 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/informers_generated/externalversions/internalinterfaces/factory_interfaces.go @@ -14,16 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces import ( + time "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" clientset "sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset" - time "time" ) type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go index 07be29b0d3..e7d199083b 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/cluster.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go index ea84125bd4..8daf52835e 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/expansion_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 @@ -34,6 +34,14 @@ type MachineListerExpansion interface{} // MachineNamespaceLister. type MachineNamespaceListerExpansion interface{} +// MachineClassListerExpansion allows custom methods to be added to +// MachineClassLister. +type MachineClassListerExpansion interface{} + +// MachineClassNamespaceListerExpansion allows custom methods to be added to +// MachineClassNamespaceLister. +type MachineClassNamespaceListerExpansion interface{} + // MachineDeploymentListerExpansion allows custom methods to be added to // MachineDeploymentLister. type MachineDeploymentListerExpansion interface{} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go index db3d379207..408a2a9837 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machine.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go new file mode 100644 index 0000000000..61dde88f21 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineclass.go @@ -0,0 +1,94 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" +) + +// MachineClassLister helps list MachineClasses. +type MachineClassLister interface { + // List lists all MachineClasses in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.MachineClass, err error) + // MachineClasses returns an object that can list and get MachineClasses. + MachineClasses(namespace string) MachineClassNamespaceLister + MachineClassListerExpansion +} + +// machineClassLister implements the MachineClassLister interface. +type machineClassLister struct { + indexer cache.Indexer +} + +// NewMachineClassLister returns a new MachineClassLister. +func NewMachineClassLister(indexer cache.Indexer) MachineClassLister { + return &machineClassLister{indexer: indexer} +} + +// List lists all MachineClasses in the indexer. +func (s *machineClassLister) List(selector labels.Selector) (ret []*v1alpha1.MachineClass, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.MachineClass)) + }) + return ret, err +} + +// MachineClasses returns an object that can list and get MachineClasses. +func (s *machineClassLister) MachineClasses(namespace string) MachineClassNamespaceLister { + return machineClassNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineClassNamespaceLister helps list and get MachineClasses. +type MachineClassNamespaceLister interface { + // List lists all MachineClasses in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.MachineClass, err error) + // Get retrieves the MachineClass from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.MachineClass, error) + MachineClassNamespaceListerExpansion +} + +// machineClassNamespaceLister implements the MachineClassNamespaceLister +// interface. +type machineClassNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineClasses in the indexer for a given namespace. +func (s machineClassNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.MachineClass, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.MachineClass)) + }) + return ret, err +} + +// Get retrieves the MachineClass from the indexer for a given namespace and name. +func (s machineClassNamespaceLister) Get(name string) (*v1alpha1.MachineClass, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("machineclass"), name) + } + return obj.(*v1alpha1.MachineClass), nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go index a426fb6791..265e4358e7 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machinedeployment.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go index b8e9eebe06..da73376fa2 100644 --- a/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go +++ b/vendor/sigs.k8s.io/cluster-api/pkg/client/listers_generated/cluster/v1alpha1/machineset.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha1 diff --git a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go b/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go deleted file mode 100644 index dc4bef508e..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/pkg/controller/config/configuration.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package config - -import ( - "time" - - "github.com/spf13/pflag" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/leaderelection/resourcelock" -) - -// This is a COPY from kubernetes source tree to avoid importing the entire kubernetes tree. - -// LeaderElectionConfiguration defines the configuration of leader election -// clients for components that can run with leader election enabled. -type LeaderElectionConfiguration struct { - // LeaderElect enables a leader election client to gain leadership - // before executing the main loop. Enable this when running replicated - // components for high availability. - LeaderElect bool - // LeaseDuration is the duration that non-leader candidates will wait - // after observing a leadership renewal until attempting to acquire - // leadership of a led but unrenewed leader slot. This is effectively the - // maximum duration that a leader can be stopped before it is replaced - // by another candidate. This is only applicable if leader election is - // enabled. - LeaseDuration metav1.Duration - // RenewDeadline is the interval between attempts by the acting master to - // renew a leadership slot before it stops leading. This must be less - // than or equal to the lease duration. This is only applicable if leader - // election is enabled. - RenewDeadline metav1.Duration - // RetryPeriod is the duration the clients should wait between attempting - // acquisition and renewal of a leadership. This is only applicable if - // leader election is enabled. - RetryPeriod metav1.Duration - // ResourceLock indicates the resource object type that will be used to lock - // during leader election cycles. - ResourceLock string -} - -type Configuration struct { - Kubeconfig string - WorkerCount int - leaderElectionConfig *LeaderElectionConfiguration -} - -const ( - // DefaultLeaseDuration is the default lease duration for leader election - DefaultLeaseDuration = 15 * time.Second - // DefaultRenewDeadline is the default renew duration for leader election - DefaultRenewDeadline = 10 * time.Second - // DefaultRetryPeriod is the default retry period for leader election - DefaultRetryPeriod = 2 * time.Second -) - -var ControllerConfig = Configuration{ - WorkerCount: 5, // Default 5 worker. - leaderElectionConfig: &LeaderElectionConfiguration{ - LeaderElect: false, - LeaseDuration: metav1.Duration{Duration: DefaultLeaseDuration}, - RenewDeadline: metav1.Duration{Duration: DefaultRenewDeadline}, - RetryPeriod: metav1.Duration{Duration: DefaultRetryPeriod}, - ResourceLock: resourcelock.EndpointsResourceLock, - }, -} - -func GetLeaderElectionConfig() *LeaderElectionConfiguration { - return ControllerConfig.leaderElectionConfig -} - -func (c *Configuration) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&c.Kubeconfig, "kubeconfig", c.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") - fs.IntVar(&c.WorkerCount, "workers", c.WorkerCount, "The number of workers for controller.") - - AddLeaderElectionFlags(c.leaderElectionConfig, fs) -} - -func AddLeaderElectionFlags(l *LeaderElectionConfiguration, fs *pflag.FlagSet) { - fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+ - "Start a leader election client and gain leadership before "+ - "executing the main loop. Enable this when running replicated "+ - "components for high availability.") - fs.DurationVar(&l.LeaseDuration.Duration, "leader-elect-lease-duration", l.LeaseDuration.Duration, ""+ - "The duration that non-leader candidates will wait after observing a leadership "+ - "renewal until attempting to acquire leadership of a led but unrenewed leader "+ - "slot. This is effectively the maximum duration that a leader can be stopped "+ - "before it is replaced by another candidate. This is only applicable if leader "+ - "election is enabled.") - fs.DurationVar(&l.RenewDeadline.Duration, "leader-elect-renew-deadline", l.RenewDeadline.Duration, ""+ - "The interval between attempts by the acting master to renew a leadership slot "+ - "before it stops leading. This must be less than or equal to the lease duration. "+ - "This is only applicable if leader election is enabled.") - fs.DurationVar(&l.RetryPeriod.Duration, "leader-elect-retry-period", l.RetryPeriod.Duration, ""+ - "The duration the clients should wait between attempting acquisition and renewal "+ - "of a leadership. This is only applicable if leader election is enabled.") - fs.StringVar(&l.ResourceLock, "leader-elect-resource-lock", l.ResourceLock, ""+ - "The type of resource object that is used for locking during "+ - "leader election. Supported options are `endpoints` (default) and `configmap`.") -}