From 2aba1c03636d85bac8e8b02e296c77a3ba91e787 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Sep 2023 16:44:19 -0400 Subject: [PATCH 1/5] make go-deps This vendors in: - informers and listers for the machine api objects - stream-metadata-go for coreos stream objects --- go.mod | 1 + go.sum | 2 + .../coreos/stream-metadata-go/LICENSE | 201 ++++ .../coreos/stream-metadata-go/arch/arch.go | 48 + .../stream/artifact_utils.go | 95 ++ .../stream-metadata-go/stream/rhcos/rhcos.go | 18 + .../stream-metadata-go/stream/stream.go | 116 +++ .../stream-metadata-go/stream/stream_utils.go | 94 ++ .../applyconfigurations/internal/internal.go | 888 ++++++++++++++++++ .../machine/v1/awsfailuredomain.go | 32 + .../machine/v1/awsfailuredomainplacement.go | 23 + .../machine/v1/awsresourcefilter.go | 34 + .../machine/v1/awsresourcereference.go | 66 ++ .../machine/v1/azurefailuredomain.go | 23 + .../machine/v1/controlplanemachineset.go | 242 +++++ .../machine/v1/controlplanemachinesetspec.go | 64 ++ .../v1/controlplanemachinesetstatus.go | 74 ++ .../v1/controlplanemachinesetstrategy.go | 27 + .../v1/controlplanemachinesettemplate.go | 36 + ...ontrolplanemachinesettemplateobjectmeta.go | 44 + .../machine/v1/failuredomains.go | 104 ++ .../machine/v1/gcpfailuredomain.go | 23 + .../openshiftmachinev1beta1machinetemplate.go | 45 + .../machine/v1/openstackfailuredomain.go | 32 + .../machine/v1/rootvolume.go | 23 + .../machine/v1beta1/condition.go | 74 ++ .../machine/v1beta1/lastoperation.go | 54 ++ .../machine/v1beta1/lifecyclehook.go | 32 + .../machine/v1beta1/lifecyclehooks.go | 42 + .../machine/v1beta1/machine.go | 242 +++++ .../machine/v1beta1/machinehealthcheck.go | 242 +++++ .../machine/v1beta1/machinehealthcheckspec.go | 70 ++ .../v1beta1/machinehealthcheckstatus.go | 54 ++ .../machine/v1beta1/machineset.go | 242 +++++ .../machine/v1beta1/machinesetspec.go | 63 ++ .../machine/v1beta1/machinesetstatus.go | 81 ++ .../machine/v1beta1/machinespec.go | 135 +++ .../machine/v1beta1/machinestatus.go | 104 ++ .../machine/v1beta1/machinetemplatespec.go | 105 +++ .../machine/v1beta1/objectmeta.go | 89 ++ .../machine/v1beta1/providerspec.go | 27 + .../machine/v1beta1/unhealthycondition.go | 46 + .../machine/clientset/versioned/clientset.go | 118 +++ .../machine/clientset/versioned/doc.go | 4 + .../machine/clientset/versioned/scheme/doc.go | 4 + .../clientset/versioned/scheme/register.go | 42 + .../machine/v1/controlplanemachineset.go | 240 +++++ .../versioned/typed/machine/v1/doc.go | 4 + .../typed/machine/v1/generated_expansion.go | 5 + .../typed/machine/v1/machine_client.go | 91 ++ .../versioned/typed/machine/v1beta1/doc.go | 4 + .../machine/v1beta1/generated_expansion.go | 9 + .../typed/machine/v1beta1/machine.go | 240 +++++ .../typed/machine/v1beta1/machine_client.go | 101 ++ .../machine/v1beta1/machinehealthcheck.go | 240 +++++ .../typed/machine/v1beta1/machineset.go | 240 +++++ .../informers/externalversions/factory.go | 164 ++++ .../informers/externalversions/generic.go | 55 ++ .../internalinterfaces/factory_interfaces.go | 24 + .../externalversions/machine/interface.go | 38 + .../machine/v1/controlplanemachineset.go | 74 ++ .../externalversions/machine/v1/interface.go | 29 + .../machine/v1beta1/interface.go | 43 + .../machine/v1beta1/machine.go | 74 ++ .../machine/v1beta1/machinehealthcheck.go | 74 ++ .../machine/v1beta1/machineset.go | 74 ++ .../machine/v1/controlplanemachineset.go | 83 ++ .../listers/machine/v1/expansion_generated.go | 11 + .../machine/v1beta1/expansion_generated.go | 27 + .../listers/machine/v1beta1/machine.go | 83 ++ .../machine/v1beta1/machinehealthcheck.go | 83 ++ .../listers/machine/v1beta1/machineset.go | 83 ++ .../k8s.io/code-generator/generate-groups.sh | 0 .../generate-internal-groups.sh | 0 vendor/modules.txt | 19 + 75 files changed, 6437 insertions(+) create mode 100644 vendor/github.com/coreos/stream-metadata-go/LICENSE create mode 100644 vendor/github.com/coreos/stream-metadata-go/arch/arch.go create mode 100644 vendor/github.com/coreos/stream-metadata-go/stream/artifact_utils.go create mode 100644 vendor/github.com/coreos/stream-metadata-go/stream/rhcos/rhcos.go create mode 100644 vendor/github.com/coreos/stream-metadata-go/stream/stream.go create mode 100644 vendor/github.com/coreos/stream-metadata-go/stream/stream_utils.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/internal/internal.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomain.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomainplacement.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcefilter.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcereference.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/azurefailuredomain.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetspec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstatus.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstrategy.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplate.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplateobjectmeta.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/failuredomains.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/gcpfailuredomain.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openshiftmachinev1beta1machinetemplate.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openstackfailuredomain.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/rootvolume.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/condition.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lastoperation.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehook.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehooks.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machine.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheck.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckspec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckstatus.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetspec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetstatus.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinespec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinestatus.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinetemplatespec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/objectmeta.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/providerspec.go create mode 100644 vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/unhealthycondition.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/clientset.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/doc.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/doc.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/register.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/controlplanemachineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/doc.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/generated_expansion.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/machine_client.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/doc.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/generated_expansion.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine_client.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go create mode 100644 vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/factory.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/generic.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/interface.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/controlplanemachineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/interface.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/interface.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machine.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machinehealthcheck.go create mode 100644 vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1/controlplanemachineset.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1/expansion_generated.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/expansion_generated.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machine.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machinehealthcheck.go create mode 100644 vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machineset.go mode change 100644 => 100755 vendor/k8s.io/code-generator/generate-groups.sh mode change 100644 => 100755 vendor/k8s.io/code-generator/generate-internal-groups.sh diff --git a/go.mod b/go.mod index e8bf5be3b5..e6c5aff8be 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( github.com/coreos/ignition v0.35.0 github.com/coreos/ignition/v2 v2.15.0 github.com/coreos/rpmostree-client-go v0.0.0-20230914135003-fae0786302f7 + github.com/coreos/stream-metadata-go v0.4.3 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/fsnotify/fsnotify v1.6.0 github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 diff --git a/go.sum b/go.sum index 95362f8b7e..8cd6895e80 100644 --- a/go.sum +++ b/go.sum @@ -176,6 +176,8 @@ github.com/coreos/ignition/v2 v2.15.0 h1:v2fQ6QvkcAF+La5PHHpnpBS1eGZo+LYL1wTOPvD github.com/coreos/ignition/v2 v2.15.0/go.mod h1:+7BiKurzCFg3P427Ml0wqnKzIuhLimnil6LhFV2DkJM= github.com/coreos/rpmostree-client-go v0.0.0-20230914135003-fae0786302f7 h1:gpIn0B0F00GJPlI1iPjJbHMS01QoxDs7Bf8UgH9D3wg= github.com/coreos/rpmostree-client-go v0.0.0-20230914135003-fae0786302f7/go.mod h1:WiAXRoGnl4Lwr7OM5izCLWMLH6Y43sYWJREoeeHEg4E= +github.com/coreos/stream-metadata-go v0.4.3 h1:5GykJ8dtZSx1rdlzEAiDVzA73cwmUF3ceTuIP293L6E= +github.com/coreos/stream-metadata-go v0.4.3/go.mod h1:fMObQqQm8Ku91G04btKzEH3AsdP1mrAb986z9aaK0tE= github.com/coreos/vcontext v0.0.0-20190529201340-22b159166068/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE= github.com/coreos/vcontext v0.0.0-20191017033345-260217907eb5/go.mod h1:E+6hug9bFSe0KZ2ZAzr8M9F5JlArJjv5D1JS7KSkPKE= github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 h1:uSmlDgJGbUB0bwQBcZomBTottKwEDF5fF8UjSwKSzWM= diff --git a/vendor/github.com/coreos/stream-metadata-go/LICENSE b/vendor/github.com/coreos/stream-metadata-go/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/LICENSE @@ -0,0 +1,201 @@ + 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/coreos/stream-metadata-go/arch/arch.go b/vendor/github.com/coreos/stream-metadata-go/arch/arch.go new file mode 100644 index 0000000000..d4a3e6b79e --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/arch/arch.go @@ -0,0 +1,48 @@ +// package arch contains mappings between the Golang architecture and +// the RPM architecture used by Fedora CoreOS and derivatives. +package arch + +import "runtime" + +type mapping struct { + rpmArch string + goArch string +} + +// If an architecture isn't defined here, we assume it's +// pass through. +var translations = []mapping{ + { + rpmArch: "x86_64", + goArch: "amd64", + }, + { + rpmArch: "aarch64", + goArch: "arm64", + }, +} + +// CurrentRpmArch returns the current architecture in RPM terms. +func CurrentRpmArch() string { + return RpmArch(runtime.GOARCH) +} + +// RpmArch translates a Go architecture to RPM. +func RpmArch(goarch string) string { + for _, m := range translations { + if m.goArch == goarch { + return m.rpmArch + } + } + return goarch +} + +// GoArch translates an RPM architecture to Go. +func GoArch(rpmarch string) string { + for _, m := range translations { + if m.rpmArch == rpmarch { + return m.goArch + } + } + return rpmarch +} diff --git a/vendor/github.com/coreos/stream-metadata-go/stream/artifact_utils.go b/vendor/github.com/coreos/stream-metadata-go/stream/artifact_utils.go new file mode 100644 index 0000000000..68ae6476b6 --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/stream/artifact_utils.go @@ -0,0 +1,95 @@ +package stream + +import ( + "crypto/sha256" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path" + "path/filepath" +) + +// Fetch an artifact, validating its checksum. If applicable, +// the artifact will not be decompressed. Does not +// validate GPG signature. +func (a *Artifact) Fetch(w io.Writer) error { + resp, err := http.Get(a.Location) + if err != nil { + return err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("%s returned status: %s", a.Location, resp.Status) + } + hasher := sha256.New() + reader := io.TeeReader(resp.Body, hasher) + + _, err = io.Copy(w, reader) + if err != nil { + return err + } + + // Validate sha256 checksum + foundChecksum := fmt.Sprintf("%x", hasher.Sum(nil)) + if a.Sha256 != foundChecksum { + return fmt.Errorf("checksum mismatch for %s; expected=%s found=%s", a.Location, a.Sha256, foundChecksum) + } + + return nil +} + +// Name returns the "basename" of the artifact, i.e. the contents +// after the last `/`. This can be useful when downloading to a file. +func (a *Artifact) Name() (string, error) { + loc, err := url.Parse(a.Location) + if err != nil { + return "", fmt.Errorf("failed to parse artifact url: %w", err) + } + // Note this one uses `path` since even on Windows URLs have forward slashes. + return path.Base(loc.Path), nil +} + +// Download fetches the specified artifact and saves it to the target +// directory. The full file path will be returned as a string. +// If the target file path exists, it will be overwritten. +// If the download fails, the temporary file will be deleted. +func (a *Artifact) Download(destdir string) (string, error) { + name, err := a.Name() + if err != nil { + return "", err + } + destfile := filepath.Join(destdir, name) + w, err := os.CreateTemp(destdir, ".coreos-artifact-") + if err != nil { + return "", err + } + finalized := false + defer func() { + if !finalized { + // Ignore an error to unlink + _ = os.Remove(w.Name()) + } + }() + + if err := a.Fetch(w); err != nil { + return "", err + } + if err := w.Sync(); err != nil { + return "", err + } + if err := w.Chmod(0644); err != nil { + return "", err + } + if err := w.Close(); err != nil { + return "", err + } + if err := os.Rename(w.Name(), destfile); err != nil { + return "", err + } + finalized = true + + return destfile, nil +} diff --git a/vendor/github.com/coreos/stream-metadata-go/stream/rhcos/rhcos.go b/vendor/github.com/coreos/stream-metadata-go/stream/rhcos/rhcos.go new file mode 100644 index 0000000000..320d84b41d --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/stream/rhcos/rhcos.go @@ -0,0 +1,18 @@ +package rhcos + +// Extensions is data specific to Red Hat Enterprise Linux CoreOS +type Extensions struct { + AzureDisk *AzureDisk `json:"azure-disk,omitempty"` +} + +// AzureDisk represents an Azure disk image that can be imported +// into an image gallery or otherwise replicated, and then used +// as a boot source for virtual machines. +type AzureDisk struct { + // Release is the source release version + Release string `json:"release"` + // URL to an image already stored in Azure infrastructure + // that can be copied into an image gallery. Avoid creating VMs directly + // from this URL as that may lead to performance limitations. + URL string `json:"url,omitempty"` +} diff --git a/vendor/github.com/coreos/stream-metadata-go/stream/stream.go b/vendor/github.com/coreos/stream-metadata-go/stream/stream.go new file mode 100644 index 0000000000..1ed9b1fd70 --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/stream/stream.go @@ -0,0 +1,116 @@ +// Package stream models a CoreOS "stream", which is +// a description of the recommended set of binary images for CoreOS. Use +// this API to find cloud images, bare metal disk images, etc. +package stream + +import ( + "github.com/coreos/stream-metadata-go/stream/rhcos" +) + +// Stream contains artifacts available in a stream +type Stream struct { + Stream string `json:"stream"` + Metadata Metadata `json:"metadata"` + Architectures map[string]Arch `json:"architectures"` +} + +// Metadata for a release or stream +type Metadata struct { + LastModified string `json:"last-modified"` + Generator string `json:"generator,omitempty"` +} + +// Arch contains release details for a particular hardware architecture +type Arch struct { + Artifacts map[string]PlatformArtifacts `json:"artifacts"` + Images Images `json:"images,omitempty"` + // RHELCoreOSExtensions is data specific to Red Hat Enterprise Linux CoreOS + RHELCoreOSExtensions *rhcos.Extensions `json:"rhel-coreos-extensions,omitempty"` +} + +// PlatformArtifacts contains images for a platform +type PlatformArtifacts struct { + Release string `json:"release"` + Formats map[string]ImageFormat `json:"formats"` +} + +// ImageFormat contains all artifacts for a single OS image +type ImageFormat struct { + Disk *Artifact `json:"disk,omitempty"` + Kernel *Artifact `json:"kernel,omitempty"` + Initramfs *Artifact `json:"initramfs,omitempty"` + Rootfs *Artifact `json:"rootfs,omitempty"` +} + +// Artifact represents one image file, plus its metadata +type Artifact struct { + Location string `json:"location"` + Signature string `json:"signature,omitempty"` + Sha256 string `json:"sha256"` + UncompressedSha256 string `json:"uncompressed-sha256,omitempty"` +} + +// Images contains images available in cloud providers +type Images struct { + Aliyun *ReplicatedImage `json:"aliyun,omitempty"` + Aws *AwsImage `json:"aws,omitempty"` + Gcp *GcpImage `json:"gcp,omitempty"` + Ibmcloud *ReplicatedObject `json:"ibmcloud,omitempty"` + KubeVirt *ContainerImage `json:"kubevirt,omitempty"` + PowerVS *ReplicatedObject `json:"powervs,omitempty"` +} + +// ReplicatedImage represents an image in all regions of an AWS-like cloud +type ReplicatedImage struct { + Regions map[string]SingleImage `json:"regions,omitempty"` +} + +// SingleImage represents a globally-accessible image or an image in a +// single region of an AWS-like cloud +type SingleImage struct { + Release string `json:"release"` + Image string `json:"image"` +} + +// ContainerImage represents a tagged container image +type ContainerImage struct { + Release string `json:"release"` + // Preferred way to reference the image, which might be by tag or digest + Image string `json:"image"` + DigestRef string `json:"digest-ref"` +} + +// AwsImage is a typedef for backwards compatibility. +type AwsImage = ReplicatedImage + +// AwsRegionImage is a typedef for backwards compatibility. +type AwsRegionImage = SingleImage + +// RegionImage is a typedef for backwards compatibility. +type RegionImage = SingleImage + +// GcpImage represents a GCP cloud image +type GcpImage struct { + Release string `json:"release"` + Project string `json:"project"` + Family string `json:"family,omitempty"` + Name string `json:"name"` +} + +// ReplicatedObject represents an object in all regions of an IBMCloud-like +// cloud +type ReplicatedObject struct { + Regions map[string]SingleObject `json:"regions,omitempty"` +} + +// SingleObject represents a globally-accessible cloud storage object, or +// an object in a single region of an IBMCloud-like cloud +type SingleObject struct { + Release string `json:"release"` + Object string `json:"object"` + Bucket string `json:"bucket"` + Url string `json:"url"` +} + +// RegionObject is a typedef for backwards compatibility. +type RegionObject = SingleObject diff --git a/vendor/github.com/coreos/stream-metadata-go/stream/stream_utils.go b/vendor/github.com/coreos/stream-metadata-go/stream/stream_utils.go new file mode 100644 index 0000000000..b1ca955641 --- /dev/null +++ b/vendor/github.com/coreos/stream-metadata-go/stream/stream_utils.go @@ -0,0 +1,94 @@ +package stream + +import "fmt" + +// FormatPrefix describes a stream+architecture combination, intended for prepending to error messages +func (st *Stream) FormatPrefix(archname string) string { + return fmt.Sprintf("%s/%s", st.Stream, archname) +} + +// GetArchitecture loads the architecture-specific builds from a stream, +// with a useful descriptive error message if the architecture is not found. +func (st *Stream) GetArchitecture(archname string) (*Arch, error) { + archdata, ok := st.Architectures[archname] + if !ok { + return nil, fmt.Errorf("stream:%s does not have architecture '%s'", st.Stream, archname) + } + return &archdata, nil +} + +// GetAliyunRegionImage returns the release data (Image ID and release ID) for a particular +// architecture and region. +func (st *Stream) GetAliyunRegionImage(archname, region string) (*SingleImage, error) { + starch, err := st.GetArchitecture(archname) + if err != nil { + return nil, err + } + aliyunimages := starch.Images.Aliyun + if aliyunimages == nil { + return nil, fmt.Errorf("%s: No Aliyun images", st.FormatPrefix(archname)) + } + var regionVal SingleImage + var ok bool + if regionVal, ok = aliyunimages.Regions[region]; !ok { + return nil, fmt.Errorf("%s: No Aliyun images in region %s", st.FormatPrefix(archname), region) + } + + return ®ionVal, nil +} + +// GetAliyunImage returns the Aliyun image for a particular architecture and region. +func (st *Stream) GetAliyunImage(archname, region string) (string, error) { + regionVal, err := st.GetAliyunRegionImage(archname, region) + if err != nil { + return "", err + } + return regionVal.Image, nil +} + +// GetAwsRegionImage returns the release data (AMI and release ID) for a particular +// architecture and region. +func (st *Stream) GetAwsRegionImage(archname, region string) (*SingleImage, error) { + starch, err := st.GetArchitecture(archname) + if err != nil { + return nil, err + } + awsimages := starch.Images.Aws + if awsimages == nil { + return nil, fmt.Errorf("%s: No AWS images", st.FormatPrefix(archname)) + } + var regionVal SingleImage + var ok bool + if regionVal, ok = awsimages.Regions[region]; !ok { + return nil, fmt.Errorf("%s: No AWS images in region %s", st.FormatPrefix(archname), region) + } + + return ®ionVal, nil +} + +// GetAMI returns the AWS machine image for a particular architecture and region. +func (st *Stream) GetAMI(archname, region string) (string, error) { + regionVal, err := st.GetAwsRegionImage(archname, region) + if err != nil { + return "", err + } + return regionVal.Image, nil +} + +// QueryDisk finds the singleton disk artifact for a given format and architecture. +func (st *Stream) QueryDisk(architectureName, artifactName, formatName string) (*Artifact, error) { + arch, err := st.GetArchitecture(architectureName) + if err != nil { + return nil, err + } + artifacts := arch.Artifacts[artifactName] + if artifacts.Release == "" { + return nil, fmt.Errorf("%s: artifact '%s' not found", st.FormatPrefix(architectureName), artifactName) + } + format := artifacts.Formats[formatName] + if format.Disk == nil { + return nil, fmt.Errorf("%s: artifact '%s' format '%s' disk not found", st.FormatPrefix(architectureName), artifactName, formatName) + } + + return format.Disk, nil +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/internal/internal.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/internal/internal.go new file mode 100644 index 0000000000..4cd121e45a --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/internal/internal.go @@ -0,0 +1,888 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: com.github.openshift.api.machine.v1.AWSFailureDomain + map: + fields: + - name: placement + type: + namedType: com.github.openshift.api.machine.v1.AWSFailureDomainPlacement + default: {} + - name: subnet + type: + namedType: com.github.openshift.api.machine.v1.AWSResourceReference +- name: com.github.openshift.api.machine.v1.AWSFailureDomainPlacement + map: + fields: + - name: availabilityZone + type: + scalar: string + default: "" +- name: com.github.openshift.api.machine.v1.AWSResourceFilter + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: com.github.openshift.api.machine.v1.AWSResourceReference + map: + fields: + - name: arn + type: + scalar: string + - name: filters + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1.AWSResourceFilter + elementRelationship: atomic + - name: id + type: + scalar: string + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: arn + discriminatorValue: ARN + - fieldName: filters + discriminatorValue: Filters + - fieldName: id + discriminatorValue: ID +- name: com.github.openshift.api.machine.v1.AzureFailureDomain + map: + fields: + - name: zone + type: + scalar: string + default: "" +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1.ControlPlaneMachineSetSpec + default: {} + - name: status + type: + namedType: com.github.openshift.api.machine.v1.ControlPlaneMachineSetStatus + default: {} +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSetSpec + map: + fields: + - name: replicas + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + default: {} + - name: state + type: + scalar: string + default: Inactive + - name: strategy + type: + namedType: com.github.openshift.api.machine.v1.ControlPlaneMachineSetStrategy + default: {} + - name: template + type: + namedType: com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplate + default: {} +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSetStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: unavailableReplicas + type: + scalar: numeric + - name: updatedReplicas + type: + scalar: numeric +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSetStrategy + map: + fields: + - name: type + type: + scalar: string + default: RollingUpdate +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplate + map: + fields: + - name: machineType + type: + scalar: string + - name: machines_v1beta1_machine_openshift_io + type: + namedType: com.github.openshift.api.machine.v1.OpenShiftMachineV1Beta1MachineTemplate + unions: + - discriminator: machineType + fields: + - fieldName: machines_v1beta1_machine_openshift_io + discriminatorValue: OpenShiftMachineV1Beta1Machine +- name: com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplateObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: labels + type: + map: + elementType: + scalar: string +- name: com.github.openshift.api.machine.v1.FailureDomains + map: + fields: + - name: aws + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1.AWSFailureDomain + elementRelationship: atomic + - name: azure + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1.AzureFailureDomain + elementRelationship: atomic + - name: gcp + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1.GCPFailureDomain + elementRelationship: atomic + - name: openstack + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1.OpenStackFailureDomain + elementRelationship: atomic + - name: platform + type: + scalar: string + default: "" + unions: + - discriminator: platform + fields: + - fieldName: aws + discriminatorValue: AWS + - fieldName: azure + discriminatorValue: Azure + - fieldName: gcp + discriminatorValue: GCP + - fieldName: openstack + discriminatorValue: OpenStack +- name: com.github.openshift.api.machine.v1.GCPFailureDomain + map: + fields: + - name: zone + type: + scalar: string + default: "" +- name: com.github.openshift.api.machine.v1.OpenShiftMachineV1Beta1MachineTemplate + map: + fields: + - name: failureDomains + type: + namedType: com.github.openshift.api.machine.v1.FailureDomains + default: {} + - name: metadata + type: + namedType: com.github.openshift.api.machine.v1.ControlPlaneMachineSetTemplateObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineSpec + default: {} +- name: com.github.openshift.api.machine.v1.OpenStackFailureDomain + map: + fields: + - name: availabilityZone + type: + scalar: string + - name: rootVolume + type: + namedType: com.github.openshift.api.machine.v1.RootVolume +- name: com.github.openshift.api.machine.v1.RootVolume + map: + fields: + - name: availabilityZone + type: + scalar: string +- name: com.github.openshift.api.machine.v1beta1.Condition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: severity + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: com.github.openshift.api.machine.v1beta1.LastOperation + map: + fields: + - name: description + type: + scalar: string + - name: lastUpdated + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: state + type: + scalar: string + - name: type + type: + scalar: string +- name: com.github.openshift.api.machine.v1beta1.LifecycleHook + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: owner + type: + scalar: string + default: "" +- name: com.github.openshift.api.machine.v1beta1.LifecycleHooks + map: + fields: + - name: preDrain + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1beta1.LifecycleHook + elementRelationship: associative + keys: + - name + - name: preTerminate + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1beta1.LifecycleHook + elementRelationship: associative + keys: + - name +- name: com.github.openshift.api.machine.v1beta1.Machine + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineSpec + default: {} + - name: status + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineStatus + default: {} +- name: com.github.openshift.api.machine.v1beta1.MachineHealthCheck + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineHealthCheckSpec + default: {} + - name: status + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineHealthCheckStatus + default: {} +- name: com.github.openshift.api.machine.v1beta1.MachineHealthCheckSpec + map: + fields: + - name: maxUnhealthy + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: nodeStartupTimeout + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration + - name: remediationTemplate + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + default: {} + - name: unhealthyConditions + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1beta1.UnhealthyCondition + elementRelationship: atomic +- name: com.github.openshift.api.machine.v1beta1.MachineHealthCheckStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1beta1.Condition + elementRelationship: atomic + - name: currentHealthy + type: + scalar: numeric + - name: expectedMachines + type: + scalar: numeric + - name: remediationsAllowed + type: + scalar: numeric + default: 0 +- name: com.github.openshift.api.machine.v1beta1.MachineSet + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineSetSpec + default: {} + - name: status + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineSetStatus + default: {} +- name: com.github.openshift.api.machine.v1beta1.MachineSetSpec + map: + fields: + - name: deletePolicy + type: + scalar: string + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + default: {} + - name: template + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineTemplateSpec + default: {} +- name: com.github.openshift.api.machine.v1beta1.MachineSetStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: errorMessage + type: + scalar: string + - name: errorReason + type: + scalar: string + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: com.github.openshift.api.machine.v1beta1.MachineSpec + map: + fields: + - name: lifecycleHooks + type: + namedType: com.github.openshift.api.machine.v1beta1.LifecycleHooks + default: {} + - name: metadata + type: + namedType: com.github.openshift.api.machine.v1beta1.ObjectMeta + default: {} + - name: providerID + type: + scalar: string + - name: providerSpec + type: + namedType: com.github.openshift.api.machine.v1beta1.ProviderSpec + default: {} + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Taint + elementRelationship: atomic +- name: com.github.openshift.api.machine.v1beta1.MachineStatus + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAddress + elementRelationship: atomic + - name: conditions + type: + list: + elementType: + namedType: com.github.openshift.api.machine.v1beta1.Condition + elementRelationship: atomic + - name: errorMessage + type: + scalar: string + - name: errorReason + type: + scalar: string + - name: lastOperation + type: + namedType: com.github.openshift.api.machine.v1beta1.LastOperation + - name: lastUpdated + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: nodeRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: phase + type: + scalar: string + - name: providerStatus + type: + namedType: __untyped_atomic_ +- name: com.github.openshift.api.machine.v1beta1.MachineTemplateSpec + map: + fields: + - name: metadata + type: + namedType: com.github.openshift.api.machine.v1beta1.ObjectMeta + default: {} + - name: spec + type: + namedType: com.github.openshift.api.machine.v1beta1.MachineSpec + default: {} +- name: com.github.openshift.api.machine.v1beta1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: generateName + type: + scalar: string + - name: labels + type: + map: + elementType: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid +- name: com.github.openshift.api.machine.v1beta1.ProviderSpec + map: + fields: + - name: value + type: + namedType: __untyped_atomic_ +- name: com.github.openshift.api.machine.v1beta1.UnhealthyCondition + map: + fields: + - name: status + type: + scalar: string + default: "" + - name: timeout + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Duration + default: 0 + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeAddress + map: + fields: + - name: address + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldPath + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.Taint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: message + type: + scalar: string + default: "" + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Duration + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic + - name: matchLabels + type: + map: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + default: {} + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: io.k8s.apimachinery.pkg.runtime.RawExtension + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.util.intstr.IntOrString + scalar: untyped +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomain.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomain.go new file mode 100644 index 0000000000..355938b7c5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomain.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AWSFailureDomainApplyConfiguration represents an declarative configuration of the AWSFailureDomain type for use +// with apply. +type AWSFailureDomainApplyConfiguration struct { + Subnet *AWSResourceReferenceApplyConfiguration `json:"subnet,omitempty"` + Placement *AWSFailureDomainPlacementApplyConfiguration `json:"placement,omitempty"` +} + +// AWSFailureDomainApplyConfiguration constructs an declarative configuration of the AWSFailureDomain type for use with +// apply. +func AWSFailureDomain() *AWSFailureDomainApplyConfiguration { + return &AWSFailureDomainApplyConfiguration{} +} + +// WithSubnet sets the Subnet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subnet field is set to the value of the last call. +func (b *AWSFailureDomainApplyConfiguration) WithSubnet(value *AWSResourceReferenceApplyConfiguration) *AWSFailureDomainApplyConfiguration { + b.Subnet = value + return b +} + +// WithPlacement sets the Placement field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Placement field is set to the value of the last call. +func (b *AWSFailureDomainApplyConfiguration) WithPlacement(value *AWSFailureDomainPlacementApplyConfiguration) *AWSFailureDomainApplyConfiguration { + b.Placement = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomainplacement.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomainplacement.go new file mode 100644 index 0000000000..76cd5bd355 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsfailuredomainplacement.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AWSFailureDomainPlacementApplyConfiguration represents an declarative configuration of the AWSFailureDomainPlacement type for use +// with apply. +type AWSFailureDomainPlacementApplyConfiguration struct { + AvailabilityZone *string `json:"availabilityZone,omitempty"` +} + +// AWSFailureDomainPlacementApplyConfiguration constructs an declarative configuration of the AWSFailureDomainPlacement type for use with +// apply. +func AWSFailureDomainPlacement() *AWSFailureDomainPlacementApplyConfiguration { + return &AWSFailureDomainPlacementApplyConfiguration{} +} + +// WithAvailabilityZone sets the AvailabilityZone field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailabilityZone field is set to the value of the last call. +func (b *AWSFailureDomainPlacementApplyConfiguration) WithAvailabilityZone(value string) *AWSFailureDomainPlacementApplyConfiguration { + b.AvailabilityZone = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcefilter.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcefilter.go new file mode 100644 index 0000000000..f664fee762 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcefilter.go @@ -0,0 +1,34 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AWSResourceFilterApplyConfiguration represents an declarative configuration of the AWSResourceFilter type for use +// with apply. +type AWSResourceFilterApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Values []string `json:"values,omitempty"` +} + +// AWSResourceFilterApplyConfiguration constructs an declarative configuration of the AWSResourceFilter type for use with +// apply. +func AWSResourceFilter() *AWSResourceFilterApplyConfiguration { + return &AWSResourceFilterApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AWSResourceFilterApplyConfiguration) WithName(value string) *AWSResourceFilterApplyConfiguration { + b.Name = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *AWSResourceFilterApplyConfiguration) WithValues(values ...string) *AWSResourceFilterApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcereference.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcereference.go new file mode 100644 index 0000000000..8c34e9ac50 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/awsresourcereference.go @@ -0,0 +1,66 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/machine/v1" +) + +// AWSResourceReferenceApplyConfiguration represents an declarative configuration of the AWSResourceReference type for use +// with apply. +type AWSResourceReferenceApplyConfiguration struct { + Type *v1.AWSResourceReferenceType `json:"type,omitempty"` + ID *string `json:"id,omitempty"` + ARN *string `json:"arn,omitempty"` + Filters *[]AWSResourceFilterApplyConfiguration `json:"filters,omitempty"` +} + +// AWSResourceReferenceApplyConfiguration constructs an declarative configuration of the AWSResourceReference type for use with +// apply. +func AWSResourceReference() *AWSResourceReferenceApplyConfiguration { + return &AWSResourceReferenceApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AWSResourceReferenceApplyConfiguration) WithType(value v1.AWSResourceReferenceType) *AWSResourceReferenceApplyConfiguration { + b.Type = &value + return b +} + +// WithID sets the ID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ID field is set to the value of the last call. +func (b *AWSResourceReferenceApplyConfiguration) WithID(value string) *AWSResourceReferenceApplyConfiguration { + b.ID = &value + return b +} + +// WithARN sets the ARN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ARN field is set to the value of the last call. +func (b *AWSResourceReferenceApplyConfiguration) WithARN(value string) *AWSResourceReferenceApplyConfiguration { + b.ARN = &value + return b +} + +func (b *AWSResourceReferenceApplyConfiguration) ensureAWSResourceFilterApplyConfigurationExists() { + if b.Filters == nil { + b.Filters = &[]AWSResourceFilterApplyConfiguration{} + } +} + +// WithFilters adds the given value to the Filters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Filters field. +func (b *AWSResourceReferenceApplyConfiguration) WithFilters(values ...*AWSResourceFilterApplyConfiguration) *AWSResourceReferenceApplyConfiguration { + b.ensureAWSResourceFilterApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithFilters") + } + *b.Filters = append(*b.Filters, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/azurefailuredomain.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/azurefailuredomain.go new file mode 100644 index 0000000000..81e56e8f40 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/azurefailuredomain.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AzureFailureDomainApplyConfiguration represents an declarative configuration of the AzureFailureDomain type for use +// with apply. +type AzureFailureDomainApplyConfiguration struct { + Zone *string `json:"zone,omitempty"` +} + +// AzureFailureDomainApplyConfiguration constructs an declarative configuration of the AzureFailureDomain type for use with +// apply. +func AzureFailureDomain() *AzureFailureDomainApplyConfiguration { + return &AzureFailureDomainApplyConfiguration{} +} + +// WithZone sets the Zone field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Zone field is set to the value of the last call. +func (b *AzureFailureDomainApplyConfiguration) WithZone(value string) *AzureFailureDomainApplyConfiguration { + b.Zone = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachineset.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachineset.go new file mode 100644 index 0000000000..71c240f5f2 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachineset.go @@ -0,0 +1,242 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apimachinev1 "github.com/openshift/api/machine/v1" + internal "github.com/openshift/client-go/machine/applyconfigurations/internal" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ControlPlaneMachineSetApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSet type for use +// with apply. +type ControlPlaneMachineSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ControlPlaneMachineSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *ControlPlaneMachineSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// ControlPlaneMachineSet constructs an declarative configuration of the ControlPlaneMachineSet type for use with +// apply. +func ControlPlaneMachineSet(name, namespace string) *ControlPlaneMachineSetApplyConfiguration { + b := &ControlPlaneMachineSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ControlPlaneMachineSet") + b.WithAPIVersion("machine.openshift.io/v1") + return b +} + +// ExtractControlPlaneMachineSet extracts the applied configuration owned by fieldManager from +// controlPlaneMachineSet. If no managedFields are found in controlPlaneMachineSet for fieldManager, a +// ControlPlaneMachineSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// controlPlaneMachineSet must be a unmodified ControlPlaneMachineSet API object that was retrieved from the Kubernetes API. +// ExtractControlPlaneMachineSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractControlPlaneMachineSet(controlPlaneMachineSet *apimachinev1.ControlPlaneMachineSet, fieldManager string) (*ControlPlaneMachineSetApplyConfiguration, error) { + return extractControlPlaneMachineSet(controlPlaneMachineSet, fieldManager, "") +} + +// ExtractControlPlaneMachineSetStatus is the same as ExtractControlPlaneMachineSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractControlPlaneMachineSetStatus(controlPlaneMachineSet *apimachinev1.ControlPlaneMachineSet, fieldManager string) (*ControlPlaneMachineSetApplyConfiguration, error) { + return extractControlPlaneMachineSet(controlPlaneMachineSet, fieldManager, "status") +} + +func extractControlPlaneMachineSet(controlPlaneMachineSet *apimachinev1.ControlPlaneMachineSet, fieldManager string, subresource string) (*ControlPlaneMachineSetApplyConfiguration, error) { + b := &ControlPlaneMachineSetApplyConfiguration{} + err := managedfields.ExtractInto(controlPlaneMachineSet, internal.Parser().Type("com.github.openshift.api.machine.v1.ControlPlaneMachineSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(controlPlaneMachineSet.Name) + b.WithNamespace(controlPlaneMachineSet.Namespace) + + b.WithKind("ControlPlaneMachineSet") + b.WithAPIVersion("machine.openshift.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithKind(value string) *ControlPlaneMachineSetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithAPIVersion(value string) *ControlPlaneMachineSetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithName(value string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithGenerateName(value string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithNamespace(value string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithUID(value types.UID) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithResourceVersion(value string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithGeneration(value int64) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ControlPlaneMachineSetApplyConfiguration) WithLabels(entries map[string]string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ControlPlaneMachineSetApplyConfiguration) WithAnnotations(entries map[string]string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ControlPlaneMachineSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ControlPlaneMachineSetApplyConfiguration) WithFinalizers(values ...string) *ControlPlaneMachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ControlPlaneMachineSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithSpec(value *ControlPlaneMachineSetSpecApplyConfiguration) *ControlPlaneMachineSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ControlPlaneMachineSetApplyConfiguration) WithStatus(value *ControlPlaneMachineSetStatusApplyConfiguration) *ControlPlaneMachineSetApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetspec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetspec.go new file mode 100644 index 0000000000..6a9d0b4cca --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetspec.go @@ -0,0 +1,64 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/machine/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ControlPlaneMachineSetSpecApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSetSpec type for use +// with apply. +type ControlPlaneMachineSetSpecApplyConfiguration struct { + State *v1.ControlPlaneMachineSetState `json:"state,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + Strategy *ControlPlaneMachineSetStrategyApplyConfiguration `json:"strategy,omitempty"` + Selector *metav1.LabelSelector `json:"selector,omitempty"` + Template *ControlPlaneMachineSetTemplateApplyConfiguration `json:"template,omitempty"` +} + +// ControlPlaneMachineSetSpecApplyConfiguration constructs an declarative configuration of the ControlPlaneMachineSetSpec type for use with +// apply. +func ControlPlaneMachineSetSpec() *ControlPlaneMachineSetSpecApplyConfiguration { + return &ControlPlaneMachineSetSpecApplyConfiguration{} +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *ControlPlaneMachineSetSpecApplyConfiguration) WithState(value v1.ControlPlaneMachineSetState) *ControlPlaneMachineSetSpecApplyConfiguration { + b.State = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ControlPlaneMachineSetSpecApplyConfiguration) WithReplicas(value int32) *ControlPlaneMachineSetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *ControlPlaneMachineSetSpecApplyConfiguration) WithStrategy(value *ControlPlaneMachineSetStrategyApplyConfiguration) *ControlPlaneMachineSetSpecApplyConfiguration { + b.Strategy = value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *ControlPlaneMachineSetSpecApplyConfiguration) WithSelector(value metav1.LabelSelector) *ControlPlaneMachineSetSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *ControlPlaneMachineSetSpecApplyConfiguration) WithTemplate(value *ControlPlaneMachineSetTemplateApplyConfiguration) *ControlPlaneMachineSetSpecApplyConfiguration { + b.Template = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstatus.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstatus.go new file mode 100644 index 0000000000..4fe71b7bda --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstatus.go @@ -0,0 +1,74 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ControlPlaneMachineSetStatusApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSetStatus type for use +// with apply. +type ControlPlaneMachineSetStatusApplyConfiguration struct { + Conditions []v1.Condition `json:"conditions,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + Replicas *int32 `json:"replicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + UpdatedReplicas *int32 `json:"updatedReplicas,omitempty"` + UnavailableReplicas *int32 `json:"unavailableReplicas,omitempty"` +} + +// ControlPlaneMachineSetStatusApplyConfiguration constructs an declarative configuration of the ControlPlaneMachineSetStatus type for use with +// apply. +func ControlPlaneMachineSetStatus() *ControlPlaneMachineSetStatusApplyConfiguration { + return &ControlPlaneMachineSetStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithConditions(values ...v1.Condition) *ControlPlaneMachineSetStatusApplyConfiguration { + for i := range values { + b.Conditions = append(b.Conditions, values[i]) + } + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithObservedGeneration(value int64) *ControlPlaneMachineSetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithReadyReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithUpdatedReplicas sets the UpdatedReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UpdatedReplicas field is set to the value of the last call. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithUpdatedReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration { + b.UpdatedReplicas = &value + return b +} + +// WithUnavailableReplicas sets the UnavailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UnavailableReplicas field is set to the value of the last call. +func (b *ControlPlaneMachineSetStatusApplyConfiguration) WithUnavailableReplicas(value int32) *ControlPlaneMachineSetStatusApplyConfiguration { + b.UnavailableReplicas = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstrategy.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstrategy.go new file mode 100644 index 0000000000..a9dcb3c5c3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesetstrategy.go @@ -0,0 +1,27 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/machine/v1" +) + +// ControlPlaneMachineSetStrategyApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSetStrategy type for use +// with apply. +type ControlPlaneMachineSetStrategyApplyConfiguration struct { + Type *v1.ControlPlaneMachineSetStrategyType `json:"type,omitempty"` +} + +// ControlPlaneMachineSetStrategyApplyConfiguration constructs an declarative configuration of the ControlPlaneMachineSetStrategy type for use with +// apply. +func ControlPlaneMachineSetStrategy() *ControlPlaneMachineSetStrategyApplyConfiguration { + return &ControlPlaneMachineSetStrategyApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ControlPlaneMachineSetStrategyApplyConfiguration) WithType(value v1.ControlPlaneMachineSetStrategyType) *ControlPlaneMachineSetStrategyApplyConfiguration { + b.Type = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplate.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplate.go new file mode 100644 index 0000000000..4b18f0dc77 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplate.go @@ -0,0 +1,36 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/machine/v1" +) + +// ControlPlaneMachineSetTemplateApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSetTemplate type for use +// with apply. +type ControlPlaneMachineSetTemplateApplyConfiguration struct { + MachineType *v1.ControlPlaneMachineSetMachineType `json:"machineType,omitempty"` + OpenShiftMachineV1Beta1Machine *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration `json:"machines_v1beta1_machine_openshift_io,omitempty"` +} + +// ControlPlaneMachineSetTemplateApplyConfiguration constructs an declarative configuration of the ControlPlaneMachineSetTemplate type for use with +// apply. +func ControlPlaneMachineSetTemplate() *ControlPlaneMachineSetTemplateApplyConfiguration { + return &ControlPlaneMachineSetTemplateApplyConfiguration{} +} + +// WithMachineType sets the MachineType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineType field is set to the value of the last call. +func (b *ControlPlaneMachineSetTemplateApplyConfiguration) WithMachineType(value v1.ControlPlaneMachineSetMachineType) *ControlPlaneMachineSetTemplateApplyConfiguration { + b.MachineType = &value + return b +} + +// WithOpenShiftMachineV1Beta1Machine sets the OpenShiftMachineV1Beta1Machine field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OpenShiftMachineV1Beta1Machine field is set to the value of the last call. +func (b *ControlPlaneMachineSetTemplateApplyConfiguration) WithOpenShiftMachineV1Beta1Machine(value *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration) *ControlPlaneMachineSetTemplateApplyConfiguration { + b.OpenShiftMachineV1Beta1Machine = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplateobjectmeta.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplateobjectmeta.go new file mode 100644 index 0000000000..e9711cf474 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/controlplanemachinesettemplateobjectmeta.go @@ -0,0 +1,44 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration represents an declarative configuration of the ControlPlaneMachineSetTemplateObjectMeta type for use +// with apply. +type ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration struct { + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration constructs an declarative configuration of the ControlPlaneMachineSetTemplateObjectMeta type for use with +// apply. +func ControlPlaneMachineSetTemplateObjectMeta() *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration { + return &ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/failuredomains.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/failuredomains.go new file mode 100644 index 0000000000..0fecd931ff --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/failuredomains.go @@ -0,0 +1,104 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" +) + +// FailureDomainsApplyConfiguration represents an declarative configuration of the FailureDomains type for use +// with apply. +type FailureDomainsApplyConfiguration struct { + Platform *v1.PlatformType `json:"platform,omitempty"` + AWS *[]AWSFailureDomainApplyConfiguration `json:"aws,omitempty"` + Azure *[]AzureFailureDomainApplyConfiguration `json:"azure,omitempty"` + GCP *[]GCPFailureDomainApplyConfiguration `json:"gcp,omitempty"` + OpenStack []OpenStackFailureDomainApplyConfiguration `json:"openstack,omitempty"` +} + +// FailureDomainsApplyConfiguration constructs an declarative configuration of the FailureDomains type for use with +// apply. +func FailureDomains() *FailureDomainsApplyConfiguration { + return &FailureDomainsApplyConfiguration{} +} + +// WithPlatform sets the Platform field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Platform field is set to the value of the last call. +func (b *FailureDomainsApplyConfiguration) WithPlatform(value v1.PlatformType) *FailureDomainsApplyConfiguration { + b.Platform = &value + return b +} + +func (b *FailureDomainsApplyConfiguration) ensureAWSFailureDomainApplyConfigurationExists() { + if b.AWS == nil { + b.AWS = &[]AWSFailureDomainApplyConfiguration{} + } +} + +// WithAWS adds the given value to the AWS field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AWS field. +func (b *FailureDomainsApplyConfiguration) WithAWS(values ...*AWSFailureDomainApplyConfiguration) *FailureDomainsApplyConfiguration { + b.ensureAWSFailureDomainApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAWS") + } + *b.AWS = append(*b.AWS, *values[i]) + } + return b +} + +func (b *FailureDomainsApplyConfiguration) ensureAzureFailureDomainApplyConfigurationExists() { + if b.Azure == nil { + b.Azure = &[]AzureFailureDomainApplyConfiguration{} + } +} + +// WithAzure adds the given value to the Azure field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Azure field. +func (b *FailureDomainsApplyConfiguration) WithAzure(values ...*AzureFailureDomainApplyConfiguration) *FailureDomainsApplyConfiguration { + b.ensureAzureFailureDomainApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAzure") + } + *b.Azure = append(*b.Azure, *values[i]) + } + return b +} + +func (b *FailureDomainsApplyConfiguration) ensureGCPFailureDomainApplyConfigurationExists() { + if b.GCP == nil { + b.GCP = &[]GCPFailureDomainApplyConfiguration{} + } +} + +// WithGCP adds the given value to the GCP field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the GCP field. +func (b *FailureDomainsApplyConfiguration) WithGCP(values ...*GCPFailureDomainApplyConfiguration) *FailureDomainsApplyConfiguration { + b.ensureGCPFailureDomainApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithGCP") + } + *b.GCP = append(*b.GCP, *values[i]) + } + return b +} + +// WithOpenStack adds the given value to the OpenStack field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OpenStack field. +func (b *FailureDomainsApplyConfiguration) WithOpenStack(values ...*OpenStackFailureDomainApplyConfiguration) *FailureDomainsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOpenStack") + } + b.OpenStack = append(b.OpenStack, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/gcpfailuredomain.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/gcpfailuredomain.go new file mode 100644 index 0000000000..943ec4e23c --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/gcpfailuredomain.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GCPFailureDomainApplyConfiguration represents an declarative configuration of the GCPFailureDomain type for use +// with apply. +type GCPFailureDomainApplyConfiguration struct { + Zone *string `json:"zone,omitempty"` +} + +// GCPFailureDomainApplyConfiguration constructs an declarative configuration of the GCPFailureDomain type for use with +// apply. +func GCPFailureDomain() *GCPFailureDomainApplyConfiguration { + return &GCPFailureDomainApplyConfiguration{} +} + +// WithZone sets the Zone field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Zone field is set to the value of the last call. +func (b *GCPFailureDomainApplyConfiguration) WithZone(value string) *GCPFailureDomainApplyConfiguration { + b.Zone = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openshiftmachinev1beta1machinetemplate.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openshiftmachinev1beta1machinetemplate.go new file mode 100644 index 0000000000..bc656ff501 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openshiftmachinev1beta1machinetemplate.go @@ -0,0 +1,45 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1beta1 "github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1" +) + +// OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration represents an declarative configuration of the OpenShiftMachineV1Beta1MachineTemplate type for use +// with apply. +type OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration struct { + FailureDomains *FailureDomainsApplyConfiguration `json:"failureDomains,omitempty"` + ObjectMeta *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *v1beta1.MachineSpecApplyConfiguration `json:"spec,omitempty"` +} + +// OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration constructs an declarative configuration of the OpenShiftMachineV1Beta1MachineTemplate type for use with +// apply. +func OpenShiftMachineV1Beta1MachineTemplate() *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration { + return &OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration{} +} + +// WithFailureDomains sets the FailureDomains field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureDomains field is set to the value of the last call. +func (b *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration) WithFailureDomains(value *FailureDomainsApplyConfiguration) *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration { + b.FailureDomains = value + return b +} + +// WithObjectMeta sets the ObjectMeta field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObjectMeta field is set to the value of the last call. +func (b *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration) WithObjectMeta(value *ControlPlaneMachineSetTemplateObjectMetaApplyConfiguration) *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration { + b.ObjectMeta = value + return b +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration) WithSpec(value *v1beta1.MachineSpecApplyConfiguration) *OpenShiftMachineV1Beta1MachineTemplateApplyConfiguration { + b.Spec = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openstackfailuredomain.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openstackfailuredomain.go new file mode 100644 index 0000000000..cbee21bdf3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/openstackfailuredomain.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// OpenStackFailureDomainApplyConfiguration represents an declarative configuration of the OpenStackFailureDomain type for use +// with apply. +type OpenStackFailureDomainApplyConfiguration struct { + AvailabilityZone *string `json:"availabilityZone,omitempty"` + RootVolume *RootVolumeApplyConfiguration `json:"rootVolume,omitempty"` +} + +// OpenStackFailureDomainApplyConfiguration constructs an declarative configuration of the OpenStackFailureDomain type for use with +// apply. +func OpenStackFailureDomain() *OpenStackFailureDomainApplyConfiguration { + return &OpenStackFailureDomainApplyConfiguration{} +} + +// WithAvailabilityZone sets the AvailabilityZone field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailabilityZone field is set to the value of the last call. +func (b *OpenStackFailureDomainApplyConfiguration) WithAvailabilityZone(value string) *OpenStackFailureDomainApplyConfiguration { + b.AvailabilityZone = &value + return b +} + +// WithRootVolume sets the RootVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RootVolume field is set to the value of the last call. +func (b *OpenStackFailureDomainApplyConfiguration) WithRootVolume(value *RootVolumeApplyConfiguration) *OpenStackFailureDomainApplyConfiguration { + b.RootVolume = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/rootvolume.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/rootvolume.go new file mode 100644 index 0000000000..e61ae38bd4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1/rootvolume.go @@ -0,0 +1,23 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RootVolumeApplyConfiguration represents an declarative configuration of the RootVolume type for use +// with apply. +type RootVolumeApplyConfiguration struct { + AvailabilityZone *string `json:"availabilityZone,omitempty"` +} + +// RootVolumeApplyConfiguration constructs an declarative configuration of the RootVolume type for use with +// apply. +func RootVolume() *RootVolumeApplyConfiguration { + return &RootVolumeApplyConfiguration{} +} + +// WithAvailabilityZone sets the AvailabilityZone field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailabilityZone field is set to the value of the last call. +func (b *RootVolumeApplyConfiguration) WithAvailabilityZone(value string) *RootVolumeApplyConfiguration { + b.AvailabilityZone = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/condition.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/condition.go new file mode 100644 index 0000000000..f6c0f48e7e --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/condition.go @@ -0,0 +1,74 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use +// with apply. +type ConditionApplyConfiguration struct { + Type *v1beta1.ConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Severity *v1beta1.ConditionSeverity `json:"severity,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with +// apply. +func Condition() *ConditionApplyConfiguration { + return &ConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithType(value v1beta1.ConditionType) *ConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithSeverity sets the Severity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Severity field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithSeverity(value v1beta1.ConditionSeverity) *ConditionApplyConfiguration { + b.Severity = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lastoperation.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lastoperation.go new file mode 100644 index 0000000000..ce59f73c07 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lastoperation.go @@ -0,0 +1,54 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LastOperationApplyConfiguration represents an declarative configuration of the LastOperation type for use +// with apply. +type LastOperationApplyConfiguration struct { + Description *string `json:"description,omitempty"` + LastUpdated *v1.Time `json:"lastUpdated,omitempty"` + State *string `json:"state,omitempty"` + Type *string `json:"type,omitempty"` +} + +// LastOperationApplyConfiguration constructs an declarative configuration of the LastOperation type for use with +// apply. +func LastOperation() *LastOperationApplyConfiguration { + return &LastOperationApplyConfiguration{} +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *LastOperationApplyConfiguration) WithDescription(value string) *LastOperationApplyConfiguration { + b.Description = &value + return b +} + +// WithLastUpdated sets the LastUpdated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdated field is set to the value of the last call. +func (b *LastOperationApplyConfiguration) WithLastUpdated(value v1.Time) *LastOperationApplyConfiguration { + b.LastUpdated = &value + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *LastOperationApplyConfiguration) WithState(value string) *LastOperationApplyConfiguration { + b.State = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *LastOperationApplyConfiguration) WithType(value string) *LastOperationApplyConfiguration { + b.Type = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehook.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehook.go new file mode 100644 index 0000000000..2e2b8fe3b4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehook.go @@ -0,0 +1,32 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// LifecycleHookApplyConfiguration represents an declarative configuration of the LifecycleHook type for use +// with apply. +type LifecycleHookApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Owner *string `json:"owner,omitempty"` +} + +// LifecycleHookApplyConfiguration constructs an declarative configuration of the LifecycleHook type for use with +// apply. +func LifecycleHook() *LifecycleHookApplyConfiguration { + return &LifecycleHookApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LifecycleHookApplyConfiguration) WithName(value string) *LifecycleHookApplyConfiguration { + b.Name = &value + return b +} + +// WithOwner sets the Owner field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Owner field is set to the value of the last call. +func (b *LifecycleHookApplyConfiguration) WithOwner(value string) *LifecycleHookApplyConfiguration { + b.Owner = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehooks.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehooks.go new file mode 100644 index 0000000000..b70f1aae44 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/lifecyclehooks.go @@ -0,0 +1,42 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// LifecycleHooksApplyConfiguration represents an declarative configuration of the LifecycleHooks type for use +// with apply. +type LifecycleHooksApplyConfiguration struct { + PreDrain []LifecycleHookApplyConfiguration `json:"preDrain,omitempty"` + PreTerminate []LifecycleHookApplyConfiguration `json:"preTerminate,omitempty"` +} + +// LifecycleHooksApplyConfiguration constructs an declarative configuration of the LifecycleHooks type for use with +// apply. +func LifecycleHooks() *LifecycleHooksApplyConfiguration { + return &LifecycleHooksApplyConfiguration{} +} + +// WithPreDrain adds the given value to the PreDrain field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreDrain field. +func (b *LifecycleHooksApplyConfiguration) WithPreDrain(values ...*LifecycleHookApplyConfiguration) *LifecycleHooksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPreDrain") + } + b.PreDrain = append(b.PreDrain, *values[i]) + } + return b +} + +// WithPreTerminate adds the given value to the PreTerminate field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreTerminate field. +func (b *LifecycleHooksApplyConfiguration) WithPreTerminate(values ...*LifecycleHookApplyConfiguration) *LifecycleHooksApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPreTerminate") + } + b.PreTerminate = append(b.PreTerminate, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machine.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machine.go new file mode 100644 index 0000000000..bb9558db7a --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machine.go @@ -0,0 +1,242 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + internal "github.com/openshift/client-go/machine/applyconfigurations/internal" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineApplyConfiguration represents an declarative configuration of the Machine type for use +// with apply. +type MachineApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MachineSpecApplyConfiguration `json:"spec,omitempty"` + Status *MachineStatusApplyConfiguration `json:"status,omitempty"` +} + +// Machine constructs an declarative configuration of the Machine type for use with +// apply. +func Machine(name, namespace string) *MachineApplyConfiguration { + b := &MachineApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Machine") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b +} + +// ExtractMachine extracts the applied configuration owned by fieldManager from +// machine. If no managedFields are found in machine for fieldManager, a +// MachineApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// machine must be a unmodified Machine API object that was retrieved from the Kubernetes API. +// ExtractMachine provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMachine(machine *machinev1beta1.Machine, fieldManager string) (*MachineApplyConfiguration, error) { + return extractMachine(machine, fieldManager, "") +} + +// ExtractMachineStatus is the same as ExtractMachine except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMachineStatus(machine *machinev1beta1.Machine, fieldManager string) (*MachineApplyConfiguration, error) { + return extractMachine(machine, fieldManager, "status") +} + +func extractMachine(machine *machinev1beta1.Machine, fieldManager string, subresource string) (*MachineApplyConfiguration, error) { + b := &MachineApplyConfiguration{} + err := managedfields.ExtractInto(machine, internal.Parser().Type("com.github.openshift.api.machine.v1beta1.Machine"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(machine.Name) + b.WithNamespace(machine.Namespace) + + b.WithKind("Machine") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithKind(value string) *MachineApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithAPIVersion(value string) *MachineApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithName(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithGenerateName(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithNamespace(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithUID(value types.UID) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithResourceVersion(value string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithGeneration(value int64) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineApplyConfiguration) WithLabels(entries map[string]string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineApplyConfiguration) WithAnnotations(entries map[string]string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineApplyConfiguration) WithFinalizers(values ...string) *MachineApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *MachineApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithSpec(value *MachineSpecApplyConfiguration) *MachineApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineApplyConfiguration) WithStatus(value *MachineStatusApplyConfiguration) *MachineApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..13e08405c8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,242 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + internal "github.com/openshift/client-go/machine/applyconfigurations/internal" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineHealthCheckApplyConfiguration represents an declarative configuration of the MachineHealthCheck type for use +// with apply. +type MachineHealthCheckApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MachineHealthCheckSpecApplyConfiguration `json:"spec,omitempty"` + Status *MachineHealthCheckStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineHealthCheck constructs an declarative configuration of the MachineHealthCheck type for use with +// apply. +func MachineHealthCheck(name, namespace string) *MachineHealthCheckApplyConfiguration { + b := &MachineHealthCheckApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachineHealthCheck") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b +} + +// ExtractMachineHealthCheck extracts the applied configuration owned by fieldManager from +// machineHealthCheck. If no managedFields are found in machineHealthCheck for fieldManager, a +// MachineHealthCheckApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// machineHealthCheck must be a unmodified MachineHealthCheck API object that was retrieved from the Kubernetes API. +// ExtractMachineHealthCheck provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMachineHealthCheck(machineHealthCheck *machinev1beta1.MachineHealthCheck, fieldManager string) (*MachineHealthCheckApplyConfiguration, error) { + return extractMachineHealthCheck(machineHealthCheck, fieldManager, "") +} + +// ExtractMachineHealthCheckStatus is the same as ExtractMachineHealthCheck except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMachineHealthCheckStatus(machineHealthCheck *machinev1beta1.MachineHealthCheck, fieldManager string) (*MachineHealthCheckApplyConfiguration, error) { + return extractMachineHealthCheck(machineHealthCheck, fieldManager, "status") +} + +func extractMachineHealthCheck(machineHealthCheck *machinev1beta1.MachineHealthCheck, fieldManager string, subresource string) (*MachineHealthCheckApplyConfiguration, error) { + b := &MachineHealthCheckApplyConfiguration{} + err := managedfields.ExtractInto(machineHealthCheck, internal.Parser().Type("com.github.openshift.api.machine.v1beta1.MachineHealthCheck"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(machineHealthCheck.Name) + b.WithNamespace(machineHealthCheck.Namespace) + + b.WithKind("MachineHealthCheck") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithKind(value string) *MachineHealthCheckApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithAPIVersion(value string) *MachineHealthCheckApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithName(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithGenerateName(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithNamespace(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithUID(value types.UID) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithResourceVersion(value string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithGeneration(value int64) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineHealthCheckApplyConfiguration) WithLabels(entries map[string]string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineHealthCheckApplyConfiguration) WithAnnotations(entries map[string]string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineHealthCheckApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineHealthCheckApplyConfiguration) WithFinalizers(values ...string) *MachineHealthCheckApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *MachineHealthCheckApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithSpec(value *MachineHealthCheckSpecApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineHealthCheckApplyConfiguration) WithStatus(value *MachineHealthCheckStatusApplyConfiguration) *MachineHealthCheckApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckspec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckspec.go new file mode 100644 index 0000000000..b2dbc57dd0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckspec.go @@ -0,0 +1,70 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineHealthCheckSpecApplyConfiguration represents an declarative configuration of the MachineHealthCheckSpec type for use +// with apply. +type MachineHealthCheckSpecApplyConfiguration struct { + Selector *v1.LabelSelector `json:"selector,omitempty"` + UnhealthyConditions []UnhealthyConditionApplyConfiguration `json:"unhealthyConditions,omitempty"` + MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` + NodeStartupTimeout *v1.Duration `json:"nodeStartupTimeout,omitempty"` + RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` +} + +// MachineHealthCheckSpecApplyConfiguration constructs an declarative configuration of the MachineHealthCheckSpec type for use with +// apply. +func MachineHealthCheckSpec() *MachineHealthCheckSpecApplyConfiguration { + return &MachineHealthCheckSpecApplyConfiguration{} +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithSelector(value v1.LabelSelector) *MachineHealthCheckSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithUnhealthyConditions adds the given value to the UnhealthyConditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the UnhealthyConditions field. +func (b *MachineHealthCheckSpecApplyConfiguration) WithUnhealthyConditions(values ...*UnhealthyConditionApplyConfiguration) *MachineHealthCheckSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithUnhealthyConditions") + } + b.UnhealthyConditions = append(b.UnhealthyConditions, *values[i]) + } + return b +} + +// WithMaxUnhealthy sets the MaxUnhealthy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxUnhealthy field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithMaxUnhealthy(value intstr.IntOrString) *MachineHealthCheckSpecApplyConfiguration { + b.MaxUnhealthy = &value + return b +} + +// WithNodeStartupTimeout sets the NodeStartupTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStartupTimeout field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithNodeStartupTimeout(value v1.Duration) *MachineHealthCheckSpecApplyConfiguration { + b.NodeStartupTimeout = &value + return b +} + +// WithRemediationTemplate sets the RemediationTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RemediationTemplate field is set to the value of the last call. +func (b *MachineHealthCheckSpecApplyConfiguration) WithRemediationTemplate(value corev1.ObjectReference) *MachineHealthCheckSpecApplyConfiguration { + b.RemediationTemplate = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckstatus.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckstatus.go new file mode 100644 index 0000000000..e0d1cef760 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinehealthcheckstatus.go @@ -0,0 +1,54 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" +) + +// MachineHealthCheckStatusApplyConfiguration represents an declarative configuration of the MachineHealthCheckStatus type for use +// with apply. +type MachineHealthCheckStatusApplyConfiguration struct { + ExpectedMachines *int `json:"expectedMachines,omitempty"` + CurrentHealthy *int `json:"currentHealthy,omitempty"` + RemediationsAllowed *int32 `json:"remediationsAllowed,omitempty"` + Conditions *v1beta1.Conditions `json:"conditions,omitempty"` +} + +// MachineHealthCheckStatusApplyConfiguration constructs an declarative configuration of the MachineHealthCheckStatus type for use with +// apply. +func MachineHealthCheckStatus() *MachineHealthCheckStatusApplyConfiguration { + return &MachineHealthCheckStatusApplyConfiguration{} +} + +// WithExpectedMachines sets the ExpectedMachines field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExpectedMachines field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithExpectedMachines(value int) *MachineHealthCheckStatusApplyConfiguration { + b.ExpectedMachines = &value + return b +} + +// WithCurrentHealthy sets the CurrentHealthy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentHealthy field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithCurrentHealthy(value int) *MachineHealthCheckStatusApplyConfiguration { + b.CurrentHealthy = &value + return b +} + +// WithRemediationsAllowed sets the RemediationsAllowed field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RemediationsAllowed field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithRemediationsAllowed(value int32) *MachineHealthCheckStatusApplyConfiguration { + b.RemediationsAllowed = &value + return b +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineHealthCheckStatusApplyConfiguration) WithConditions(value v1beta1.Conditions) *MachineHealthCheckStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machineset.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..f84376b240 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machineset.go @@ -0,0 +1,242 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + internal "github.com/openshift/client-go/machine/applyconfigurations/internal" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineSetApplyConfiguration represents an declarative configuration of the MachineSet type for use +// with apply. +type MachineSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MachineSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *MachineSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// MachineSet constructs an declarative configuration of the MachineSet type for use with +// apply. +func MachineSet(name, namespace string) *MachineSetApplyConfiguration { + b := &MachineSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MachineSet") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b +} + +// ExtractMachineSet extracts the applied configuration owned by fieldManager from +// machineSet. If no managedFields are found in machineSet for fieldManager, a +// MachineSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// machineSet must be a unmodified MachineSet API object that was retrieved from the Kubernetes API. +// ExtractMachineSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMachineSet(machineSet *machinev1beta1.MachineSet, fieldManager string) (*MachineSetApplyConfiguration, error) { + return extractMachineSet(machineSet, fieldManager, "") +} + +// ExtractMachineSetStatus is the same as ExtractMachineSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMachineSetStatus(machineSet *machinev1beta1.MachineSet, fieldManager string) (*MachineSetApplyConfiguration, error) { + return extractMachineSet(machineSet, fieldManager, "status") +} + +func extractMachineSet(machineSet *machinev1beta1.MachineSet, fieldManager string, subresource string) (*MachineSetApplyConfiguration, error) { + b := &MachineSetApplyConfiguration{} + err := managedfields.ExtractInto(machineSet, internal.Parser().Type("com.github.openshift.api.machine.v1beta1.MachineSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(machineSet.Name) + b.WithNamespace(machineSet.Namespace) + + b.WithKind("MachineSet") + b.WithAPIVersion("machine.openshift.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithKind(value string) *MachineSetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithAPIVersion(value string) *MachineSetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithName(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithGenerateName(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithNamespace(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithUID(value types.UID) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithResourceVersion(value string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithGeneration(value int64) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineSetApplyConfiguration) WithLabels(entries map[string]string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineSetApplyConfiguration) WithAnnotations(entries map[string]string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MachineSetApplyConfiguration) WithFinalizers(values ...string) *MachineSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *MachineSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithSpec(value *MachineSetSpecApplyConfiguration) *MachineSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MachineSetApplyConfiguration) WithStatus(value *MachineSetStatusApplyConfiguration) *MachineSetApplyConfiguration { + b.Status = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetspec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetspec.go new file mode 100644 index 0000000000..903fdb6e3f --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetspec.go @@ -0,0 +1,63 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MachineSetSpecApplyConfiguration represents an declarative configuration of the MachineSetSpec type for use +// with apply. +type MachineSetSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + DeletePolicy *string `json:"deletePolicy,omitempty"` + Selector *v1.LabelSelector `json:"selector,omitempty"` + Template *MachineTemplateSpecApplyConfiguration `json:"template,omitempty"` +} + +// MachineSetSpecApplyConfiguration constructs an declarative configuration of the MachineSetSpec type for use with +// apply. +func MachineSetSpec() *MachineSetSpecApplyConfiguration { + return &MachineSetSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithReplicas(value int32) *MachineSetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *MachineSetSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithDeletePolicy sets the DeletePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletePolicy field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithDeletePolicy(value string) *MachineSetSpecApplyConfiguration { + b.DeletePolicy = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithSelector(value v1.LabelSelector) *MachineSetSpecApplyConfiguration { + b.Selector = &value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MachineSetSpecApplyConfiguration) WithTemplate(value *MachineTemplateSpecApplyConfiguration) *MachineSetSpecApplyConfiguration { + b.Template = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetstatus.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetstatus.go new file mode 100644 index 0000000000..76f0c11d68 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinesetstatus.go @@ -0,0 +1,81 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" +) + +// MachineSetStatusApplyConfiguration represents an declarative configuration of the MachineSetStatus type for use +// with apply. +type MachineSetStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + ErrorReason *v1beta1.MachineSetStatusError `json:"errorReason,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// MachineSetStatusApplyConfiguration constructs an declarative configuration of the MachineSetStatus type for use with +// apply. +func MachineSetStatus() *MachineSetStatusApplyConfiguration { + return &MachineSetStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.FullyLabeledReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithReadyReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *MachineSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithObservedGeneration(value int64) *MachineSetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithErrorReason sets the ErrorReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorReason field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithErrorReason(value v1beta1.MachineSetStatusError) *MachineSetStatusApplyConfiguration { + b.ErrorReason = &value + return b +} + +// WithErrorMessage sets the ErrorMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorMessage field is set to the value of the last call. +func (b *MachineSetStatusApplyConfiguration) WithErrorMessage(value string) *MachineSetStatusApplyConfiguration { + b.ErrorMessage = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinespec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinespec.go new file mode 100644 index 0000000000..06a759ca7d --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinespec.go @@ -0,0 +1,135 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineSpecApplyConfiguration represents an declarative configuration of the MachineSpec type for use +// with apply. +type MachineSpecApplyConfiguration struct { + *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + LifecycleHooks *LifecycleHooksApplyConfiguration `json:"lifecycleHooks,omitempty"` + Taints []v1.Taint `json:"taints,omitempty"` + ProviderSpec *ProviderSpecApplyConfiguration `json:"providerSpec,omitempty"` + ProviderID *string `json:"providerID,omitempty"` +} + +// MachineSpecApplyConfiguration constructs an declarative configuration of the MachineSpec type for use with +// apply. +func MachineSpec() *MachineSpecApplyConfiguration { + return &MachineSpecApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithName(value string) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithGenerateName(value string) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithNamespace(value string) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineSpecApplyConfiguration) WithLabels(entries map[string]string) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineSpecApplyConfiguration) WithAnnotations(entries map[string]string) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineSpecApplyConfiguration) WithOwnerReferences(values ...*metav1.OwnerReferenceApplyConfiguration) *MachineSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +func (b *MachineSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &ObjectMetaApplyConfiguration{} + } +} + +// WithLifecycleHooks sets the LifecycleHooks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LifecycleHooks field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithLifecycleHooks(value *LifecycleHooksApplyConfiguration) *MachineSpecApplyConfiguration { + b.LifecycleHooks = value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *MachineSpecApplyConfiguration) WithTaints(values ...v1.Taint) *MachineSpecApplyConfiguration { + for i := range values { + b.Taints = append(b.Taints, values[i]) + } + return b +} + +// WithProviderSpec sets the ProviderSpec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProviderSpec field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithProviderSpec(value *ProviderSpecApplyConfiguration) *MachineSpecApplyConfiguration { + b.ProviderSpec = value + return b +} + +// WithProviderID sets the ProviderID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProviderID field is set to the value of the last call. +func (b *MachineSpecApplyConfiguration) WithProviderID(value string) *MachineSpecApplyConfiguration { + b.ProviderID = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinestatus.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinestatus.go new file mode 100644 index 0000000000..e043c704c7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinestatus.go @@ -0,0 +1,104 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// MachineStatusApplyConfiguration represents an declarative configuration of the MachineStatus type for use +// with apply. +type MachineStatusApplyConfiguration struct { + NodeRef *v1.ObjectReference `json:"nodeRef,omitempty"` + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + ErrorReason *v1beta1.MachineStatusError `json:"errorReason,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + ProviderStatus *runtime.RawExtension `json:"providerStatus,omitempty"` + Addresses []v1.NodeAddress `json:"addresses,omitempty"` + LastOperation *LastOperationApplyConfiguration `json:"lastOperation,omitempty"` + Phase *string `json:"phase,omitempty"` + Conditions *v1beta1.Conditions `json:"conditions,omitempty"` +} + +// MachineStatusApplyConfiguration constructs an declarative configuration of the MachineStatus type for use with +// apply. +func MachineStatus() *MachineStatusApplyConfiguration { + return &MachineStatusApplyConfiguration{} +} + +// WithNodeRef sets the NodeRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeRef field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithNodeRef(value v1.ObjectReference) *MachineStatusApplyConfiguration { + b.NodeRef = &value + return b +} + +// WithLastUpdated sets the LastUpdated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdated field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithLastUpdated(value metav1.Time) *MachineStatusApplyConfiguration { + b.LastUpdated = &value + return b +} + +// WithErrorReason sets the ErrorReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorReason field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithErrorReason(value v1beta1.MachineStatusError) *MachineStatusApplyConfiguration { + b.ErrorReason = &value + return b +} + +// WithErrorMessage sets the ErrorMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ErrorMessage field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithErrorMessage(value string) *MachineStatusApplyConfiguration { + b.ErrorMessage = &value + return b +} + +// WithProviderStatus sets the ProviderStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProviderStatus field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithProviderStatus(value runtime.RawExtension) *MachineStatusApplyConfiguration { + b.ProviderStatus = &value + return b +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *MachineStatusApplyConfiguration) WithAddresses(values ...v1.NodeAddress) *MachineStatusApplyConfiguration { + for i := range values { + b.Addresses = append(b.Addresses, values[i]) + } + return b +} + +// WithLastOperation sets the LastOperation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastOperation field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithLastOperation(value *LastOperationApplyConfiguration) *MachineStatusApplyConfiguration { + b.LastOperation = value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithPhase(value string) *MachineStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MachineStatusApplyConfiguration) WithConditions(value v1beta1.Conditions) *MachineStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinetemplatespec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinetemplatespec.go new file mode 100644 index 0000000000..11d54f3164 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/machinetemplatespec.go @@ -0,0 +1,105 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// MachineTemplateSpecApplyConfiguration represents an declarative configuration of the MachineTemplateSpec type for use +// with apply. +type MachineTemplateSpecApplyConfiguration struct { + *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MachineSpecApplyConfiguration `json:"spec,omitempty"` +} + +// MachineTemplateSpecApplyConfiguration constructs an declarative configuration of the MachineTemplateSpec type for use with +// apply. +func MachineTemplateSpec() *MachineTemplateSpecApplyConfiguration { + return &MachineTemplateSpecApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MachineTemplateSpecApplyConfiguration) WithName(value string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MachineTemplateSpecApplyConfiguration) WithGenerateName(value string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MachineTemplateSpecApplyConfiguration) WithNamespace(value string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MachineTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MachineTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MachineTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MachineTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +func (b *MachineTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MachineTemplateSpecApplyConfiguration) WithSpec(value *MachineSpecApplyConfiguration) *MachineTemplateSpecApplyConfiguration { + b.Spec = value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/objectmeta.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/objectmeta.go new file mode 100644 index 0000000000..7804177411 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/objectmeta.go @@ -0,0 +1,89 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use +// with apply. +type ObjectMetaApplyConfiguration struct { + Name *string `json:"name,omitempty"` + GenerateName *string `json:"generateName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + OwnerReferences []v1.OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"` +} + +// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with +// apply. +func ObjectMeta() *ObjectMetaApplyConfiguration { + return &ObjectMetaApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration { + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration { + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration { + b.Namespace = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/providerspec.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/providerspec.go new file mode 100644 index 0000000000..ed00bc2fcb --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/providerspec.go @@ -0,0 +1,27 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// ProviderSpecApplyConfiguration represents an declarative configuration of the ProviderSpec type for use +// with apply. +type ProviderSpecApplyConfiguration struct { + Value *runtime.RawExtension `json:"value,omitempty"` +} + +// ProviderSpecApplyConfiguration constructs an declarative configuration of the ProviderSpec type for use with +// apply. +func ProviderSpec() *ProviderSpecApplyConfiguration { + return &ProviderSpecApplyConfiguration{} +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *ProviderSpecApplyConfiguration) WithValue(value runtime.RawExtension) *ProviderSpecApplyConfiguration { + b.Value = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/unhealthycondition.go b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/unhealthycondition.go new file mode 100644 index 0000000000..248b04f74c --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1/unhealthycondition.go @@ -0,0 +1,46 @@ +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// UnhealthyConditionApplyConfiguration represents an declarative configuration of the UnhealthyCondition type for use +// with apply. +type UnhealthyConditionApplyConfiguration struct { + Type *v1.NodeConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Timeout *metav1.Duration `json:"timeout,omitempty"` +} + +// UnhealthyConditionApplyConfiguration constructs an declarative configuration of the UnhealthyCondition type for use with +// apply. +func UnhealthyCondition() *UnhealthyConditionApplyConfiguration { + return &UnhealthyConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *UnhealthyConditionApplyConfiguration) WithType(value v1.NodeConditionType) *UnhealthyConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *UnhealthyConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *UnhealthyConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithTimeout sets the Timeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Timeout field is set to the value of the last call. +func (b *UnhealthyConditionApplyConfiguration) WithTimeout(value metav1.Duration) *UnhealthyConditionApplyConfiguration { + b.Timeout = &value + return b +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/clientset.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/clientset.go new file mode 100644 index 0000000000..c947837dcd --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/clientset.go @@ -0,0 +1,118 @@ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + machinev1 "github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1" + machinev1beta1 "github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + MachineV1() machinev1.MachineV1Interface + MachineV1beta1() machinev1beta1.MachineV1beta1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + machineV1 *machinev1.MachineV1Client + machineV1beta1 *machinev1beta1.MachineV1beta1Client +} + +// MachineV1 retrieves the MachineV1Client +func (c *Clientset) MachineV1() machinev1.MachineV1Interface { + return c.machineV1 +} + +// MachineV1beta1 retrieves the MachineV1beta1Client +func (c *Clientset) MachineV1beta1() machinev1beta1.MachineV1beta1Interface { + return c.machineV1beta1 +} + +// 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. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.machineV1, err = machinev1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.machineV1beta1, err = machinev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + 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 { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.machineV1 = machinev1.New(c) + cs.machineV1beta1 = machinev1beta1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/doc.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/doc.go new file mode 100644 index 0000000000..0e0c2a8900 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/doc.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..14db57a58f --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/register.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..ae76a202b4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/scheme/register.go @@ -0,0 +1,42 @@ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + machinev1 "github.com/openshift/api/machine/v1" + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + machinev1.AddToScheme, + machinev1beta1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// 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) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/controlplanemachineset.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/controlplanemachineset.go new file mode 100644 index 0000000000..ba2553379c --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/controlplanemachineset.go @@ -0,0 +1,240 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1 "github.com/openshift/api/machine/v1" + machinev1 "github.com/openshift/client-go/machine/applyconfigurations/machine/v1" + scheme "github.com/openshift/client-go/machine/clientset/versioned/scheme" + metav1 "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" +) + +// ControlPlaneMachineSetsGetter has a method to return a ControlPlaneMachineSetInterface. +// A group's client should implement this interface. +type ControlPlaneMachineSetsGetter interface { + ControlPlaneMachineSets(namespace string) ControlPlaneMachineSetInterface +} + +// ControlPlaneMachineSetInterface has methods to work with ControlPlaneMachineSet resources. +type ControlPlaneMachineSetInterface interface { + Create(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.CreateOptions) (*v1.ControlPlaneMachineSet, error) + Update(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.UpdateOptions) (*v1.ControlPlaneMachineSet, error) + UpdateStatus(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.UpdateOptions) (*v1.ControlPlaneMachineSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ControlPlaneMachineSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ControlPlaneMachineSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControlPlaneMachineSet, err error) + Apply(ctx context.Context, controlPlaneMachineSet *machinev1.ControlPlaneMachineSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControlPlaneMachineSet, err error) + ApplyStatus(ctx context.Context, controlPlaneMachineSet *machinev1.ControlPlaneMachineSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControlPlaneMachineSet, err error) + ControlPlaneMachineSetExpansion +} + +// controlPlaneMachineSets implements ControlPlaneMachineSetInterface +type controlPlaneMachineSets struct { + client rest.Interface + ns string +} + +// newControlPlaneMachineSets returns a ControlPlaneMachineSets +func newControlPlaneMachineSets(c *MachineV1Client, namespace string) *controlPlaneMachineSets { + return &controlPlaneMachineSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the controlPlaneMachineSet, and returns the corresponding controlPlaneMachineSet object, and an error if there is any. +func (c *controlPlaneMachineSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControlPlaneMachineSet, err error) { + result = &v1.ControlPlaneMachineSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ControlPlaneMachineSets that match those selectors. +func (c *controlPlaneMachineSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControlPlaneMachineSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ControlPlaneMachineSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested controlPlaneMachineSets. +func (c *controlPlaneMachineSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a controlPlaneMachineSet and creates it. Returns the server's representation of the controlPlaneMachineSet, and an error, if there is any. +func (c *controlPlaneMachineSets) Create(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.CreateOptions) (result *v1.ControlPlaneMachineSet, err error) { + result = &v1.ControlPlaneMachineSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(controlPlaneMachineSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a controlPlaneMachineSet and updates it. Returns the server's representation of the controlPlaneMachineSet, and an error, if there is any. +func (c *controlPlaneMachineSets) Update(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.UpdateOptions) (result *v1.ControlPlaneMachineSet, err error) { + result = &v1.ControlPlaneMachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(controlPlaneMachineSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(controlPlaneMachineSet). + Do(ctx). + 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 *controlPlaneMachineSets) UpdateStatus(ctx context.Context, controlPlaneMachineSet *v1.ControlPlaneMachineSet, opts metav1.UpdateOptions) (result *v1.ControlPlaneMachineSet, err error) { + result = &v1.ControlPlaneMachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(controlPlaneMachineSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(controlPlaneMachineSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the controlPlaneMachineSet and deletes it. Returns an error if one occurs. +func (c *controlPlaneMachineSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *controlPlaneMachineSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("controlplanemachinesets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched controlPlaneMachineSet. +func (c *controlPlaneMachineSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControlPlaneMachineSet, err error) { + result = &v1.ControlPlaneMachineSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied controlPlaneMachineSet. +func (c *controlPlaneMachineSets) Apply(ctx context.Context, controlPlaneMachineSet *machinev1.ControlPlaneMachineSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControlPlaneMachineSet, err error) { + if controlPlaneMachineSet == nil { + return nil, fmt.Errorf("controlPlaneMachineSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(controlPlaneMachineSet) + if err != nil { + return nil, err + } + name := controlPlaneMachineSet.Name + if name == nil { + return nil, fmt.Errorf("controlPlaneMachineSet.Name must be provided to Apply") + } + result = &v1.ControlPlaneMachineSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *controlPlaneMachineSets) ApplyStatus(ctx context.Context, controlPlaneMachineSet *machinev1.ControlPlaneMachineSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControlPlaneMachineSet, err error) { + if controlPlaneMachineSet == nil { + return nil, fmt.Errorf("controlPlaneMachineSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(controlPlaneMachineSet) + if err != nil { + return nil, err + } + + name := controlPlaneMachineSet.Name + if name == nil { + return nil, fmt.Errorf("controlPlaneMachineSet.Name must be provided to Apply") + } + + result = &v1.ControlPlaneMachineSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("controlplanemachinesets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/doc.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/doc.go new file mode 100644 index 0000000000..225e6b2be3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/generated_expansion.go new file mode 100644 index 0000000000..6ff020361e --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/generated_expansion.go @@ -0,0 +1,5 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ControlPlaneMachineSetExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/machine_client.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/machine_client.go new file mode 100644 index 0000000000..cc8837e7b3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1/machine_client.go @@ -0,0 +1,91 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + v1 "github.com/openshift/api/machine/v1" + "github.com/openshift/client-go/machine/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MachineV1Interface interface { + RESTClient() rest.Interface + ControlPlaneMachineSetsGetter +} + +// MachineV1Client is used to interact with features provided by the machine.openshift.io group. +type MachineV1Client struct { + restClient rest.Interface +} + +func (c *MachineV1Client) ControlPlaneMachineSets(namespace string) ControlPlaneMachineSetInterface { + return newControlPlaneMachineSets(c, namespace) +} + +// NewForConfig creates a new MachineV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MachineV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new MachineV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MachineV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &MachineV1Client{client}, nil +} + +// NewForConfigOrDie creates a new MachineV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MachineV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MachineV1Client for the given RESTClient. +func New(c rest.Interface) *MachineV1Client { + return &MachineV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + 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 *MachineV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/doc.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/doc.go new file mode 100644 index 0000000000..897c0995f8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/generated_expansion.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/generated_expansion.go new file mode 100644 index 0000000000..d45fc4afe5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/generated_expansion.go @@ -0,0 +1,9 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +type MachineExpansion interface{} + +type MachineHealthCheckExpansion interface{} + +type MachineSetExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine.go new file mode 100644 index 0000000000..442f569577 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine.go @@ -0,0 +1,240 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1beta1 "github.com/openshift/api/machine/v1beta1" + machinev1beta1 "github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1" + scheme "github.com/openshift/client-go/machine/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachinesGetter has a method to return a MachineInterface. +// A group's client should implement this interface. +type MachinesGetter interface { + Machines(namespace string) MachineInterface +} + +// MachineInterface has methods to work with Machine resources. +type MachineInterface interface { + Create(ctx context.Context, machine *v1beta1.Machine, opts v1.CreateOptions) (*v1beta1.Machine, error) + Update(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (*v1beta1.Machine, error) + UpdateStatus(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (*v1beta1.Machine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Machine, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Machine, err error) + Apply(ctx context.Context, machine *machinev1beta1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Machine, err error) + ApplyStatus(ctx context.Context, machine *machinev1beta1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + client rest.Interface + ns string +} + +// newMachines returns a Machines +func newMachines(c *MachineV1beta1Client, namespace string) *machines { + return &machines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *machines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *machines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *machines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Create(ctx context.Context, machine *v1beta1.Machine, opts v1.CreateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. +func (c *machines) Update(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + 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 *machines) UpdateStatus(ctx context.Context, machine *v1beta1.Machine, opts v1.UpdateOptions) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *machines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machine. +func (c *machines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Machine, err error) { + result = &v1beta1.Machine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied machine. +func (c *machines) Apply(ctx context.Context, machine *machinev1beta1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + result = &v1beta1.Machine{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machines"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *machines) ApplyStatus(ctx context.Context, machine *machinev1beta1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Machine, err error) { + if machine == nil { + return nil, fmt.Errorf("machine provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machine) + if err != nil { + return nil, err + } + + name := machine.Name + if name == nil { + return nil, fmt.Errorf("machine.Name must be provided to Apply") + } + + result = &v1beta1.Machine{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machines"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine_client.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine_client.go new file mode 100644 index 0000000000..0ccff6258e --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machine_client.go @@ -0,0 +1,101 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "net/http" + + v1beta1 "github.com/openshift/api/machine/v1beta1" + "github.com/openshift/client-go/machine/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type MachineV1beta1Interface interface { + RESTClient() rest.Interface + MachinesGetter + MachineHealthChecksGetter + MachineSetsGetter +} + +// MachineV1beta1Client is used to interact with features provided by the machine.openshift.io group. +type MachineV1beta1Client struct { + restClient rest.Interface +} + +func (c *MachineV1beta1Client) Machines(namespace string) MachineInterface { + return newMachines(c, namespace) +} + +func (c *MachineV1beta1Client) MachineHealthChecks(namespace string) MachineHealthCheckInterface { + return newMachineHealthChecks(c, namespace) +} + +func (c *MachineV1beta1Client) MachineSets(namespace string) MachineSetInterface { + return newMachineSets(c, namespace) +} + +// NewForConfig creates a new MachineV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MachineV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new MachineV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MachineV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &MachineV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new MachineV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MachineV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MachineV1beta1Client for the given RESTClient. +func New(c rest.Interface) *MachineV1beta1Client { + return &MachineV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + 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 *MachineV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..87e9dc24fc --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,240 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1beta1 "github.com/openshift/api/machine/v1beta1" + machinev1beta1 "github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1" + scheme "github.com/openshift/client-go/machine/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachineHealthChecksGetter has a method to return a MachineHealthCheckInterface. +// A group's client should implement this interface. +type MachineHealthChecksGetter interface { + MachineHealthChecks(namespace string) MachineHealthCheckInterface +} + +// MachineHealthCheckInterface has methods to work with MachineHealthCheck resources. +type MachineHealthCheckInterface interface { + Create(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.CreateOptions) (*v1beta1.MachineHealthCheck, error) + Update(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (*v1beta1.MachineHealthCheck, error) + UpdateStatus(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (*v1beta1.MachineHealthCheck, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MachineHealthCheck, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineHealthCheckList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineHealthCheck, err error) + Apply(ctx context.Context, machineHealthCheck *machinev1beta1.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineHealthCheck, err error) + ApplyStatus(ctx context.Context, machineHealthCheck *machinev1beta1.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineHealthCheck, err error) + MachineHealthCheckExpansion +} + +// machineHealthChecks implements MachineHealthCheckInterface +type machineHealthChecks struct { + client rest.Interface + ns string +} + +// newMachineHealthChecks returns a MachineHealthChecks +func newMachineHealthChecks(c *MachineV1beta1Client, namespace string) *machineHealthChecks { + return &machineHealthChecks{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineHealthCheck, and returns the corresponding machineHealthCheck object, and an error if there is any. +func (c *machineHealthChecks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineHealthChecks that match those selectors. +func (c *machineHealthChecks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineHealthCheckList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineHealthCheckList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineHealthChecks. +func (c *machineHealthChecks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machineHealthCheck and creates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any. +func (c *machineHealthChecks) Create(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.CreateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machineHealthCheck and updates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any. +func (c *machineHealthChecks) Update(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(machineHealthCheck.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + 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 *machineHealthChecks) UpdateStatus(ctx context.Context, machineHealthCheck *v1beta1.MachineHealthCheck, opts v1.UpdateOptions) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(machineHealthCheck.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineHealthCheck). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machineHealthCheck and deletes it. Returns an error if one occurs. +func (c *machineHealthChecks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineHealthChecks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machinehealthchecks"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machineHealthCheck. +func (c *machineHealthChecks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineHealthCheck, err error) { + result = &v1beta1.MachineHealthCheck{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied machineHealthCheck. +func (c *machineHealthChecks) Apply(ctx context.Context, machineHealthCheck *machinev1beta1.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineHealthCheck, err error) { + if machineHealthCheck == nil { + return nil, fmt.Errorf("machineHealthCheck provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machineHealthCheck) + if err != nil { + return nil, err + } + name := machineHealthCheck.Name + if name == nil { + return nil, fmt.Errorf("machineHealthCheck.Name must be provided to Apply") + } + result = &v1beta1.MachineHealthCheck{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *machineHealthChecks) ApplyStatus(ctx context.Context, machineHealthCheck *machinev1beta1.MachineHealthCheckApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineHealthCheck, err error) { + if machineHealthCheck == nil { + return nil, fmt.Errorf("machineHealthCheck provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machineHealthCheck) + if err != nil { + return nil, err + } + + name := machineHealthCheck.Name + if name == nil { + return nil, fmt.Errorf("machineHealthCheck.Name must be provided to Apply") + } + + result = &v1beta1.MachineHealthCheck{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machinehealthchecks"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machineset.go b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..8d452b977b --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1/machineset.go @@ -0,0 +1,240 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + v1beta1 "github.com/openshift/api/machine/v1beta1" + machinev1beta1 "github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1" + scheme "github.com/openshift/client-go/machine/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// MachineSetsGetter has a method to return a MachineSetInterface. +// A group's client should implement this interface. +type MachineSetsGetter interface { + MachineSets(namespace string) MachineSetInterface +} + +// MachineSetInterface has methods to work with MachineSet resources. +type MachineSetInterface interface { + Create(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.CreateOptions) (*v1beta1.MachineSet, error) + Update(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (*v1beta1.MachineSet, error) + UpdateStatus(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (*v1beta1.MachineSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MachineSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MachineSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineSet, err error) + Apply(ctx context.Context, machineSet *machinev1beta1.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineSet, err error) + ApplyStatus(ctx context.Context, machineSet *machinev1beta1.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineSet, err error) + MachineSetExpansion +} + +// machineSets implements MachineSetInterface +type machineSets struct { + client rest.Interface + ns string +} + +// newMachineSets returns a MachineSets +func newMachineSets(c *MachineV1beta1Client, namespace string) *machineSets { + return &machineSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any. +func (c *machineSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MachineSets that match those selectors. +func (c *machineSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MachineSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MachineSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machineSets. +func (c *machineSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Create(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.CreateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any. +func (c *machineSets) Update(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + 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 *machineSets) UpdateStatus(ctx context.Context, machineSet *v1beta1.MachineSet, opts v1.UpdateOptions) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machinesets"). + Name(machineSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machineSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machineSet and deletes it. Returns an error if one occurs. +func (c *machineSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machineSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machinesets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machineSet. +func (c *machineSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MachineSet, err error) { + result = &v1beta1.MachineSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machinesets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied machineSet. +func (c *machineSets) Apply(ctx context.Context, machineSet *machinev1beta1.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineSet, err error) { + if machineSet == nil { + return nil, fmt.Errorf("machineSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machineSet) + if err != nil { + return nil, err + } + name := machineSet.Name + if name == nil { + return nil, fmt.Errorf("machineSet.Name must be provided to Apply") + } + result = &v1beta1.MachineSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machinesets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *machineSets) ApplyStatus(ctx context.Context, machineSet *machinev1beta1.MachineSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MachineSet, err error) { + if machineSet == nil { + return nil, fmt.Errorf("machineSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(machineSet) + if err != nil { + return nil, err + } + + name := machineSet.Name + if name == nil { + return nil, fmt.Errorf("machineSet.Name must be provided to Apply") + } + + result = &v1beta1.MachineSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("machinesets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/factory.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/factory.go new file mode 100644 index 0000000000..65711bbedb --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/factory.go @@ -0,0 +1,164 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/openshift/client-go/machine/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + machine "github.com/openshift/client-go/machine/informers/externalversions/machine" + 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" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.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. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// 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 versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + 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 versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + 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. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Machine() machine.Interface +} + +func (f *sharedInformerFactory) Machine() machine.Interface { + return machine.New(f, f.namespace, f.tweakListOptions) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/generic.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/generic.go new file mode 100644 index 0000000000..8e1118040c --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/generic.go @@ -0,0 +1,55 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1 "github.com/openshift/api/machine/v1" + v1beta1 "github.com/openshift/api/machine/v1beta1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=machine.openshift.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("controlplanemachinesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1().ControlPlaneMachineSets().Informer()}, nil + + // Group=machine.openshift.io, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithResource("machines"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().Machines().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("machinehealthchecks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().MachineHealthChecks().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("machinesets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Machine().V1beta1().MachineSets().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..d777be27e1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,24 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/openshift/client-go/machine/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/interface.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/interface.go new file mode 100644 index 0000000000..f6fede1e16 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/interface.go @@ -0,0 +1,38 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package machine + +import ( + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/machine/informers/externalversions/machine/v1" + v1beta1 "github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface + // V1beta1 provides access to shared informers for resources in V1beta1. + V1beta1() v1beta1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} + +// V1beta1 returns a new v1beta1.Interface. +func (g *group) V1beta1() v1beta1.Interface { + return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/controlplanemachineset.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/controlplanemachineset.go new file mode 100644 index 0000000000..04a67838cb --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/controlplanemachineset.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + machinev1 "github.com/openshift/api/machine/v1" + versioned "github.com/openshift/client-go/machine/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/machine/listers/machine/v1" + metav1 "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" +) + +// ControlPlaneMachineSetInformer provides access to a shared informer and lister for +// ControlPlaneMachineSets. +type ControlPlaneMachineSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ControlPlaneMachineSetLister +} + +type controlPlaneMachineSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewControlPlaneMachineSetInformer constructs a new informer for ControlPlaneMachineSet 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 NewControlPlaneMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredControlPlaneMachineSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredControlPlaneMachineSetInformer constructs a new informer for ControlPlaneMachineSet 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 NewFilteredControlPlaneMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1().ControlPlaneMachineSets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1().ControlPlaneMachineSets(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1.ControlPlaneMachineSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *controlPlaneMachineSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredControlPlaneMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *controlPlaneMachineSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1.ControlPlaneMachineSet{}, f.defaultInformer) +} + +func (f *controlPlaneMachineSetInformer) Lister() v1.ControlPlaneMachineSetLister { + return v1.NewControlPlaneMachineSetLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/interface.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/interface.go new file mode 100644 index 0000000000..baaae7d4b9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1/interface.go @@ -0,0 +1,29 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ControlPlaneMachineSets returns a ControlPlaneMachineSetInformer. + ControlPlaneMachineSets() ControlPlaneMachineSetInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ControlPlaneMachineSets returns a ControlPlaneMachineSetInformer. +func (v *version) ControlPlaneMachineSets() ControlPlaneMachineSetInformer { + return &controlPlaneMachineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/interface.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/interface.go new file mode 100644 index 0000000000..7c9f54eb93 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/interface.go @@ -0,0 +1,43 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Machines returns a MachineInformer. + Machines() MachineInformer + // MachineHealthChecks returns a MachineHealthCheckInformer. + MachineHealthChecks() MachineHealthCheckInformer + // MachineSets returns a MachineSetInformer. + MachineSets() MachineSetInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Machines returns a MachineInformer. +func (v *version) Machines() MachineInformer { + return &machineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineHealthChecks returns a MachineHealthCheckInformer. +func (v *version) MachineHealthChecks() MachineHealthCheckInformer { + return &machineHealthCheckInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// MachineSets returns a MachineSetInformer. +func (v *version) MachineSets() MachineSetInformer { + return &machineSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machine.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machine.go new file mode 100644 index 0000000000..c943acffb7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machine.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + versioned "github.com/openshift/client-go/machine/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/client-go/machine/listers/machine/v1beta1" + 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" +) + +// MachineInformer provides access to a shared informer and lister for +// Machines. +type MachineInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineLister +} + +type machineInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineInformer constructs a new informer for Machine 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 NewMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineInformer constructs a new informer for Machine 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 NewFilteredMachineInformer(client versioned.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.MachineV1beta1().Machines(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().Machines(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.Machine{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.Machine{}, f.defaultInformer) +} + +func (f *machineInformer) Lister() v1beta1.MachineLister { + return v1beta1.NewMachineLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..534bcb3730 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + versioned "github.com/openshift/client-go/machine/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/client-go/machine/listers/machine/v1beta1" + 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" +) + +// MachineHealthCheckInformer provides access to a shared informer and lister for +// MachineHealthChecks. +type MachineHealthCheckInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineHealthCheckLister +} + +type machineHealthCheckInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineHealthCheckInformer constructs a new informer for MachineHealthCheck 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 NewMachineHealthCheckInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineHealthCheckInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineHealthCheckInformer constructs a new informer for MachineHealthCheck 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 NewFilteredMachineHealthCheckInformer(client versioned.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.MachineV1beta1().MachineHealthChecks(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineHealthChecks(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.MachineHealthCheck{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineHealthCheckInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineHealthCheckInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineHealthCheckInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineHealthCheck{}, f.defaultInformer) +} + +func (f *machineHealthCheckInformer) Lister() v1beta1.MachineHealthCheckLister { + return v1beta1.NewMachineHealthCheckLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machineset.go b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..62ffcfbc55 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1/machineset.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + versioned "github.com/openshift/client-go/machine/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces" + v1beta1 "github.com/openshift/client-go/machine/listers/machine/v1beta1" + 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" +) + +// MachineSetInformer provides access to a shared informer and lister for +// MachineSets. +type MachineSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.MachineSetLister +} + +type machineSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewMachineSetInformer constructs a new informer for MachineSet 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 NewMachineSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredMachineSetInformer constructs a new informer for MachineSet 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 NewFilteredMachineSetInformer(client versioned.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.MachineV1beta1().MachineSets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.MachineV1beta1().MachineSets(namespace).Watch(context.TODO(), options) + }, + }, + &machinev1beta1.MachineSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *machineSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMachineSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *machineSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&machinev1beta1.MachineSet{}, f.defaultInformer) +} + +func (f *machineSetInformer) Lister() v1beta1.MachineSetLister { + return v1beta1.NewMachineSetLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1/controlplanemachineset.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1/controlplanemachineset.go new file mode 100644 index 0000000000..950243d376 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1/controlplanemachineset.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/machine/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ControlPlaneMachineSetLister helps list ControlPlaneMachineSets. +// All objects returned here must be treated as read-only. +type ControlPlaneMachineSetLister interface { + // List lists all ControlPlaneMachineSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ControlPlaneMachineSet, err error) + // ControlPlaneMachineSets returns an object that can list and get ControlPlaneMachineSets. + ControlPlaneMachineSets(namespace string) ControlPlaneMachineSetNamespaceLister + ControlPlaneMachineSetListerExpansion +} + +// controlPlaneMachineSetLister implements the ControlPlaneMachineSetLister interface. +type controlPlaneMachineSetLister struct { + indexer cache.Indexer +} + +// NewControlPlaneMachineSetLister returns a new ControlPlaneMachineSetLister. +func NewControlPlaneMachineSetLister(indexer cache.Indexer) ControlPlaneMachineSetLister { + return &controlPlaneMachineSetLister{indexer: indexer} +} + +// List lists all ControlPlaneMachineSets in the indexer. +func (s *controlPlaneMachineSetLister) List(selector labels.Selector) (ret []*v1.ControlPlaneMachineSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ControlPlaneMachineSet)) + }) + return ret, err +} + +// ControlPlaneMachineSets returns an object that can list and get ControlPlaneMachineSets. +func (s *controlPlaneMachineSetLister) ControlPlaneMachineSets(namespace string) ControlPlaneMachineSetNamespaceLister { + return controlPlaneMachineSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ControlPlaneMachineSetNamespaceLister helps list and get ControlPlaneMachineSets. +// All objects returned here must be treated as read-only. +type ControlPlaneMachineSetNamespaceLister interface { + // List lists all ControlPlaneMachineSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ControlPlaneMachineSet, err error) + // Get retrieves the ControlPlaneMachineSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ControlPlaneMachineSet, error) + ControlPlaneMachineSetNamespaceListerExpansion +} + +// controlPlaneMachineSetNamespaceLister implements the ControlPlaneMachineSetNamespaceLister +// interface. +type controlPlaneMachineSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ControlPlaneMachineSets in the indexer for a given namespace. +func (s controlPlaneMachineSetNamespaceLister) List(selector labels.Selector) (ret []*v1.ControlPlaneMachineSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ControlPlaneMachineSet)) + }) + return ret, err +} + +// Get retrieves the ControlPlaneMachineSet from the indexer for a given namespace and name. +func (s controlPlaneMachineSetNamespaceLister) Get(name string) (*v1.ControlPlaneMachineSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("controlplanemachineset"), name) + } + return obj.(*v1.ControlPlaneMachineSet), nil +} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1/expansion_generated.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1/expansion_generated.go new file mode 100644 index 0000000000..73319fcdf1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1/expansion_generated.go @@ -0,0 +1,11 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// ControlPlaneMachineSetListerExpansion allows custom methods to be added to +// ControlPlaneMachineSetLister. +type ControlPlaneMachineSetListerExpansion interface{} + +// ControlPlaneMachineSetNamespaceListerExpansion allows custom methods to be added to +// ControlPlaneMachineSetNamespaceLister. +type ControlPlaneMachineSetNamespaceListerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/expansion_generated.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/expansion_generated.go new file mode 100644 index 0000000000..777f3e3c8b --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/expansion_generated.go @@ -0,0 +1,27 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +// MachineListerExpansion allows custom methods to be added to +// MachineLister. +type MachineListerExpansion interface{} + +// MachineNamespaceListerExpansion allows custom methods to be added to +// MachineNamespaceLister. +type MachineNamespaceListerExpansion interface{} + +// MachineHealthCheckListerExpansion allows custom methods to be added to +// MachineHealthCheckLister. +type MachineHealthCheckListerExpansion interface{} + +// MachineHealthCheckNamespaceListerExpansion allows custom methods to be added to +// MachineHealthCheckNamespaceLister. +type MachineHealthCheckNamespaceListerExpansion interface{} + +// MachineSetListerExpansion allows custom methods to be added to +// MachineSetLister. +type MachineSetListerExpansion interface{} + +// MachineSetNamespaceListerExpansion allows custom methods to be added to +// MachineSetNamespaceLister. +type MachineSetNamespaceListerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machine.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machine.go new file mode 100644 index 0000000000..3b4cb164be --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machine.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineLister helps list Machines. +// All objects returned here must be treated as read-only. +type MachineLister interface { + // List lists all Machines in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Machines returns an object that can list and get Machines. + Machines(namespace string) MachineNamespaceLister + MachineListerExpansion +} + +// machineLister implements the MachineLister interface. +type machineLister struct { + indexer cache.Indexer +} + +// NewMachineLister returns a new MachineLister. +func NewMachineLister(indexer cache.Indexer) MachineLister { + return &machineLister{indexer: indexer} +} + +// List lists all Machines in the indexer. +func (s *machineLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Machines returns an object that can list and get Machines. +func (s *machineLister) Machines(namespace string) MachineNamespaceLister { + return machineNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineNamespaceLister helps list and get Machines. +// All objects returned here must be treated as read-only. +type MachineNamespaceLister interface { + // List lists all Machines in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.Machine, err error) + // Get retrieves the Machine from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.Machine, error) + MachineNamespaceListerExpansion +} + +// machineNamespaceLister implements the MachineNamespaceLister +// interface. +type machineNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Machines in the indexer for a given namespace. +func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Machine, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.Machine)) + }) + return ret, err +} + +// Get retrieves the Machine from the indexer for a given namespace and name. +func (s machineNamespaceLister) Get(name string) (*v1beta1.Machine, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machine"), name) + } + return obj.(*v1beta1.Machine), nil +} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machinehealthcheck.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machinehealthcheck.go new file mode 100644 index 0000000000..fea0af7ccd --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machinehealthcheck.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineHealthCheckLister helps list MachineHealthChecks. +// All objects returned here must be treated as read-only. +type MachineHealthCheckLister interface { + // List lists all MachineHealthChecks in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) + // MachineHealthChecks returns an object that can list and get MachineHealthChecks. + MachineHealthChecks(namespace string) MachineHealthCheckNamespaceLister + MachineHealthCheckListerExpansion +} + +// machineHealthCheckLister implements the MachineHealthCheckLister interface. +type machineHealthCheckLister struct { + indexer cache.Indexer +} + +// NewMachineHealthCheckLister returns a new MachineHealthCheckLister. +func NewMachineHealthCheckLister(indexer cache.Indexer) MachineHealthCheckLister { + return &machineHealthCheckLister{indexer: indexer} +} + +// List lists all MachineHealthChecks in the indexer. +func (s *machineHealthCheckLister) List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineHealthCheck)) + }) + return ret, err +} + +// MachineHealthChecks returns an object that can list and get MachineHealthChecks. +func (s *machineHealthCheckLister) MachineHealthChecks(namespace string) MachineHealthCheckNamespaceLister { + return machineHealthCheckNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineHealthCheckNamespaceLister helps list and get MachineHealthChecks. +// All objects returned here must be treated as read-only. +type MachineHealthCheckNamespaceLister interface { + // List lists all MachineHealthChecks in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) + // Get retrieves the MachineHealthCheck from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.MachineHealthCheck, error) + MachineHealthCheckNamespaceListerExpansion +} + +// machineHealthCheckNamespaceLister implements the MachineHealthCheckNamespaceLister +// interface. +type machineHealthCheckNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineHealthChecks in the indexer for a given namespace. +func (s machineHealthCheckNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineHealthCheck, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineHealthCheck)) + }) + return ret, err +} + +// Get retrieves the MachineHealthCheck from the indexer for a given namespace and name. +func (s machineHealthCheckNamespaceLister) Get(name string) (*v1beta1.MachineHealthCheck, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machinehealthcheck"), name) + } + return obj.(*v1beta1.MachineHealthCheck), nil +} diff --git a/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machineset.go b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machineset.go new file mode 100644 index 0000000000..5ff65b657d --- /dev/null +++ b/vendor/github.com/openshift/client-go/machine/listers/machine/v1beta1/machineset.go @@ -0,0 +1,83 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/openshift/api/machine/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MachineSetLister helps list MachineSets. +// All objects returned here must be treated as read-only. +type MachineSetLister interface { + // List lists all MachineSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // MachineSets returns an object that can list and get MachineSets. + MachineSets(namespace string) MachineSetNamespaceLister + MachineSetListerExpansion +} + +// machineSetLister implements the MachineSetLister interface. +type machineSetLister struct { + indexer cache.Indexer +} + +// NewMachineSetLister returns a new MachineSetLister. +func NewMachineSetLister(indexer cache.Indexer) MachineSetLister { + return &machineSetLister{indexer: indexer} +} + +// List lists all MachineSets in the indexer. +func (s *machineSetLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// MachineSets returns an object that can list and get MachineSets. +func (s *machineSetLister) MachineSets(namespace string) MachineSetNamespaceLister { + return machineSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// MachineSetNamespaceLister helps list and get MachineSets. +// All objects returned here must be treated as read-only. +type MachineSetNamespaceLister interface { + // List lists all MachineSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) + // Get retrieves the MachineSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.MachineSet, error) + MachineSetNamespaceListerExpansion +} + +// machineSetNamespaceLister implements the MachineSetNamespaceLister +// interface. +type machineSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all MachineSets in the indexer for a given namespace. +func (s machineSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MachineSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.MachineSet)) + }) + return ret, err +} + +// Get retrieves the MachineSet from the indexer for a given namespace and name. +func (s machineSetNamespaceLister) Get(name string) (*v1beta1.MachineSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("machineset"), name) + } + return obj.(*v1beta1.MachineSet), nil +} diff --git a/vendor/k8s.io/code-generator/generate-groups.sh b/vendor/k8s.io/code-generator/generate-groups.sh old mode 100644 new mode 100755 diff --git a/vendor/k8s.io/code-generator/generate-internal-groups.sh b/vendor/k8s.io/code-generator/generate-internal-groups.sh old mode 100644 new mode 100755 diff --git a/vendor/modules.txt b/vendor/modules.txt index 76989dd2c9..93b6c89c96 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -263,6 +263,11 @@ github.com/coreos/ignition/v2/config/validate ## explicit; go 1.17 github.com/coreos/rpmostree-client-go/pkg/client github.com/coreos/rpmostree-client-go/pkg/imgref +# github.com/coreos/stream-metadata-go v0.4.3 +## explicit; go 1.18 +github.com/coreos/stream-metadata-go/arch +github.com/coreos/stream-metadata-go/stream +github.com/coreos/stream-metadata-go/stream/rhcos # github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687 ## explicit; go 1.18 github.com/coreos/vcontext/json @@ -928,6 +933,20 @@ github.com/openshift/client-go/machineconfiguration/informers/externalversions/m github.com/openshift/client-go/machineconfiguration/informers/externalversions/machineconfiguration/v1alpha1 github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1 github.com/openshift/client-go/machineconfiguration/listers/machineconfiguration/v1alpha1 +github.com/openshift/client-go/machine/applyconfigurations/internal +github.com/openshift/client-go/machine/applyconfigurations/machine/v1 +github.com/openshift/client-go/machine/applyconfigurations/machine/v1beta1 +github.com/openshift/client-go/machine/clientset/versioned +github.com/openshift/client-go/machine/clientset/versioned/scheme +github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1 +github.com/openshift/client-go/machine/clientset/versioned/typed/machine/v1beta1 +github.com/openshift/client-go/machine/informers/externalversions +github.com/openshift/client-go/machine/informers/externalversions/internalinterfaces +github.com/openshift/client-go/machine/informers/externalversions/machine +github.com/openshift/client-go/machine/informers/externalversions/machine/v1 +github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1 +github.com/openshift/client-go/machine/listers/machine/v1 +github.com/openshift/client-go/machine/listers/machine/v1beta1 github.com/openshift/client-go/operator/applyconfigurations/internal github.com/openshift/client-go/operator/applyconfigurations/operator/v1 github.com/openshift/client-go/operator/applyconfigurations/operator/v1alpha1 From a312a73d918c2dc63371dd4d6de650f2fb9e1cab Mon Sep 17 00:00:00 2001 From: David Date: Tue, 3 Oct 2023 15:11:17 -0400 Subject: [PATCH 2/5] controller: add arch detect, platform stubs, rbac --- cmd/machine-config-controller/start.go | 14 + internal/clients/builder.go | 6 + .../machineconfigcontroller/clusterrole.yaml | 6 + pkg/controller/common/constants.go | 3 + pkg/controller/common/controller_context.go | 6 + .../machine_set_boot_image_controller.go | 573 ++++++++++++++++++ 6 files changed, 608 insertions(+) create mode 100644 pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go diff --git a/cmd/machine-config-controller/start.go b/cmd/machine-config-controller/start.go index b94a39d404..6be464ff3a 100644 --- a/cmd/machine-config-controller/start.go +++ b/cmd/machine-config-controller/start.go @@ -14,6 +14,7 @@ import ( containerruntimeconfig "github.com/openshift/machine-config-operator/pkg/controller/container-runtime-config" "github.com/openshift/machine-config-operator/pkg/controller/drain" kubeletconfig "github.com/openshift/machine-config-operator/pkg/controller/kubelet-config" + machinesetbootimage "github.com/openshift/machine-config-operator/pkg/controller/machine-set-boot-image" "github.com/openshift/machine-config-operator/pkg/controller/node" "github.com/openshift/machine-config-operator/pkg/controller/render" "github.com/openshift/machine-config-operator/pkg/controller/template" @@ -87,6 +88,9 @@ func runStartCmd(_ *cobra.Command, _ []string) { ctrlctx.OpenShiftConfigKubeNamespacedInformerFactory.Start(ctrlctx.Stop) ctrlctx.OperatorInformerFactory.Start(ctrlctx.Stop) ctrlctx.ConfigInformerFactory.Start(ctrlctx.Stop) + ctrlctx.KubeNamespacedInformerFactory.Start(ctrlctx.Stop) + ctrlctx.MachineInformerFactory.Start(ctrlctx.Stop) + ctrlctx.KubeMAOSharedInformer.Start(ctrlctx.Stop) close(ctrlctx.InformersStarted) @@ -196,6 +200,16 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle ctx.ClientBuilder.MachineConfigClientOrDie("node-update-controller"), ctx.FeatureGateAccess, ), + machinesetbootimage.New( + ctx.ClientBuilder.KubeClientOrDie("machine-set-boot-image-controller"), + ctx.ClientBuilder.MachineClientOrDie("machine-set-boot-image-controller"), + ctx.KubeNamespacedInformerFactory.Core().V1().ConfigMaps(), + ctx.MachineInformerFactory.Machine().V1beta1().Machines(), + ctx.MachineInformerFactory.Machine().V1beta1().MachineSets(), + ctx.KubeMAOSharedInformer.Core().V1().Secrets(), + ctx.ConfigInformerFactory.Config().V1().Infrastructures(), + ctx.KubeInformerFactory.Core().V1().Nodes(), + ), ) return controllers diff --git a/internal/clients/builder.go b/internal/clients/builder.go index 6976e5de81..27a87f0af0 100644 --- a/internal/clients/builder.go +++ b/internal/clients/builder.go @@ -6,6 +6,7 @@ import ( buildclientset "github.com/openshift/client-go/build/clientset/versioned" configclientset "github.com/openshift/client-go/config/clientset/versioned" imageclientset "github.com/openshift/client-go/image/clientset/versioned" + mapiclientset "github.com/openshift/client-go/machine/clientset/versioned" mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned" operatorclientset "github.com/openshift/client-go/operator/clientset/versioned" apiext "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" @@ -66,6 +67,11 @@ func (cb *Builder) ImageClientOrDie(name string) imageclientset.Interface { return imageclientset.NewForConfigOrDie(rest.AddUserAgent(cb.config, name)) } +// MachineClientOrDie returns the machine api client interface for machine api objects. +func (cb *Builder) MachineClientOrDie(name string) mapiclientset.Interface { + return mapiclientset.NewForConfigOrDie(rest.AddUserAgent(cb.config, name)) +} + // GetBuilderConfig returns a copy of the builders *rest.Config func (cb *Builder) GetBuilderConfig() *rest.Config { return rest.CopyConfig(cb.config) diff --git a/manifests/machineconfigcontroller/clusterrole.yaml b/manifests/machineconfigcontroller/clusterrole.yaml index a45b04b067..c6737cc1ac 100644 --- a/manifests/machineconfigcontroller/clusterrole.yaml +++ b/manifests/machineconfigcontroller/clusterrole.yaml @@ -36,6 +36,12 @@ rules: - apiGroups: ["apps"] resources: ["daemonsets"] verbs: ["get"] +- apiGroups: ["machine.openshift.io"] + resources: ["machinesets"] + verbs: ["get", "list", "watch", "patch"] +- apiGroups: ["machine.openshift.io"] + resources: ["machines"] + verbs: ["list","watch"] - apiGroups: - authentication.k8s.io resources: diff --git a/pkg/controller/common/constants.go b/pkg/controller/common/constants.go index be4970a3c5..cfce06e252 100644 --- a/pkg/controller/common/constants.go +++ b/pkg/controller/common/constants.go @@ -64,4 +64,7 @@ const ( // MachineConfigRoleLabel is the role on MachineConfigs, used to select for pools MachineConfigRoleLabel = "machineconfiguration.openshift.io/role" + + // BootImagesConfigMapName is a Configmap of golden bootimages, updated by CVO on an upgrade + BootImagesConfigMapName = "coreos-bootimages" ) diff --git a/pkg/controller/common/controller_context.go b/pkg/controller/common/controller_context.go index 8d06a679f8..4f8bad4cae 100644 --- a/pkg/controller/common/controller_context.go +++ b/pkg/controller/common/controller_context.go @@ -6,6 +6,7 @@ import ( "time" configinformers "github.com/openshift/client-go/config/informers/externalversions" + machineinformersv1beta1 "github.com/openshift/client-go/machine/informers/externalversions" mcfginformers "github.com/openshift/client-go/machineconfiguration/informers/externalversions" operatorinformers "github.com/openshift/client-go/operator/informers/externalversions" @@ -56,6 +57,7 @@ type ControllerContext struct { ConfigInformerFactory configinformers.SharedInformerFactory OperatorInformerFactory operatorinformers.SharedInformerFactory KubeMAOSharedInformer informers.SharedInformerFactory + MachineInformerFactory machineinformersv1beta1.SharedInformerFactory FeatureGateAccess featuregates.FeatureGateAccess @@ -75,6 +77,7 @@ func CreateControllerContext(ctx context.Context, cb *clients.Builder) *Controll apiExtClient := cb.APIExtClientOrDie("apiext-shared-informer") configClient := cb.ConfigClientOrDie("config-shared-informer") operatorClient := cb.OperatorClientOrDie("operator-shared-informer") + machineClient := cb.MachineClientOrDie("machine-shared-informer") sharedInformers := mcfginformers.NewSharedInformerFactory(client, resyncPeriod()()) sharedNamespacedInformers := mcfginformers.NewFilteredSharedInformerFactory(client, resyncPeriod()(), MCONamespace, nil) kubeSharedInformer := informers.NewSharedInformerFactory(kubeClient, resyncPeriod()()) @@ -103,6 +106,8 @@ func CreateControllerContext(ctx context.Context, cb *clients.Builder) *Controll apiextinformers.WithNamespace(MCONamespace), apiextinformers.WithTweakListOptions(assignFilterLabels)) configSharedInformer := configinformers.NewSharedInformerFactory(configClient, resyncPeriod()()) operatorSharedInformer := operatorinformers.NewSharedInformerFactory(operatorClient, resyncPeriod()()) + machineSharedInformer := machineinformersv1beta1.NewSharedInformerFactoryWithOptions(machineClient, resyncPeriod()(), machineinformersv1beta1.WithNamespace("openshift-machine-api")) + desiredVersion := version.ReleaseVersion missingVersion := "0.0.1-snapshot" @@ -133,6 +138,7 @@ func CreateControllerContext(ctx context.Context, cb *clients.Builder) *Controll APIExtInformerFactory: apiExtSharedInformer, ConfigInformerFactory: configSharedInformer, OperatorInformerFactory: operatorSharedInformer, + MachineInformerFactory: machineSharedInformer, Stop: ctx.Done(), InformersStarted: make(chan struct{}), ResyncPeriod: resyncPeriod(), diff --git a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go new file mode 100644 index 0000000000..89204b9c5b --- /dev/null +++ b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go @@ -0,0 +1,573 @@ +package machineset + +import ( + "context" + "encoding/json" + "fmt" + "time" + + configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + kruntime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/jsonmergepatch" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/wait" + coreinformersv1 "k8s.io/client-go/informers/core/v1" + clientset "k8s.io/client-go/kubernetes" + corev1client "k8s.io/client-go/kubernetes/typed/core/v1" + corelisterv1 "k8s.io/client-go/listers/core/v1" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/tools/record" + "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" + "k8s.io/kubectl/pkg/scheme" + "sigs.k8s.io/yaml" + + machinev1beta1 "github.com/openshift/api/machine/v1beta1" + ctrlcommon "github.com/openshift/machine-config-operator/pkg/controller/common" + + machineclientset "github.com/openshift/client-go/machine/clientset/versioned" + machineinformers "github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1" + machinelisters "github.com/openshift/client-go/machine/listers/machine/v1beta1" + + archtranslater "github.com/coreos/stream-metadata-go/arch" + + osconfigv1 "github.com/openshift/api/config/v1" +) + +// Controller defines the machine-set-boot-image controller. +type Controller struct { + kubeClient clientset.Interface + machineClient machineclientset.Interface + eventRecorder record.EventRecorder + + mcoCmLister corelisterv1.ConfigMapLister + machineLister machinelisters.MachineLister + machineSetLister machinelisters.MachineSetLister + maoSecretLister corelisterv1.SecretLister + infraLister configlistersv1.InfrastructureLister + nodeLister corelisterv1.NodeLister + + mcoCmListerSynced cache.InformerSynced + machineListerSynced cache.InformerSynced + machineSetListerSynced cache.InformerSynced + maoSecretInformerSynced cache.InformerSynced + infraListerSynced cache.InformerSynced + nodeListerSynced cache.InformerSynced + + syncHandler func(ms string) error + enqueueMachineSet func(*machinev1beta1.MachineSet) + + queue workqueue.RateLimitingInterface +} + +const ( + // maxRetries is the number of times a machineset will be retried before dropping out of queue + maxRetries = 5 + // Name of machine api namespace + MachineAPINamespace = "openshift-machine-api" + + // Key to access stream data from the boot images configmap + StreamConfigMapKey = "stream" + + // Labels and Annotations required for determining architecture of a machineset + MachineAnnotationKey = "machine.openshift.io/machine" + ArchLabelKey = "kubernetes.io/arch" +) + +// New returns a new machine-set-boot-image controller. +func New( + kubeClient clientset.Interface, + machineClient machineclientset.Interface, + mcoCmInfomer coreinformersv1.ConfigMapInformer, + machineInformer machineinformers.MachineInformer, + machinesetInformer machineinformers.MachineSetInformer, + maoSecretInformer coreinformersv1.SecretInformer, + infraInformer configinformersv1.InfrastructureInformer, + nodeInformer coreinformersv1.NodeInformer, +) *Controller { + eventBroadcaster := record.NewBroadcaster() + eventBroadcaster.StartLogging(klog.Infof) + eventBroadcaster.StartRecordingToSink(&corev1client.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")}) + + ctrl := &Controller{ + kubeClient: kubeClient, + machineClient: machineClient, + eventRecorder: ctrlcommon.NamespacedEventRecorder(eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: "machineconfigcontroller-machinesetbootimagecontroller"})), + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "machineconfigcontroller-machinesetbootimagecontroller"), + } + + machinesetInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: ctrl.addMachineSet, + UpdateFunc: ctrl.updateMachineSet, + }) + + mcoCmInfomer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: ctrl.addConfigMap, + UpdateFunc: ctrl.updateConfigMap, + }) + + ctrl.syncHandler = ctrl.syncMachineSet + ctrl.enqueueMachineSet = ctrl.enqueue + + ctrl.mcoCmLister = mcoCmInfomer.Lister() + ctrl.machineLister = machineInformer.Lister() + ctrl.machineSetLister = machinesetInformer.Lister() + ctrl.maoSecretLister = maoSecretInformer.Lister() + ctrl.infraLister = infraInformer.Lister() + ctrl.nodeLister = nodeInformer.Lister() + + ctrl.mcoCmListerSynced = mcoCmInfomer.Informer().HasSynced + ctrl.machineListerSynced = machineInformer.Informer().HasSynced + ctrl.machineSetListerSynced = machinesetInformer.Informer().HasSynced + ctrl.maoSecretInformerSynced = maoSecretInformer.Informer().HasSynced + ctrl.infraListerSynced = infraInformer.Informer().HasSynced + ctrl.nodeListerSynced = nodeInformer.Informer().HasSynced + + return ctrl +} + +// Run executes the machine-set-boot-image controller. +func (ctrl *Controller) Run(workers int, stopCh <-chan struct{}) { + defer utilruntime.HandleCrash() + defer ctrl.queue.ShutDown() + + if !cache.WaitForCacheSync(stopCh, ctrl.mcoCmListerSynced, ctrl.machineSetListerSynced, ctrl.maoSecretInformerSynced, ctrl.infraListerSynced, + ctrl.nodeListerSynced, ctrl.machineListerSynced) { + return + } + + klog.Info("Starting MachineConfigController-MachineSetBootImageController") + defer klog.Info("Shutting down MachineConfigController-MachineSetBootImageController") + + for i := 0; i < workers; i++ { + go wait.Until(ctrl.worker, time.Second, stopCh) + } + + <-stopCh +} + +// worker runs a worker thread that just dequeues items, processes them, and marks them done. +// It enforces that the syncHandler is never invoked concurrently with the same key. +func (ctrl *Controller) worker() { + for ctrl.processNextWorkItem() { + } +} + +func (ctrl *Controller) processNextWorkItem() bool { + key, quit := ctrl.queue.Get() + if quit { + return false + } + defer ctrl.queue.Done(key) + + err := ctrl.syncHandler(key.(string)) + ctrl.handleErr(err, key) + + return true +} + +func (ctrl *Controller) handleErr(err error, key interface{}) { + if err == nil { + ctrl.queue.Forget(key) + return + } + + if ctrl.queue.NumRequeues(key) < maxRetries { + klog.V(2).Infof("Error syncing machineset %v: %v", key, err) + ctrl.queue.AddRateLimited(key) + return + } + + utilruntime.HandleError(err) + klog.V(2).Infof("Dropping machineset %q out of the work queue: %v", key, err) + ctrl.queue.Forget(key) + ctrl.queue.AddAfter(key, 1*time.Minute) +} + +func (ctrl *Controller) addMachineSet(obj interface{}) { + machineSet := obj.(*machinev1beta1.MachineSet) + klog.Infof("MachineSet %s added", machineSet.Name) + + // Update/Check all machinesets instead of just this one. This prevents needing to maintain a local + // store of machine set conditions. As this is using a lister, it is relatively inexpensive to do + // this. + err := ctrl.enqueueAllMachineSets() + if err != nil { + klog.Errorf("Error enqueuing all machine sets: %w", err) + } +} + +// TODO: This callback happens every ~15 minutes or so even if the machineset contents are not updated +// Perhaps worth implementing a diff check before starting the sync? + +func (ctrl *Controller) updateMachineSet(old, _ interface{}) { + oldMachineSet := old.(*machinev1beta1.MachineSet) + klog.Infof("MachineSet %s updated, reconciling all machinesets", oldMachineSet.Name) + + // Update all machinesets instead of just this once. This prevents needing to maintain a local + // store of machine set conditions. As this is using a lister, it is relatively inexpensive to do + // this. + err := ctrl.enqueueAllMachineSets() + if err != nil { + klog.Errorf("Error enqueuing all machine sets: %w", err) + } +} + +func (ctrl *Controller) addConfigMap(obj interface{}) { + configMap := obj.(*corev1.ConfigMap) + + // Take no action if this isn't the "golden" config map + if configMap.Name != ctrlcommon.BootImagesConfigMapName { + klog.V(4).Infof("configMap %s added, but does not match %s, skipping bootimage sync", configMap.Name, ctrlcommon.BootImagesConfigMapName) + return + } + + klog.Infof("configMap %s added, reconciling all machine sets", configMap.Name) + + // Update all machine sets since the "golden" configmap has been updated + err := ctrl.enqueueAllMachineSets() + if err != nil { + klog.Errorf("Error enqueuing all machine sets: %w", err) + } +} + +// TODO: This callback happens every ~15 minutes or so even if the configmap contents is not updated +// Perhaps worth implementing a diff check before starting the sync? +func (ctrl *Controller) updateConfigMap(old, _ interface{}) { + oldConfigMap := old.(*corev1.ConfigMap) + + // Take no action if this isn't the "golden" config map + if oldConfigMap.Name != ctrlcommon.BootImagesConfigMapName { + klog.V(4).Infof("configMap %s updated, but does not match %s, skipping bootimage sync", oldConfigMap.Name, ctrlcommon.BootImagesConfigMapName) + return + } + + klog.Infof("configMap %s updated, reconciling all machine sets", oldConfigMap.Name) + + // Update all machine sets since the "golden" configmap has been updated + ctrl.enqueueAllMachineSets() +} + +func (ctrl *Controller) enqueue(ms *machinev1beta1.MachineSet) { + key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(ms) + if err != nil { + utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %w", ms, err)) + return + } + + ctrl.queue.Add(key) +} + +// syncMachineSet will attempt to enqueue every machineset +func (ctrl *Controller) enqueueAllMachineSets() error { + + machineSets, err := ctrl.machineSetLister.List(labels.Everything()) + if err != nil { + return fmt.Errorf("failed to fetch MachineSet list during config map update %w", err) + } + + for _, machineSet := range machineSets { + ctrl.enqueueMachineSet(machineSet) + } + + return nil +} + +// syncMachineSet will attempt to reconcile the machineset with the given key. +// This function is not meant to be invoked concurrently with the same key. +func (ctrl *Controller) syncMachineSet(key string) error { + + // TODO: lower this level of all info logs in this function + startTime := time.Now() + klog.V(4).Infof("Started syncing machineset %q (%v)", key, startTime) + defer func() { + klog.V(4).Infof("Finished syncing machineset %q (%v)", key, time.Since(startTime)) + }() + + // Fetch the bootimage configmap + configMap, err := ctrl.mcoCmLister.ConfigMaps(ctrlcommon.MCONamespace).Get(ctrlcommon.BootImagesConfigMapName) + if configMap == nil || err != nil { + return fmt.Errorf("failed to fetch coreos-bootimages config map during machineset sync: %w", err) + } + + namespace, name, err := cache.SplitMetaNamespaceKey(key) + if err != nil { + return err + } + + // Fetch the machineset + machineSet, err := ctrl.machineSetLister.MachineSets(namespace).Get(name) + if machineSet == nil || apierrors.IsNotFound(err) { + return fmt.Errorf("failed to fetch machineset object during machineset sync: %w", err) + } + + // Fetch the architecture type of this machineset + arch, err := ctrl.getArchFromMachineSet(machineSet) + if err != nil { + return fmt.Errorf("failed to fetch architecture type of machineset %s, err: %w", machineSet.Name, err) + } + + // Fetch the infra object to determine the platform type + infra, err := ctrl.infraLister.Get("cluster") + if err != nil { + return fmt.Errorf("failed to fetch infra object during machineset sync: %w", err) + } + + // Check if the this MachineSet requires an update + patchRequired, newMachineSet, err := checkMachineSet(infra, machineSet, configMap, arch) + if err != nil { + return fmt.Errorf("failed to reconcile machineset %s, err: %w", machineSet.Name, err) + } + + // Patch the machineset if required + if patchRequired { + klog.Infof("Patching machineset %s", machineSet.Name) + ctrl.patchMachineSet(machineSet, newMachineSet) + } else { + klog.Infof("No patching required for machineset %s", machineSet.Name) + } + return nil +} + +// Returns architecture type for a given machine set +func (ctrl *Controller) getArchFromMachineSet(machineset *machinev1beta1.MachineSet) (arch string, err error) { + machineSelector, err := metav1.LabelSelectorAsSelector(&machineset.Spec.Selector) + + if err != nil { + return " ", fmt.Errorf("could not convert MachineSet label selector to selector, error: %w", err) + } + + machines, err := ctrl.machineLister.List(machineSelector) + if err != nil || len(machines) == 0 { + return " ", fmt.Errorf("could not find any machines linked to machineset, error: %w", err) + } + + // Any machine from this slice will be of the same architecture, so grab the first one + // Cycle through nodes, compare to annotations to find node with matching machine + + nodes, err := ctrl.nodeLister.List(labels.Everything()) + for _, node := range nodes { + if node.Annotations == nil { + continue + } + machine, nodeMatch := node.Annotations[MachineAnnotationKey] + _, machineName, err := cache.SplitMetaNamespaceKey(machine) + if err != nil { + return " ", fmt.Errorf("could not split machine name %s, error: %w", machineName, err) + } + // Compare machine name to machine obtained from earlier selector + // Search the labels of the node to find the arch label + if nodeMatch && machineName == machines[0].Name { + archLabelValue, archFound := node.Labels[ArchLabelKey] + if archFound { + return archtranslater.RpmArch(archLabelValue), nil + } + return " ", fmt.Errorf("architecture of node %s could not be determined from labels", node.Name) + + } + + } + // At this point, no node was found with this machineSet, exit sync attempt + return " ", fmt.Errorf("could not find any nodes attached to this machineset, error: %w", err) +} + +// This function patches the machineset object using the machineClient +// Returns an error if marshsalling or patching fails. +func (ctrl *Controller) patchMachineSet(oldMachineSet, newMachineSet *machinev1beta1.MachineSet) error { + machineSetMarshal, err := json.Marshal(oldMachineSet) + if err != nil { + return fmt.Errorf("unable to marshal old machineset: %w", err) + } + newMachineSetMarshal, err := json.Marshal(newMachineSet) + if err != nil { + return fmt.Errorf("unable to marshal new machineset: %w", err) + } + patchBytes, err := jsonmergepatch.CreateThreeWayJSONMergePatch(machineSetMarshal, newMachineSetMarshal, machineSetMarshal) + if err != nil { + return fmt.Errorf("unable to create patch for new machineset: %w", err) + } + _, err = ctrl.machineClient.MachineV1beta1().MachineSets(MachineAPINamespace).Patch(context.TODO(), oldMachineSet.Name, types.MergePatchType, patchBytes, metav1.PatchOptions{}) + if err != nil { + return fmt.Errorf("unable to patch new machineset: %w", err) + } + return nil +} + +// This function calls the appropriate reconcile function based on the infra type +// On success, it will return a bool indicating if a patch is required, and an updated +// machineset object if any. It will return an error if any of the above steps fail. +func checkMachineSet(infra *osconfigv1.Infrastructure, machineSet *machinev1beta1.MachineSet, configMap *corev1.ConfigMap, arch string) (bool, *machinev1beta1.MachineSet, error) { + switch infra.Status.PlatformStatus.Type { + case osconfigv1.AWSPlatformType: + return reconcileAWS(machineSet, configMap, arch) + case osconfigv1.AzurePlatformType: + return reconcileAzure(machineSet, configMap, arch) + case osconfigv1.BareMetalPlatformType: + return reconcileBareMetal(machineSet, configMap, arch) + case osconfigv1.AlibabaCloudPlatformType: + return reconcileAliBaba(machineSet, configMap, arch) + case osconfigv1.OpenStackPlatformType: + return reconcileOpenStack(machineSet, configMap, arch) + case osconfigv1.EquinixMetalPlatformType: + return reconcileEquinixMetal(machineSet, configMap, arch) + case osconfigv1.GCPPlatformType: + return reconcileGCP(machineSet, configMap, arch) + case osconfigv1.KubevirtPlatformType: + return reconcileKubevirt(machineSet, configMap, arch) + case osconfigv1.IBMCloudPlatformType: + return reconcileIBMCCloud(machineSet, configMap, arch) + case osconfigv1.LibvirtPlatformType: + return reconcileLibvirt(machineSet, configMap, arch) + case osconfigv1.VSpherePlatformType: + return reconcileVSphere(machineSet, configMap, arch) + case osconfigv1.NutanixPlatformType: + return reconcileNutanix(machineSet, configMap, arch) + case osconfigv1.OvirtPlatformType: + return reconcileOvirt(machineSet, configMap, arch) + case osconfigv1.ExternalPlatformType: + return reconcileExternal(machineSet, configMap, arch) + case osconfigv1.PowerVSPlatformType: + return reconcilePowerVS(machineSet, configMap, arch) + case osconfigv1.NonePlatformType: + return reconcileNone(machineSet, configMap, arch) + default: + return unmarshalToFindPlatform(machineSet, configMap, arch) + } +} + +// This function unmarshals the machineset's provider spec into +// a ProviderSpec object. Returns an error if providerSpec field is nil, +// or the unmarshal fails +func unmarshalProviderSpec(ms *machinev1beta1.MachineSet, providerSpec interface{}) error { + if ms.Spec.Template.Spec.ProviderSpec.Value == nil { + return fmt.Errorf("providerSpec field was empty") + } + if err := yaml.Unmarshal(ms.Spec.Template.Spec.ProviderSpec.Value.Raw, &providerSpec); err != nil { + return fmt.Errorf("unmarshal into providerSpec failedL %w", err) + } + return nil +} + +// This function marshals the ProviderSpec object into a MachineSet object. +// Returns an error if ProviderSpec or MachineSet is nil, or if the marshal fails +func marshalProviderSpec(ms *machinev1beta1.MachineSet, providerSpec interface{}) error { + if ms == nil { + return fmt.Errorf("MachineSet object was nil") + } + if providerSpec == nil { + return fmt.Errorf("ProviderSpec object was nil") + } + rawBytes, err := json.Marshal(providerSpec) + if err != nil { + return fmt.Errorf("marshal into machineset failed: %w", err) + } + ms.Spec.Template.Spec.ProviderSpec.Value = &kruntime.RawExtension{Raw: rawBytes} + return nil +} + +// This function unmarshals the golden stream configmap into a coreos +// stream object. Returns an error if the unmarshal fails. +func unmarshalStreamDataConfigMap(cm *corev1.ConfigMap, st interface{}) error { + if err := json.Unmarshal([]byte(cm.Data[StreamConfigMapKey]), &st); err != nil { + return fmt.Errorf("failed to parse CoreOS stream metadata: %w", err) + } + return nil +} + +// GCP reconciliation function. Key points: +// -GCP images aren't region specific +// -GCPMachineProviderSpec.Disk(s) stores actual bootimage URL +// -identical for x86_64/amd64 and aarch64/arm64 +func reconcileGCP(machineSet *machinev1beta1.MachineSet, configMap *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type GCP with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileAWS(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type AWS with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileAzure(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type Azure with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileBareMetal(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type BareMetal with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileAliBaba(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type AliBaba with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileOpenStack(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type OpenStack with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileEquinixMetal(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type EquinixMetal with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileKubevirt(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type Kubevirt with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileIBMCCloud(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type IBMCCloud with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileLibvirt(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type Libvirt with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileVSphere(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type VSphere with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileNutanix(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type Nutanix with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileOvirt(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type Ovirt with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcilePowerVS(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type PowerVS with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileExternal(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type External with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +func reconcileNone(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unsupported platform type None with %s arch", machineSet.Name, arch) + return false, nil, nil +} + +// TODO - unmarshal the providerspec into each ProviderSpec type until it succeeds, +// and then call the appropriate reconcile function. This is needed for multi platform +// support +func unmarshalToFindPlatform(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { + klog.Infof("Skipping machineset %s, unknown platform type with %s arch", machineSet.Name, arch) + return false, nil, nil +} From 995956335bf4198906bafd6f90dbbdbad5f67a54 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Dec 2023 14:45:47 -0500 Subject: [PATCH 3/5] controller: add gcp support --- .../machine_set_boot_image_controller.go | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go index 89204b9c5b..690e3a06d0 100644 --- a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go +++ b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go @@ -36,6 +36,7 @@ import ( machinelisters "github.com/openshift/client-go/machine/listers/machine/v1beta1" archtranslater "github.com/coreos/stream-metadata-go/arch" + "github.com/coreos/stream-metadata-go/stream" osconfigv1 "github.com/openshift/api/config/v1" ) @@ -485,8 +486,48 @@ func unmarshalStreamDataConfigMap(cm *corev1.ConfigMap, st interface{}) error { // -GCPMachineProviderSpec.Disk(s) stores actual bootimage URL // -identical for x86_64/amd64 and aarch64/arm64 func reconcileGCP(machineSet *machinev1beta1.MachineSet, configMap *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { - klog.Infof("Skipping machineset %s, unsupported platform type GCP with %s arch", machineSet.Name, arch) - return false, nil, nil + klog.Infof("Reconciling machineset %s on GCP, with arch %s", machineSet.Name, arch) + + // First, unmarshal the GCP providerSpec + providerSpec := new(machinev1beta1.GCPMachineProviderSpec) + if err := unmarshalProviderSpec(machineSet, providerSpec); err != nil { + return false, nil, err + } + + // Next, unmarshal the configmap into a stream object + streamData := new(stream.Stream) + if err := unmarshalStreamDataConfigMap(configMap, streamData); err != nil { + return false, nil, err + } + + // Construct the new target bootimage from the configmap + // This formatting is based on how the installer constructs + // the boot image during cluster bootstrap + newBootImage := fmt.Sprintf("projects/%s/global/images/%s", streamData.Architectures[arch].Images.Gcp.Project, streamData.Architectures[arch].Images.Gcp.Name) + + // Grab what the current bootimage is, compare to the newBootImage + // There is typically only one element in this Disk array, assume multiple to be safe + patchRequired = false + newProviderSpec := providerSpec.DeepCopy() + for idx, disk := range newProviderSpec.Disks { + if newBootImage != disk.Image { + klog.Infof("New target boot image: %s", newBootImage) + klog.Infof("Current image: %s", disk.Image) + patchRequired = true + newProviderSpec.Disks[idx].Image = newBootImage + } + } + + // TODO: Check if referenced secret is spec 3 here + + // If patch is required, marshal the new providerspec into the machineset + if patchRequired { + newMachineSet = machineSet.DeepCopy() + if err := marshalProviderSpec(newMachineSet, newProviderSpec); err != nil { + return false, nil, err + } + } + return patchRequired, newMachineSet, nil } func reconcileAWS(machineSet *machinev1beta1.MachineSet, _ *corev1.ConfigMap, arch string) (patchRequired bool, newMachineSet *machinev1beta1.MachineSet, err error) { From 61bc2f855e3b6d8e3dbbba2811f0d146efacf6d2 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 8 Nov 2023 13:45:03 -0500 Subject: [PATCH 4/5] controller: add ver check before boot image update --- pkg/controller/common/constants.go | 6 ++ .../machine_set_boot_image_controller.go | 28 +++++++++ pkg/operator/sync.go | 60 +++++++++++++++++++ 3 files changed, 94 insertions(+) diff --git a/pkg/controller/common/constants.go b/pkg/controller/common/constants.go index cfce06e252..484543cca6 100644 --- a/pkg/controller/common/constants.go +++ b/pkg/controller/common/constants.go @@ -67,4 +67,10 @@ const ( // BootImagesConfigMapName is a Configmap of golden bootimages, updated by CVO on an upgrade BootImagesConfigMapName = "coreos-bootimages" + + // MCOVersionHashKey is the key for indexing the MCO git version hash stored in the bootimages configmap + MCOVersionHashKey = "MCOVersionHash" + + // MCOReleaseImageVersionKey is the key for indexing the MCO release version stored in the bootimages configmap + MCOReleaseImageVersionKey = "MCOReleaseImageVersion" ) diff --git a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go index 690e3a06d0..235f235d9d 100644 --- a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go +++ b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go @@ -34,6 +34,7 @@ import ( machineclientset "github.com/openshift/client-go/machine/clientset/versioned" machineinformers "github.com/openshift/client-go/machine/informers/externalversions/machine/v1beta1" machinelisters "github.com/openshift/client-go/machine/listers/machine/v1beta1" + operatorversion "github.com/openshift/machine-config-operator/pkg/version" archtranslater "github.com/coreos/stream-metadata-go/arch" "github.com/coreos/stream-metadata-go/stream" @@ -297,6 +298,33 @@ func (ctrl *Controller) syncMachineSet(key string) error { return fmt.Errorf("failed to fetch coreos-bootimages config map during machineset sync: %w", err) } + // Take no action if the MCO hash version stored in the configmap does not match the current controller + // version. This is done by the operator when a master node successfully updates to a new image. This is + // to prevent machinesets from being updated before the operator itself has updated. + + versionHashFromCM, versionHashFound := configMap.Data[ctrlcommon.MCOVersionHashKey] + if !versionHashFound { + klog.Infof("failed to find mco version hash in %s configmap, sync will exit to wait for the MCO upgrade to complete", ctrlcommon.BootImagesConfigMapName) + return nil + } + if versionHashFromCM != operatorversion.Hash { + klog.Infof("mismatch between MCO hash version stored in configmap and current MCO version; sync will exit to wait for the MCO upgrade to complete") + return nil + } + releaseVersionFromCM, releaseVersionFound := configMap.Data[ctrlcommon.MCOReleaseImageVersionKey] + if !releaseVersionFound { + klog.Infof("failed to find mco release version in %s configmap, sync will exit to wait for the MCO upgrade to complete", ctrlcommon.BootImagesConfigMapName) + return nil + } + if releaseVersionFromCM != operatorversion.ReleaseVersion { + klog.Infof("mismatch between MCO release version stored in configmap and current MCO release version; sync will exit to wait for the MCO upgrade to complete") + return nil + } + + // TODO: Also check against the release version stored in the configmap under releaseVersion. This is currently broken as the version + // stored is "0.0.1-snapshot" and does not reflect the correct value. Tracked in this bug https://issues.redhat.com/browse/OCPBUGS-19824 + // The current hash and version check should be enough to skate by for now, but fixing this would be additional safety - djoshy + namespace, name, err := cache.SplitMetaNamespaceKey(key) if err != nil { return err diff --git a/pkg/operator/sync.go b/pkg/operator/sync.go index 6895ebf78d..c8814f7285 100644 --- a/pkg/operator/sync.go +++ b/pkg/operator/sync.go @@ -1265,6 +1265,11 @@ func (optr *Operator) syncRequiredMachineConfigPools(_ *renderConfig) error { } releaseVersion, _ := optr.vStore.Get("operator") + // Calling this on a "required" pool for now + if err := optr.stampBootImagesCM(pool); err != nil { + klog.Errorf("Failed to stamp bootimages configmap: %w", err) + } + if err := isMachineConfigPoolConfigurationValid(pool, version.Hash, releaseVersion, opURL, optr.mcLister.Get); err != nil { lastErr = fmt.Errorf("MachineConfigPool %s has not progressed to latest configuration: %w, retrying", pool.Name, err) syncerr := optr.syncUpgradeableStatus() @@ -1465,6 +1470,61 @@ func (optr *Operator) getCAsFromConfigMap(namespace, name, key string) ([]byte, return getCAsFromConfigMap(cm, key) } +// This function stamps the current operator version and commit hash in the boot images configmap +// that lives in the MCO namespace. Before doing so, it ensures that the pool is targeting an MC +// that is generated by the current version of the MCO and that the pool atleast has 1 upgraded node(or +// has completed an upgrade). This "stamp" is used by the machine set controller as a safety before +// it updates boot images. + +func (optr *Operator) stampBootImagesCM(pool *mcfgv1.MachineConfigPool) error { + + // Ensure the targeted MC for this pool was generated by the current MCO + renderedMC, err := optr.mcLister.Get(pool.Spec.Configuration.Name) + if err != nil { + return fmt.Errorf("failed to grab rendered MC %s, error: %w", pool.Spec.Configuration.Name, err) + } + if renderedMC.Annotations[ctrlcommon.ReleaseImageVersionAnnotationKey] != version.ReleaseVersion { + klog.V(4).Infof("rendered MC release version %s mismatch with operator release version %s", renderedMC.Annotations[ctrlcommon.ReleaseImageVersionAnnotationKey], version.ReleaseVersion) + return nil + } + if renderedMC.Annotations[ctrlcommon.GeneratedByControllerVersionAnnotationKey] != version.Hash { + klog.V(4).Infof("rendered MC commit hash %s mismatch with operator release commit hash %s", renderedMC.Annotations[ctrlcommon.GeneratedByControllerVersionAnnotationKey], version.Hash) + return nil + } + + // Check if the pool has atleast one updated node(mid-upgrade), or if the pool has completed the upgrade to the new config(the additional check for spec==status here is + // to ensure we are not checking an older "Updated" condition and the MCP fields haven't caught up yet + if (apihelpers.IsMachineConfigPoolConditionTrue(pool.Status.Conditions, mcfgv1.MachineConfigPoolUpdating) && pool.Status.UpdatedMachineCount > 0) || + (apihelpers.IsMachineConfigPoolConditionTrue(pool.Status.Conditions, mcfgv1.MachineConfigPoolUpdated) && (pool.Spec.Configuration.Name == pool.Status.Configuration.Name)) { + cm, err := optr.clusterCmLister.ConfigMaps(ctrlcommon.MCONamespace).Get(ctrlcommon.BootImagesConfigMapName) + if err != nil { + return fmt.Errorf("failed to grab boot images configmap: %w", err) + } + storedVersionHashFromCM, storedVersionHashFound := cm.Data[ctrlcommon.MCOVersionHashKey] + releaseVersionFromCM, releaseVersionFound := cm.Data[ctrlcommon.MCOReleaseImageVersionKey] + + if storedVersionHashFound && releaseVersionFound { + // No need to update if the existing versions are a match, exit + if storedVersionHashFromCM == version.Hash && releaseVersionFromCM == version.ReleaseVersion { + return nil + } + } + + // Stamp the configmap with newest commit hash and OCP release version + cm.Data[ctrlcommon.MCOVersionHashKey] = version.Hash + cm.Data[ctrlcommon.MCOReleaseImageVersionKey] = version.ReleaseVersion + + // Update the ConfigMap + _, err = optr.kubeClient.CoreV1().ConfigMaps(ctrlcommon.MCONamespace).Update(context.TODO(), cm, metav1.UpdateOptions{}) + if err != nil { + return fmt.Errorf("failed to update bootimages configmap %w", err) + } + klog.Infof("Stamped boot images configmap with %s and %s, machine pool updated count: %d", version.Hash, version.ReleaseVersion, pool.Status.UpdatedMachineCount) + + } + return nil +} + func getCAsFromConfigMap(cm *corev1.ConfigMap, key string) ([]byte, error) { if bd, bdok := cm.BinaryData[key]; bdok { return bd, nil From bf9193a76e62e09fa265fb30fcb19917f5eaa784 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 19 Dec 2023 10:07:16 -0500 Subject: [PATCH 5/5] controller: add feature gate detection --- cmd/machine-config-controller/start.go | 1 + .../machine_set_boot_image_controller.go | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/cmd/machine-config-controller/start.go b/cmd/machine-config-controller/start.go index 6be464ff3a..1a9c4ddf48 100644 --- a/cmd/machine-config-controller/start.go +++ b/cmd/machine-config-controller/start.go @@ -209,6 +209,7 @@ func createControllers(ctx *ctrlcommon.ControllerContext) []ctrlcommon.Controlle ctx.KubeMAOSharedInformer.Core().V1().Secrets(), ctx.ConfigInformerFactory.Config().V1().Infrastructures(), ctx.KubeInformerFactory.Core().V1().Nodes(), + ctx.FeatureGateAccess, ), ) diff --git a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go index 235f235d9d..3fdd9f2bd1 100644 --- a/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go +++ b/pkg/controller/machine-set-boot-image/machine_set_boot_image_controller.go @@ -8,6 +8,7 @@ import ( configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" + "github.com/openshift/library-go/pkg/operator/configobserver/featuregates" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -66,6 +67,9 @@ type Controller struct { enqueueMachineSet func(*machinev1beta1.MachineSet) queue workqueue.RateLimitingInterface + + featureGateAccess featuregates.FeatureGateAccess + featureEnabled bool } const ( @@ -92,6 +96,7 @@ func New( maoSecretInformer coreinformersv1.SecretInformer, infraInformer configinformersv1.InfrastructureInformer, nodeInformer coreinformersv1.NodeInformer, + featureGateAccess featuregates.FeatureGateAccess, ) *Controller { eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(klog.Infof) @@ -131,6 +136,28 @@ func New( ctrl.infraListerSynced = infraInformer.Informer().HasSynced ctrl.nodeListerSynced = nodeInformer.Informer().HasSynced + ctrl.featureGateAccess = featureGateAccess + + ctrl.featureEnabled = false + ctrl.featureGateAccess.SetChangeHandler(func(featureChange featuregates.FeatureChange) { + klog.InfoS("FeatureGates changed", "enabled", featureChange.New.Enabled, "disabled", featureChange.New.Disabled) + + var prevfeatureEnabled bool + if featureChange.Previous == nil { + // When the initial featuregate is set, the previous version is nil. Default to the feature being disabled. + prevfeatureEnabled = false + } else { + prevfeatureEnabled = featuregates.NewFeatureGate(featureChange.Previous.Enabled, featureChange.Previous.Disabled). + Enabled(osconfigv1.FeatureGateManagedBootImages) + } + ctrl.featureEnabled = featuregates.NewFeatureGate(featureChange.New.Enabled, featureChange.New.Disabled). + Enabled(osconfigv1.FeatureGateManagedBootImages) + if !prevfeatureEnabled && ctrl.featureEnabled { + klog.Info("Trigger a sync as this feature was turned on") + ctrl.enqueueAllMachineSets() + } + }) + return ctrl } @@ -193,6 +220,10 @@ func (ctrl *Controller) handleErr(err error, key interface{}) { } func (ctrl *Controller) addMachineSet(obj interface{}) { + // No-op if feature is disabled + if !ctrl.featureEnabled { + return + } machineSet := obj.(*machinev1beta1.MachineSet) klog.Infof("MachineSet %s added", machineSet.Name) @@ -209,6 +240,10 @@ func (ctrl *Controller) addMachineSet(obj interface{}) { // Perhaps worth implementing a diff check before starting the sync? func (ctrl *Controller) updateMachineSet(old, _ interface{}) { + // No-op if feature is disabled + if !ctrl.featureEnabled { + return + } oldMachineSet := old.(*machinev1beta1.MachineSet) klog.Infof("MachineSet %s updated, reconciling all machinesets", oldMachineSet.Name) @@ -222,6 +257,10 @@ func (ctrl *Controller) updateMachineSet(old, _ interface{}) { } func (ctrl *Controller) addConfigMap(obj interface{}) { + // No-op if feature is disabled + if !ctrl.featureEnabled { + return + } configMap := obj.(*corev1.ConfigMap) // Take no action if this isn't the "golden" config map @@ -242,6 +281,10 @@ func (ctrl *Controller) addConfigMap(obj interface{}) { // TODO: This callback happens every ~15 minutes or so even if the configmap contents is not updated // Perhaps worth implementing a diff check before starting the sync? func (ctrl *Controller) updateConfigMap(old, _ interface{}) { + // No-op if feature is disabled + if !ctrl.featureEnabled { + return + } oldConfigMap := old.(*corev1.ConfigMap) // Take no action if this isn't the "golden" config map