diff --git a/controllers/clusterversion_controller.go b/controllers/operatorconfigmap_controller.go similarity index 85% rename from controllers/clusterversion_controller.go rename to controllers/operatorconfigmap_controller.go index a66070662..0dafe0159 100644 --- a/controllers/clusterversion_controller.go +++ b/controllers/operatorconfigmap_controller.go @@ -25,12 +25,14 @@ import ( "github.com/red-hat-storage/ocs-client-operator/pkg/csi" "github.com/red-hat-storage/ocs-client-operator/pkg/templates" + csiaddonsv1alpha1 "github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1" "github.com/go-logr/logr" configv1 "github.com/openshift/api/config/v1" secv1 "github.com/openshift/api/security/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" k8serrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -57,8 +59,8 @@ const ( clusterVersionName = "version" ) -// ClusterVersionReconciler reconciles a ClusterVersion object -type ClusterVersionReconciler struct { +// OperatorConfigMapReconciler reconciles a ClusterVersion object +type OperatorConfigMapReconciler struct { client.Client OperatorDeployment *appsv1.Deployment OperatorNamespace string @@ -76,7 +78,7 @@ type ClusterVersionReconciler struct { } // SetupWithManager sets up the controller with the Manager. -func (c *ClusterVersionReconciler) SetupWithManager(mgr ctrl.Manager) error { +func (c *OperatorConfigMapReconciler) SetupWithManager(mgr ctrl.Manager) error { clusterVersionPredicates := builder.WithPredicates( predicate.GenerationChangedPredicate{}, ) @@ -91,19 +93,19 @@ func (c *ClusterVersionReconciler) SetupWithManager(mgr ctrl.Manager) error { ), ) // Reconcile the ClusterVersion object when the operator config map is updated - enqueueClusterVersionRequest := handler.EnqueueRequestsFromMapFunc( + enqueueConfigMapRequest := handler.EnqueueRequestsFromMapFunc( func(_ context.Context, client client.Object) []reconcile.Request { return []reconcile.Request{{ NamespacedName: types.NamespacedName{ - Name: clusterVersionName, + Name: operatorConfigMapName, }, }} }, ) return ctrl.NewControllerManagedBy(mgr). - For(&configv1.ClusterVersion{}, clusterVersionPredicates). - Watches(&corev1.ConfigMap{}, enqueueClusterVersionRequest, configMapPredicates). + For(&corev1.ConfigMap{}, configMapPredicates). + Watches(&configv1.ClusterVersion{}, enqueueConfigMapRequest, clusterVersionPredicates). Complete(c) } @@ -123,23 +125,30 @@ func (c *ClusterVersionReconciler) SetupWithManager(mgr ctrl.Manager) error { // For more details, check Reconcile and its Result here: // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { +func (c *OperatorConfigMapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { var err error c.ctx = ctx - c.log = log.FromContext(ctx, "ClusterVersion", req) - c.log.Info("Reconciling ClusterVersion") + c.log = log.FromContext(ctx, "OperatorConfigMap", req) + c.log.Info("Reconciling OperatorConfigMap") if err := c.ensureConsolePlugin(); err != nil { c.log.Error(err, "unable to deploy client console") return ctrl.Result{}, err } - instance := configv1.ClusterVersion{} + instance := corev1.ConfigMap{} if err = c.Client.Get(context.TODO(), req.NamespacedName, &instance); err != nil { return ctrl.Result{}, err } - if err := csi.InitializeSidecars(instance.Status.Desired.Version); err != nil { + clusterVersion := &configv1.ClusterVersion{} + err = c.Client.Get(c.ctx, types.NamespacedName{Name: clusterVersionName}, clusterVersion) + if err != nil { + c.log.Error(err, "failed to get the clusterVersion version of the OCP cluster") + return reconcile.Result{}, err + } + + if err := csi.InitializeSidecars(clusterVersion.Status.Desired.Version); err != nil { c.log.Error(err, "unable to initialize sidecars") return ctrl.Result{}, err } @@ -210,10 +219,10 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque }, } err = c.createOrUpdate(c.cephFSDeployment, func() error { + csi.GetCephFSDeployment(c.OperatorNamespace).DeepCopyInto(c.cephFSDeployment) if err := c.own(c.cephFSDeployment); err != nil { return err } - csi.GetCephFSDeployment(c.OperatorNamespace).DeepCopyInto(c.cephFSDeployment) return nil }) if err != nil { @@ -228,10 +237,10 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque }, } err = c.createOrUpdate(c.cephFSDaemonSet, func() error { + csi.GetCephFSDaemonSet(c.OperatorNamespace).DeepCopyInto(c.cephFSDaemonSet) if err := c.own(c.cephFSDaemonSet); err != nil { return err } - csi.GetCephFSDaemonSet(c.OperatorNamespace).DeepCopyInto(c.cephFSDaemonSet) return nil }) if err != nil { @@ -246,10 +255,10 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque }, } err = c.createOrUpdate(c.rbdDeployment, func() error { + csi.GetRBDDeployment(c.OperatorNamespace).DeepCopyInto(c.rbdDeployment) if err := c.own(c.rbdDeployment); err != nil { return err } - csi.GetRBDDeployment(c.OperatorNamespace).DeepCopyInto(c.rbdDeployment) return nil }) if err != nil { @@ -264,10 +273,10 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque }, } err = c.createOrUpdate(c.rbdDaemonSet, func() error { + csi.GetRBDDaemonSet(c.OperatorNamespace).DeepCopyInto(c.rbdDaemonSet) if err := c.own(c.rbdDaemonSet); err != nil { return err } - csi.GetRBDDaemonSet(c.OperatorNamespace).DeepCopyInto(c.rbdDaemonSet) return nil }) if err != nil { @@ -300,14 +309,10 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque return ctrl.Result{}, err } - operatorConfig, err := c.getOperatorConfig() - if err != nil { - return ctrl.Result{}, err - } prometheusRule.SetNamespace(c.OperatorNamespace) err = c.createOrUpdate(prometheusRule, func() error { - applyLabels(operatorConfig.Data["OCS_METRICS_LABELS"], &prometheusRule.ObjectMeta) + applyLabels(instance.Data["OCS_METRICS_LABELS"], &prometheusRule.ObjectMeta) return c.own(prometheusRule) }) if err != nil { @@ -317,10 +322,35 @@ func (c *ClusterVersionReconciler) Reconcile(ctx context.Context, req ctrl.Reque c.log.Info("prometheus rules deployed", "prometheusRule", klog.KRef(prometheusRule.Namespace, prometheusRule.Name)) + // deletion phase + if !instance.GetDeletionTimestamp().IsZero() { + err = c.deletionPhase(&instance, &req) + if err != nil { + return ctrl.Result{}, err + } + } return ctrl.Result{}, nil } -func (c *ClusterVersionReconciler) createOrUpdate(obj client.Object, f controllerutil.MutateFn) error { +func (c *OperatorConfigMapReconciler) deletionPhase(instance *corev1.ConfigMap, req *ctrl.Request) error { + csiAddonsNode := &csiaddonsv1alpha1.CSIAddonsNode{} + err := c.Client.Get(c.ctx, req.NamespacedName, csiAddonsNode) + if err != nil { + if apierrors.IsNotFound(err) { + // Request object not found, could have been deleted before reconcile request. + c.log.Info("CSIAddonsNode resource not found") + return nil + } + return err + } + csiAddonsNode.Finalizers = nil + if err := c.Client.Update(c.ctx, csiAddonsNode); err != nil { + c.log.Error(err, "Failed to remove finalizer from csiAddonsNode") + return err + } + return nil +} +func (c *OperatorConfigMapReconciler) createOrUpdate(obj client.Object, f controllerutil.MutateFn) error { result, err := controllerutil.CreateOrUpdate(c.ctx, c.Client, obj, f) if err != nil { return err @@ -329,11 +359,11 @@ func (c *ClusterVersionReconciler) createOrUpdate(obj client.Object, f controlle return nil } -func (c *ClusterVersionReconciler) own(obj client.Object) error { +func (c *OperatorConfigMapReconciler) own(obj client.Object) error { return controllerutil.SetControllerReference(c.OperatorDeployment, obj, c.Client.Scheme()) } -func (c *ClusterVersionReconciler) create(obj client.Object) error { +func (c *OperatorConfigMapReconciler) create(obj client.Object) error { return c.Client.Create(c.ctx, obj) } @@ -357,16 +387,7 @@ func applyLabels(label string, t *metav1.ObjectMeta) { t.Labels = promLabel } -func (c *ClusterVersionReconciler) getOperatorConfig() (*corev1.ConfigMap, error) { - cm := &corev1.ConfigMap{} - err := c.Client.Get(c.ctx, types.NamespacedName{Name: operatorConfigMapName, Namespace: c.OperatorNamespace}, cm) - if err != nil && !k8serrors.IsNotFound(err) { - return nil, err - } - return cm, nil -} - -func (c *ClusterVersionReconciler) ensureConsolePlugin() error { +func (c *OperatorConfigMapReconciler) ensureConsolePlugin() error { c.consoleDeployment = &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: console.DeploymentName, diff --git a/go.mod b/go.mod index b25cf160f..ce5e6f4fb 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ replace ( exclude github.com/kubernetes-incubator/external-storage v0.20.4-openstorage-rc2 require ( + github.com/csi-addons/kubernetes-csi-addons v0.8.0 github.com/go-logr/logr v1.3.0 github.com/kubernetes-csi/external-snapshotter/client/v6 v6.3.0 github.com/onsi/ginkgo v1.16.5 @@ -76,7 +77,7 @@ require ( golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index 8c048d6e4..3f459f647 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,8 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/csi-addons/kubernetes-csi-addons v0.8.0 h1:zvYGp4DM6KdQzEX3dQSYKykqJdLZlxpVBJjtpbaqFjs= +github.com/csi-addons/kubernetes-csi-addons v0.8.0/go.mod h1:dvinzoiXlqdOGDpKkYx8Jxl507BzVEEEO+SI0OmBaRI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -216,8 +218,8 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/main.go b/main.go index a00c5aa31..9021b5cbc 100644 --- a/main.go +++ b/main.go @@ -152,14 +152,14 @@ func main() { os.Exit(1) } - if err = (&controllers.ClusterVersionReconciler{ + if err = (&controllers.OperatorConfigMapReconciler{ Client: mgr.GetClient(), Scheme: mgr.GetScheme(), OperatorDeployment: operatorDeployment, OperatorNamespace: utils.GetOperatorNamespace(), ConsolePort: int32(consolePort), }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "ClusterVersionReconciler") + setupLog.Error(err, "unable to create controller", "controller", "OperatorConfigMapReconciler") os.Exit(1) } diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/LICENSE b/vendor/github.com/csi-addons/kubernetes-csi-addons/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/LICENSE @@ -0,0 +1,202 @@ + + 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/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/csiaddonsnode_types.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/csiaddonsnode_types.go new file mode 100644 index 000000000..9db238ca9 --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/csiaddonsnode_types.go @@ -0,0 +1,109 @@ +/* +Copyright 2021 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CSIAddonsNodeState defines the state of the operation. +type CSIAddonsNodeState string + +const ( + // Connected represents the Connected state. + CSIAddonsNodeStateConnected CSIAddonsNodeState = "Connected" + + // Failed represents the Connection Failed state. + CSIAddonsNodeStateFailed CSIAddonsNodeState = "Failed" +) + +type CSIAddonsNodeDriver struct { + // Name is the name of the CSI driver that this object refers to. + // This must be the same name returned by the CSI-Addons GetIdentity() + // call for that driver. The name of the driver is in the format: + // `example.csi.ceph.com` + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable" + Name string `json:"name"` + + // EndPoint is url that contains the ip-address to which the CSI-Addons + // side-car listens to. + EndPoint string `json:"endpoint"` + + // NodeID is the ID of the node to identify on which node the side-car + // is running. + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="nodeID is immutable" + NodeID string `json:"nodeID"` +} + +// CSIAddonsNodeSpec defines the desired state of CSIAddonsNode +type CSIAddonsNodeSpec struct { + // Driver is the information of the CSI Driver existing on a node. + // If the driver is uninstalled, this can become empty. + Driver CSIAddonsNodeDriver `json:"driver"` +} + +// CSIAddonsNodeStatus defines the observed state of CSIAddonsNode +type CSIAddonsNodeStatus struct { + // State represents the state of the CSIAddonsNode object. + // It informs whether or not the CSIAddonsNode is Connected + // to the CSI Driver. + State CSIAddonsNodeState `json:"state,omitempty"` + + // Message is a human-readable message indicating details about why the CSIAddonsNode + // is in this state. + // +optional + Message string `json:"message,omitempty"` + + // Reason is a brief CamelCase string that describes any failure and is meant + // for machine parsing and tidy display in the CLI. + // +optional + Reason string `json:"reason,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:printcolumn:JSONPath=".metadata.namespace",name=namespace,type=string +//+kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date +//+kubebuilder:printcolumn:JSONPath=".spec.driver.name",name=DriverName,type=string +//+kubebuilder:printcolumn:JSONPath=".spec.driver.endpoint",name=Endpoint,type=string +//+kubebuilder:printcolumn:JSONPath=".spec.driver.nodeID",name=NodeID,type=string + +// CSIAddonsNode is the Schema for the csiaddonsnode API +type CSIAddonsNode struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + Spec CSIAddonsNodeSpec `json:"spec"` + + Status CSIAddonsNodeStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// CSIAddonsNodeList contains a list of CSIAddonsNode +type CSIAddonsNodeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CSIAddonsNode `json:"items"` +} + +func init() { + SchemeBuilder.Register(&CSIAddonsNode{}, &CSIAddonsNodeList{}) +} diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/groupversion_info.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/groupversion_info.go new file mode 100644 index 000000000..9bb88b2e8 --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the csiaddons v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=csiaddons.openshift.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "csiaddons.openshift.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/networkfence_types.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/networkfence_types.go new file mode 100644 index 000000000..71b891c3c --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/networkfence_types.go @@ -0,0 +1,137 @@ +/* +Copyright 2021 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type FenceState string + +const ( + // Fenced means the CIDRs should be in fenced state + Fenced FenceState = "Fenced" + + // Unfenced means the CIDRs should be in unfenced state + Unfenced FenceState = "Unfenced" +) + +type FencingOperationResult string + +const ( + // FencingOperationResultSucceeded represents the Succeeded operation state. + FencingOperationResultSucceeded FencingOperationResult = "Succeeded" + + // FencingOperationResultFailed represents the Failed operation state. + FencingOperationResultFailed FencingOperationResult = "Failed" +) + +const ( + // FenceOperationSuccessfulMessage represents successful message on fence operation + FenceOperationSuccessfulMessage = "fencing operation successful" + + // UnFenceOperationSuccessfulMessage represents successful message on unfence operation + UnFenceOperationSuccessfulMessage = "unfencing operation successful" +) + +// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="secret is immutable" +// SecretSpec defines the secrets to be used for the network fencing operation. +type SecretSpec struct { + // Name specifies the name of the secret. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="name is immutable" + Name string `json:"name,omitempty"` + + // Namespace specifies the namespace in which the secret + // is located. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="namespace is immutable" + Namespace string `json:"namespace,omitempty"` +} + +// NetworkFenceSpec defines the desired state of NetworkFence +// +kubebuilder:validation:XValidation:rule="has(self.parameters) == has(oldSelf.parameters)",message="parameters are immutable" +// +kubebuilder:validation:XValidation:rule="has(self.secret) == has(oldSelf.secret)",message="secret is immutable" +type NetworkFenceSpec struct { + // Driver contains the name of CSI driver. + // +kubebuilder:validation:Required + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="driver is immutable" + Driver string `json:"driver"` + + // FenceState contains the desired state for the CIDRs + // mentioned in the Spec. i.e. Fenced or Unfenced + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=Fenced;Unfenced + // +kubebuilder:default:=Fenced + FenceState FenceState `json:"fenceState"` + + // Cidrs contains a list of CIDR blocks, which are required to be fenced. + // +kubebuilder:validation:Required + Cidrs []string `json:"cidrs"` + + // Secret is a kubernetes secret, which is required to perform the fence/unfence operation. + Secret SecretSpec `json:"secret,omitempty"` + + // Parameters is used to pass additional parameters to the CSI driver. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="parameters are immutable" + Parameters map[string]string `json:"parameters,omitempty"` +} + +// NetworkFenceStatus defines the observed state of NetworkFence +type NetworkFenceStatus struct { + // Result indicates the result of Network Fence/Unfence operation. + Result FencingOperationResult `json:"result,omitempty"` + + // Message contains any message from the NetworkFence operation. + Message string `json:"message,omitempty"` + + // Conditions are the list of conditions and their status. + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:printcolumn:name="Driver",type="string",JSONPath=".spec.driver" +//+kubebuilder:printcolumn:name="Cidrs",type="string",JSONPath=".spec.cidrs" +//+kubebuilder:printcolumn:name="FenceState",type="string",JSONPath=".spec.fenceState" +//+kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date +//+kubebuilder:printcolumn:JSONPath=".status.result",name=Result,type=string +//+kubebuilder:resource:path=networkfences,scope=Cluster,singular=networkfence + +// NetworkFence is the Schema for the networkfences API +type NetworkFence struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + Spec NetworkFenceSpec `json:"spec"` + + Status NetworkFenceStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// NetworkFenceList contains a list of NetworkFence +type NetworkFenceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NetworkFence `json:"items"` +} + +func init() { + SchemeBuilder.Register(&NetworkFence{}, &NetworkFenceList{}) +} diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacecronjob_types.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacecronjob_types.go new file mode 100644 index 000000000..cfbf2631b --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacecronjob_types.go @@ -0,0 +1,143 @@ +/* +Copyright 2022 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ReclaimSpaceJobTemplateSpec describes the data a Job should have when created from a template +type ReclaimSpaceJobTemplateSpec struct { + // Standard object's metadata of the jobs created from this template. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Specification of the desired behavior of the job. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +kubebuilder:validation:Required + Spec ReclaimSpaceJobSpec `json:"spec,omitempty"` +} + +// ReclaimSpaceCronJobSpec defines the desired state of ReclaimSpaceJob +type ReclaimSpaceCronJobSpec struct { + // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. + // +kubebuilder:validation:Required + // +kubebuilder:validation:Pattern:=.+ + Schedule string `json:"schedule"` + + // Optional deadline in seconds for starting the job if it misses scheduled + // time for any reason. Missed jobs executions will be counted as failed ones. + // +kubebuilder:validation:Optional + StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"` + + // Specifies how to treat concurrent executions of a Job. + // Valid values are: + // - "Forbid" (default): forbids concurrent runs, skipping next run if + // previous run hasn't finished yet; + // - "Replace": cancels currently running job and replaces it + // with a new one + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Enum=Forbid;Replace + // +kubebuilder:default:=Forbid + ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"` + + // This flag tells the controller to suspend subsequent executions, it does + // not apply to already started executions. Defaults to false. + // +kubebuilder:validation:Optional + Suspend *bool `json:"suspend,omitempty"` + + // Specifies the job that will be created when executing a CronJob. + // +kubebuilder:validation:Required + JobSpec ReclaimSpaceJobTemplateSpec `json:"jobTemplate"` + + // The number of successful finished jobs to retain. Value must be non-negative integer. + // Defaults to 3. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Maximum=60 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default:=3 + SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"` + + // The number of failed finished jobs to retain. Value must be non-negative integer. + // Defaults to 1. + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Maximum=60 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default:=1 + FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"` +} + +// ConcurrencyPolicy describes how the job will be handled. +// Only one of the following concurrent policies may be specified. +// If none of the following policies is specified, the default one +// is ReplaceConcurrent. +type ConcurrencyPolicy string + +const ( + // ForbidConcurrent forbids concurrent runs, skipping next run if previous + // hasn't finished yet. + ForbidConcurrent ConcurrencyPolicy = "Forbid" + + // ReplaceConcurrent cancels currently running job and replaces it with a new one. + ReplaceConcurrent ConcurrencyPolicy = "Replace" +) + +// ReclaimSpaceCronJobStatus defines the observed state of ReclaimSpaceJob +type ReclaimSpaceCronJobStatus struct { + // A pointer to currently running job. + Active *v1.ObjectReference `json:"active,omitempty"` + + // Information when was the last time the job was successfully scheduled. + LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"` + + // Information when was the last time the job successfully completed. + LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:printcolumn:JSONPath=".spec.schedule",name=Schedule,type=string +//+kubebuilder:printcolumn:JSONPath=".spec.suspend",name=Suspend,type=boolean +//+kubebuilder:printcolumn:JSONPath=".status.active.name",name=Active,type=string +//+kubebuilder:printcolumn:JSONPath=".status.lastScheduleTime",name=Lastschedule,type=date +//+kubebuilder:printcolumn:JSONPath=".status.lastSuccessfulTime",name=Lastsuccessfultime,type=date,priority=1 +//+kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date + +// ReclaimSpaceCronJob is the Schema for the reclaimspacecronjobs API +type ReclaimSpaceCronJob struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + Spec ReclaimSpaceCronJobSpec `json:"spec"` + + Status ReclaimSpaceCronJobStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// ReclaimSpaceCronJobList contains a list of ReclaimSpaceCronJob +type ReclaimSpaceCronJobList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ReclaimSpaceCronJob `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ReclaimSpaceCronJob{}, &ReclaimSpaceCronJobList{}) +} diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacejob_types.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacejob_types.go new file mode 100644 index 000000000..333239b8e --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/reclaimspacejob_types.go @@ -0,0 +1,127 @@ +/* +Copyright 2021 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OperationResult represents the result of reclaim space operation. +type OperationResult string + +const ( + // OperationResultSucceeded represents the Succeeded operation state. + OperationResultSucceeded OperationResult = "Succeeded" + + // OperationResultFailed represents the Failed operation state. + OperationResultFailed OperationResult = "Failed" +) + +// TargetSpec defines the targets on which the operation can be +// performed. +type TargetSpec struct { + // PersistentVolumeClaim specifies the target PersistentVolumeClaim name. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="persistentVolumeClaim is immutable" + PersistentVolumeClaim string `json:"persistentVolumeClaim,omitempty"` +} + +// ReclaimSpaceJobSpec defines the desired state of ReclaimSpaceJob +type ReclaimSpaceJobSpec struct { + // Target represents volume target on which the operation will be + // performed. + // +kubebuilder:validation:Required + Target TargetSpec `json:"target"` + + // BackOffLimit specifies the number of retries allowed before marking reclaim + // space operation as failed. If not specified, defaults to 6. Maximum allowed + // value is 60 and minimum allowed value is 0. + // +optional + // +kubebuilder:validation:Maximum=60 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default:=6 + BackoffLimit int32 `json:"backOffLimit"` + + // RetryDeadlineSeconds specifies the duration in seconds relative to the + // start time that the operation may be retried; value MUST be positive integer. + // If not specified, defaults to 600 seconds. Maximum allowed + // value is 1800. + // +optional + // +kubebuilder:validation:Maximum=1800 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:default:=600 + RetryDeadlineSeconds int64 `json:"retryDeadlineSeconds"` + + // Timeout specifies the timeout in seconds for the grpc request sent to the + // CSI driver. If not specified, defaults to global reclaimspace timeout. + // Minimum allowed value is 60. + // +optional + // +kubebuilder:validation:Minimum=60 + Timeout *int64 `json:"timeout,omitempty"` +} + +// ReclaimSpaceJobStatus defines the observed state of ReclaimSpaceJob +type ReclaimSpaceJobStatus struct { + // Result indicates the result of ReclaimSpaceJob. + Result OperationResult `json:"result,omitempty"` + + // Message contains any message from the ReclaimSpaceJob. + Message string `json:"message,omitempty"` + + // ReclaimedSpace indicates the amount of space reclaimed. + ReclaimedSpace *resource.Quantity `json:"reclaimedSpace,omitempty"` + + // Conditions are the list of conditions and their status. + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // Retries indicates the number of times the operation is retried. + Retries int32 `json:"retries,omitempty"` + StartTime *metav1.Time `json:"startTime,omitempty"` + CompletionTime *metav1.Time `json:"completionTime,omitempty"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+kubebuilder:printcolumn:JSONPath=".metadata.namespace",name=Namespace,type=string +//+kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date +//+kubebuilder:printcolumn:JSONPath=".status.retries",name=Retries,type=integer +//+kubebuilder:printcolumn:JSONPath=".status.result",name=Result,type=string +//+kubebuilder:printcolumn:JSONPath=".status.reclaimedSpace",name=ReclaimedSpace,type=string,priority=1 + +// ReclaimSpaceJob is the Schema for the reclaimspacejobs API +type ReclaimSpaceJob struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // +kubebuilder:validation:Required + Spec ReclaimSpaceJobSpec `json:"spec"` + + Status ReclaimSpaceJobStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// ReclaimSpaceJobList contains a list of ReclaimSpaceJob +type ReclaimSpaceJobList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ReclaimSpaceJob `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ReclaimSpaceJob{}, &ReclaimSpaceJobList{}) +} diff --git a/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..86e250fda --- /dev/null +++ b/vendor/github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,527 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 The Kubernetes-CSI-Addons Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSIAddonsNode) DeepCopyInto(out *CSIAddonsNode) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIAddonsNode. +func (in *CSIAddonsNode) DeepCopy() *CSIAddonsNode { + if in == nil { + return nil + } + out := new(CSIAddonsNode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CSIAddonsNode) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSIAddonsNodeDriver) DeepCopyInto(out *CSIAddonsNodeDriver) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIAddonsNodeDriver. +func (in *CSIAddonsNodeDriver) DeepCopy() *CSIAddonsNodeDriver { + if in == nil { + return nil + } + out := new(CSIAddonsNodeDriver) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSIAddonsNodeList) DeepCopyInto(out *CSIAddonsNodeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CSIAddonsNode, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIAddonsNodeList. +func (in *CSIAddonsNodeList) DeepCopy() *CSIAddonsNodeList { + if in == nil { + return nil + } + out := new(CSIAddonsNodeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CSIAddonsNodeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSIAddonsNodeSpec) DeepCopyInto(out *CSIAddonsNodeSpec) { + *out = *in + out.Driver = in.Driver +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIAddonsNodeSpec. +func (in *CSIAddonsNodeSpec) DeepCopy() *CSIAddonsNodeSpec { + if in == nil { + return nil + } + out := new(CSIAddonsNodeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CSIAddonsNodeStatus) DeepCopyInto(out *CSIAddonsNodeStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CSIAddonsNodeStatus. +func (in *CSIAddonsNodeStatus) DeepCopy() *CSIAddonsNodeStatus { + if in == nil { + return nil + } + out := new(CSIAddonsNodeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFence) DeepCopyInto(out *NetworkFence) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFence. +func (in *NetworkFence) DeepCopy() *NetworkFence { + if in == nil { + return nil + } + out := new(NetworkFence) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkFence) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFenceList) DeepCopyInto(out *NetworkFenceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkFence, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFenceList. +func (in *NetworkFenceList) DeepCopy() *NetworkFenceList { + if in == nil { + return nil + } + out := new(NetworkFenceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkFenceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFenceSpec) DeepCopyInto(out *NetworkFenceSpec) { + *out = *in + if in.Cidrs != nil { + in, out := &in.Cidrs, &out.Cidrs + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Secret = in.Secret + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFenceSpec. +func (in *NetworkFenceSpec) DeepCopy() *NetworkFenceSpec { + if in == nil { + return nil + } + out := new(NetworkFenceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFenceStatus) DeepCopyInto(out *NetworkFenceStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFenceStatus. +func (in *NetworkFenceStatus) DeepCopy() *NetworkFenceStatus { + if in == nil { + return nil + } + out := new(NetworkFenceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceCronJob) DeepCopyInto(out *ReclaimSpaceCronJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceCronJob. +func (in *ReclaimSpaceCronJob) DeepCopy() *ReclaimSpaceCronJob { + if in == nil { + return nil + } + out := new(ReclaimSpaceCronJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReclaimSpaceCronJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceCronJobList) DeepCopyInto(out *ReclaimSpaceCronJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ReclaimSpaceCronJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceCronJobList. +func (in *ReclaimSpaceCronJobList) DeepCopy() *ReclaimSpaceCronJobList { + if in == nil { + return nil + } + out := new(ReclaimSpaceCronJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReclaimSpaceCronJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceCronJobSpec) DeepCopyInto(out *ReclaimSpaceCronJobSpec) { + *out = *in + if in.StartingDeadlineSeconds != nil { + in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.Suspend != nil { + in, out := &in.Suspend, &out.Suspend + *out = new(bool) + **out = **in + } + in.JobSpec.DeepCopyInto(&out.JobSpec) + if in.SuccessfulJobsHistoryLimit != nil { + in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit + *out = new(int32) + **out = **in + } + if in.FailedJobsHistoryLimit != nil { + in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceCronJobSpec. +func (in *ReclaimSpaceCronJobSpec) DeepCopy() *ReclaimSpaceCronJobSpec { + if in == nil { + return nil + } + out := new(ReclaimSpaceCronJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceCronJobStatus) DeepCopyInto(out *ReclaimSpaceCronJobStatus) { + *out = *in + if in.Active != nil { + in, out := &in.Active, &out.Active + *out = new(corev1.ObjectReference) + **out = **in + } + if in.LastScheduleTime != nil { + in, out := &in.LastScheduleTime, &out.LastScheduleTime + *out = (*in).DeepCopy() + } + if in.LastSuccessfulTime != nil { + in, out := &in.LastSuccessfulTime, &out.LastSuccessfulTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceCronJobStatus. +func (in *ReclaimSpaceCronJobStatus) DeepCopy() *ReclaimSpaceCronJobStatus { + if in == nil { + return nil + } + out := new(ReclaimSpaceCronJobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceJob) DeepCopyInto(out *ReclaimSpaceJob) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceJob. +func (in *ReclaimSpaceJob) DeepCopy() *ReclaimSpaceJob { + if in == nil { + return nil + } + out := new(ReclaimSpaceJob) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReclaimSpaceJob) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceJobList) DeepCopyInto(out *ReclaimSpaceJobList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ReclaimSpaceJob, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceJobList. +func (in *ReclaimSpaceJobList) DeepCopy() *ReclaimSpaceJobList { + if in == nil { + return nil + } + out := new(ReclaimSpaceJobList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReclaimSpaceJobList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceJobSpec) DeepCopyInto(out *ReclaimSpaceJobSpec) { + *out = *in + out.Target = in.Target + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceJobSpec. +func (in *ReclaimSpaceJobSpec) DeepCopy() *ReclaimSpaceJobSpec { + if in == nil { + return nil + } + out := new(ReclaimSpaceJobSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceJobStatus) DeepCopyInto(out *ReclaimSpaceJobStatus) { + *out = *in + if in.ReclaimedSpace != nil { + in, out := &in.ReclaimedSpace, &out.ReclaimedSpace + x := (*in).DeepCopy() + *out = &x + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = (*in).DeepCopy() + } + if in.CompletionTime != nil { + in, out := &in.CompletionTime, &out.CompletionTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceJobStatus. +func (in *ReclaimSpaceJobStatus) DeepCopy() *ReclaimSpaceJobStatus { + if in == nil { + return nil + } + out := new(ReclaimSpaceJobStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReclaimSpaceJobTemplateSpec) DeepCopyInto(out *ReclaimSpaceJobTemplateSpec) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReclaimSpaceJobTemplateSpec. +func (in *ReclaimSpaceJobTemplateSpec) DeepCopy() *ReclaimSpaceJobTemplateSpec { + if in == nil { + return nil + } + out := new(ReclaimSpaceJobTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecretSpec) DeepCopyInto(out *SecretSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretSpec. +func (in *SecretSpec) DeepCopy() *SecretSpec { + if in == nil { + return nil + } + out := new(SecretSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetSpec) DeepCopyInto(out *TargetSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetSpec. +func (in *TargetSpec) DeepCopy() *TargetSpec { + if in == nil { + return nil + } + out := new(TargetSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b9427c4a1..fd656b162 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,6 +7,9 @@ github.com/blang/semver/v4 # github.com/cespare/xxhash/v2 v2.2.0 ## explicit; go 1.11 github.com/cespare/xxhash/v2 +# github.com/csi-addons/kubernetes-csi-addons v0.8.0 +## explicit; go 1.20 +github.com/csi-addons/kubernetes-csi-addons/apis/csiaddons/v1alpha1 # github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc ## explicit github.com/davecgh/go-spew/spew @@ -273,7 +276,7 @@ google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.60.0