From 958834f0c83edad28a3c3cb918499bb63e58f0ca Mon Sep 17 00:00:00 2001 From: Talor Itzhak Date: Mon, 28 Mar 2022 13:04:21 +0300 Subject: [PATCH] api:vendor: move deployer to use v1beta2's scheduler-plugins scheme For the go-client and controller runtime to be able to work with the newer version of KubeSchedulerConfig type, we must use add the correct version to the scheme. Signed-off-by: Talor Itzhak --- go.mod | 1 + go.sum | 1 + pkg/manifests/manifests.go | 14 +- vendor/k8s.io/apiserver/LICENSE | 202 ++++ vendor/k8s.io/apiserver/pkg/features/OWNERS | 4 + .../apiserver/pkg/features/kube_features.go | 201 ++++ .../pkg/util/feature/feature_gate.go | 33 + .../featuregate/feature_gate.go | 375 +++++++ .../config/{v1beta1 => v1beta2}/doc.go | 4 +- .../config/{v1beta1 => v1beta2}/register.go | 13 +- .../config/{v1beta1 => v1beta2}/types.go | 28 +- .../{v1beta1 => v1beta2}/types_pluginargs.go | 90 +- .../zz_generated.deepcopy.go | 243 +---- vendor/k8s.io/kubernetes/pkg/features/OWNERS | 4 + .../kubernetes/pkg/features/kube_features.go | 934 ++++++++++++++++++ .../apis/config/v1beta2/conversion.go | 107 ++ .../apis/config/v1beta2/default_plugins.go | 193 ++++ .../scheduler/apis/config/v1beta2/defaults.go | 304 ++++++ .../pkg/scheduler/apis/config/v1beta2/doc.go | 24 + .../scheduler/apis/config/v1beta2/register.go | 42 + .../config/v1beta2/zz_generated.conversion.go | 868 ++++++++++++++++ .../config/v1beta2/zz_generated.deepcopy.go | 21 + .../config/v1beta2/zz_generated.defaults.go | 72 ++ .../framework/plugins/names/names.go | 48 + vendor/modules.txt | 11 +- .../pkg/apis/config/v1beta2/defaults.go | 152 +++ .../pkg/apis/config/v1beta2/doc.go | 23 + .../pkg/apis/config/v1beta2/register.go | 57 ++ .../pkg/apis/config/v1beta2/types.go | 151 +++ .../config/v1beta2/zz_generated.conversion.go | 369 +++++++ .../config/v1beta2/zz_generated.deepcopy.go | 294 ++++++ .../config/v1beta2/zz_generated.defaults.go | 73 ++ 32 files changed, 4606 insertions(+), 350 deletions(-) create mode 100644 vendor/k8s.io/apiserver/LICENSE create mode 100644 vendor/k8s.io/apiserver/pkg/features/OWNERS create mode 100644 vendor/k8s.io/apiserver/pkg/features/kube_features.go create mode 100644 vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go create mode 100644 vendor/k8s.io/component-base/featuregate/feature_gate.go rename vendor/k8s.io/kube-scheduler/config/{v1beta1 => v1beta2}/doc.go (85%) rename vendor/k8s.io/kube-scheduler/config/{v1beta1 => v1beta2}/register.go (87%) rename vendor/k8s.io/kube-scheduler/config/{v1beta1 => v1beta2}/types.go (95%) rename vendor/k8s.io/kube-scheduler/config/{v1beta1 => v1beta2}/types_pluginargs.go (71%) rename vendor/k8s.io/kube-scheduler/config/{v1beta1 => v1beta2}/zz_generated.deepcopy.go (70%) create mode 100644 vendor/k8s.io/kubernetes/pkg/features/OWNERS create mode 100644 vendor/k8s.io/kubernetes/pkg/features/kube_features.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/conversion.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/default_plugins.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/defaults.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/doc.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/register.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.conversion.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.deepcopy.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.defaults.go create mode 100644 vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/names/names.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/defaults.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/doc.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/register.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/types.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.conversion.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.defaults.go diff --git a/go.mod b/go.mod index d7a6267c..56019803 100644 --- a/go.mod +++ b/go.mod @@ -60,6 +60,7 @@ require ( gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/apiserver v0.22.6 // indirect k8s.io/component-base v0.22.6 // indirect k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c // indirect k8s.io/kubernetes v1.22.6 // indirect diff --git a/go.sum b/go.sum index ccdf14b5..2e328cec 100644 --- a/go.sum +++ b/go.sum @@ -1860,6 +1860,7 @@ k8s.io/apiextensions-apiserver v0.22.3 h1:bKku7MqawIbtTZc084BZoMV4fz0WZuvCnB5E+y k8s.io/apiextensions-apiserver v0.22.3/go.mod h1:f4plF+CXeqI89jAXL0Ml4LI/kSAZ54JS94+XOX1sae8= k8s.io/apimachinery v0.22.3 h1:mrvBG5CZnEfwgpVqWcrRKvdsYECTrhAR6cApAgdsflk= k8s.io/apimachinery v0.22.3/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apiserver v0.22.3 h1:x21xyLQ2qvPr5vjOTVOBaSJu8svnU2wfLOfSjNJEOdw= k8s.io/apiserver v0.22.3/go.mod h1:oam7lH/F1Kto/WTamyQYrD68fS0mGUBORAFf6x/9Mxs= k8s.io/cli-runtime v0.22.3/go.mod h1:um6JvCxV9Hrhq0zCUxcqYoY7/wF64g6IYgOViI8sg6Q= k8s.io/client-go v0.22.3 h1:6onkOSc+YNdwq5zXE0wFXicq64rrym+mXwHu/CPVGO4= diff --git a/pkg/manifests/manifests.go b/pkg/manifests/manifests.go index 72473395..2b27b877 100644 --- a/pkg/manifests/manifests.go +++ b/pkg/manifests/manifests.go @@ -34,9 +34,9 @@ import ( apiextensionv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" - kubeschedulerconfigv1beta1 "k8s.io/kube-scheduler/config/v1beta1" + kubeschedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2" "k8s.io/utils/pointer" - apiconfig "sigs.k8s.io/scheduler-plugins/pkg/apis/config" + apiconfigv1beta2 "sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2" rteassets "github.com/k8stopologyawareschedwg/deployer/pkg/assets/rte" "github.com/k8stopologyawareschedwg/deployer/pkg/deployer/platform" @@ -87,8 +87,8 @@ var src embed.FS func init() { apiextensionv1.AddToScheme(scheme.Scheme) - apiconfig.AddToScheme(scheme.Scheme) - kubeschedulerconfigv1beta1.AddToScheme(scheme.Scheme) + apiconfigv1beta2.AddToScheme(scheme.Scheme) + kubeschedulerconfigv1beta2.AddToScheme(scheme.Scheme) machineconfigv1.Install(scheme.Scheme) securityv1.Install(scheme.Scheme) } @@ -575,20 +575,20 @@ func SecurityContextConstraint(component string) (*securityv1.SecurityContextCon return scc, nil } -func KubeSchedulerConfigurationFromData(data []byte) (*kubeschedulerconfigv1beta1.KubeSchedulerConfiguration, error) { +func KubeSchedulerConfigurationFromData(data []byte) (*kubeschedulerconfigv1beta2.KubeSchedulerConfiguration, error) { obj, err := deserializeObjectFromData(data) if err != nil { return nil, err } - sc, ok := obj.(*kubeschedulerconfigv1beta1.KubeSchedulerConfiguration) + sc, ok := obj.(*kubeschedulerconfigv1beta2.KubeSchedulerConfiguration) if !ok { return nil, fmt.Errorf("unexpected type, got %T %v", obj, obj.GetObjectKind()) } return sc, nil } -func KubeSchedulerConfigurationToData(sc *kubeschedulerconfigv1beta1.KubeSchedulerConfiguration) ([]byte, error) { +func KubeSchedulerConfigurationToData(sc *kubeschedulerconfigv1beta2.KubeSchedulerConfiguration) ([]byte, error) { var buf bytes.Buffer err := SerializeObject(sc, &buf) return buf.Bytes(), err diff --git a/vendor/k8s.io/apiserver/LICENSE b/vendor/k8s.io/apiserver/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/vendor/k8s.io/apiserver/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/k8s.io/apiserver/pkg/features/OWNERS b/vendor/k8s.io/apiserver/pkg/features/OWNERS new file mode 100644 index 00000000..05b08249 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/features/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- feature-approvers diff --git a/vendor/k8s.io/apiserver/pkg/features/kube_features.go b/vendor/k8s.io/apiserver/pkg/features/kube_features.go new file mode 100644 index 00000000..645e67e7 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/features/kube_features.go @@ -0,0 +1,201 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package features + +import ( + "k8s.io/apimachinery/pkg/util/runtime" + + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/component-base/featuregate" +) + +const ( + // Every feature gate should add method here following this template: + // + // // owner: @username + // // alpha: v1.4 + // MyFeature() bool + + // owner: @tallclair + // alpha: v1.5 + // beta: v1.6 + // deprecated: v1.18 + // + // StreamingProxyRedirects controls whether the apiserver should intercept (and follow) + // redirects from the backend (Kubelet) for streaming requests (exec/attach/port-forward). + // + // This feature is deprecated, and will be removed in v1.24. + StreamingProxyRedirects featuregate.Feature = "StreamingProxyRedirects" + + // owner: @tallclair + // alpha: v1.12 + // beta: v1.14 + // deprecated: v1.22 + // + // ValidateProxyRedirects controls whether the apiserver should validate that redirects are only + // followed to the same host. Only used if StreamingProxyRedirects is enabled. + ValidateProxyRedirects featuregate.Feature = "ValidateProxyRedirects" + + // owner: @tallclair + // alpha: v1.7 + // beta: v1.8 + // GA: v1.12 + // + // AdvancedAuditing enables a much more general API auditing pipeline, which includes support for + // pluggable output backends and an audit policy specifying how different requests should be + // audited. + AdvancedAuditing featuregate.Feature = "AdvancedAuditing" + + // owner: @ilackams + // alpha: v1.7 + // beta: v1.16 + // + // Enables compression of REST responses (GET and LIST only) + APIResponseCompression featuregate.Feature = "APIResponseCompression" + + // owner: @smarterclayton + // alpha: v1.8 + // beta: v1.9 + // + // Allow API clients to retrieve resource lists in chunks rather than + // all at once. + APIListChunking featuregate.Feature = "APIListChunking" + + // owner: @apelisse + // alpha: v1.12 + // beta: v1.13 + // stable: v1.18 + // + // Allow requests to be processed but not stored, so that + // validation, merging, mutation can be tested without + // committing. + DryRun featuregate.Feature = "DryRun" + + // owner: @caesarxuchao + // alpha: v1.15 + // beta: v1.16 + // + // Allow apiservers to show a count of remaining items in the response + // to a chunking list request. + RemainingItemCount featuregate.Feature = "RemainingItemCount" + + // owner: @apelisse, @lavalamp + // alpha: v1.14 + // beta: v1.16 + // stable: v1.22 + // + // Server-side apply. Merging happens on the server. + ServerSideApply featuregate.Feature = "ServerSideApply" + + // owner: @caesarxuchao + // alpha: v1.14 + // beta: v1.15 + // + // Allow apiservers to expose the storage version hash in the discovery + // document. + StorageVersionHash featuregate.Feature = "StorageVersionHash" + + // owner: @caesarxuchao @roycaihw + // alpha: v1.20 + // + // Enable the storage version API. + StorageVersionAPI featuregate.Feature = "StorageVersionAPI" + + // owner: @wojtek-t + // alpha: v1.15 + // beta: v1.16 + // GA: v1.17 + // + // Enables support for watch bookmark events. + WatchBookmark featuregate.Feature = "WatchBookmark" + + // owner: @MikeSpreitzer @yue9944882 + // alpha: v1.15 + // + // + // Enables managing request concurrency with prioritization and fairness at each server + APIPriorityAndFairness featuregate.Feature = "APIPriorityAndFairness" + + // owner: @wojtek-t + // alpha: v1.16 + // beta: v1.20 + // + // Deprecates and removes SelfLink from ObjectMeta and ListMeta. + RemoveSelfLink featuregate.Feature = "RemoveSelfLink" + + // owner: @shaloulcy, @wojtek-t + // alpha: v1.18 + // beta: v1.19 + // GA: v1.20 + // + // Allows label and field based indexes in apiserver watch cache to accelerate list operations. + SelectorIndex featuregate.Feature = "SelectorIndex" + + // owner: @liggitt + // beta: v1.19 + // GA: v1.22 + // + // Allows sending warning headers in API responses. + WarningHeaders featuregate.Feature = "WarningHeaders" + + // owner: @wojtek-t + // alpha: v1.20 + // beta: v1.21 + // + // Allows for updating watchcache resource version with progress notify events. + EfficientWatchResumption featuregate.Feature = "EfficientWatchResumption" + + // owner: @roycaihw + // alpha: v1.20 + // + // Assigns each kube-apiserver an ID in a cluster. + APIServerIdentity featuregate.Feature = "APIServerIdentity" + + // owner: @dashpole + // alpha: v1.22 + // + // Add support for distributed tracing in the API Server + APIServerTracing featuregate.Feature = "APIServerTracing" +) + +func init() { + runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates)) +} + +// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. +// To add a new feature, define a key for it above and add it here. The features will be +// available throughout Kubernetes binaries. +var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ + StreamingProxyRedirects: {Default: false, PreRelease: featuregate.Deprecated}, + ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, + AdvancedAuditing: {Default: true, PreRelease: featuregate.GA}, + APIResponseCompression: {Default: true, PreRelease: featuregate.Beta}, + APIListChunking: {Default: true, PreRelease: featuregate.Beta}, + DryRun: {Default: true, PreRelease: featuregate.GA}, + RemainingItemCount: {Default: true, PreRelease: featuregate.Beta}, + ServerSideApply: {Default: true, PreRelease: featuregate.GA}, + StorageVersionHash: {Default: true, PreRelease: featuregate.Beta}, + StorageVersionAPI: {Default: false, PreRelease: featuregate.Alpha}, + WatchBookmark: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta}, + RemoveSelfLink: {Default: true, PreRelease: featuregate.Beta}, + SelectorIndex: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + WarningHeaders: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + EfficientWatchResumption: {Default: true, PreRelease: featuregate.Beta}, + APIServerIdentity: {Default: false, PreRelease: featuregate.Alpha}, + APIServerTracing: {Default: false, PreRelease: featuregate.Alpha}, +} diff --git a/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go b/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go new file mode 100644 index 00000000..5911b756 --- /dev/null +++ b/vendor/k8s.io/apiserver/pkg/util/feature/feature_gate.go @@ -0,0 +1,33 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package feature + +import ( + "k8s.io/component-base/featuregate" +) + +var ( + // DefaultMutableFeatureGate is a mutable version of DefaultFeatureGate. + // Only top-level commands/options setup and the k8s.io/component-base/featuregate/testing package should make use of this. + // Tests that need to modify feature gates for the duration of their test should use: + // defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features., )() + DefaultMutableFeatureGate featuregate.MutableFeatureGate = featuregate.NewFeatureGate() + + // DefaultFeatureGate is a shared global FeatureGate. + // Top-level commands/options setup that needs to modify this feature gate should use DefaultMutableFeatureGate. + DefaultFeatureGate featuregate.FeatureGate = DefaultMutableFeatureGate +) diff --git a/vendor/k8s.io/component-base/featuregate/feature_gate.go b/vendor/k8s.io/component-base/featuregate/feature_gate.go new file mode 100644 index 00000000..c7166d80 --- /dev/null +++ b/vendor/k8s.io/component-base/featuregate/feature_gate.go @@ -0,0 +1,375 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package featuregate + +import ( + "fmt" + "sort" + "strconv" + "strings" + "sync" + "sync/atomic" + + "github.com/spf13/pflag" + + "k8s.io/apimachinery/pkg/util/naming" + "k8s.io/klog/v2" +) + +type Feature string + +const ( + flagName = "feature-gates" + + // allAlphaGate is a global toggle for alpha features. Per-feature key + // values override the default set by allAlphaGate. Examples: + // AllAlpha=false,NewFeature=true will result in newFeature=true + // AllAlpha=true,NewFeature=false will result in newFeature=false + allAlphaGate Feature = "AllAlpha" + + // allBetaGate is a global toggle for beta features. Per-feature key + // values override the default set by allBetaGate. Examples: + // AllBeta=false,NewFeature=true will result in NewFeature=true + // AllBeta=true,NewFeature=false will result in NewFeature=false + allBetaGate Feature = "AllBeta" +) + +var ( + // The generic features. + defaultFeatures = map[Feature]FeatureSpec{ + allAlphaGate: {Default: false, PreRelease: Alpha}, + allBetaGate: {Default: false, PreRelease: Beta}, + } + + // Special handling for a few gates. + specialFeatures = map[Feature]func(known map[Feature]FeatureSpec, enabled map[Feature]bool, val bool){ + allAlphaGate: setUnsetAlphaGates, + allBetaGate: setUnsetBetaGates, + } +) + +type FeatureSpec struct { + // Default is the default enablement state for the feature + Default bool + // LockToDefault indicates that the feature is locked to its default and cannot be changed + LockToDefault bool + // PreRelease indicates the maturity level of the feature + PreRelease prerelease +} + +type prerelease string + +const ( + // Values for PreRelease. + Alpha = prerelease("ALPHA") + Beta = prerelease("BETA") + GA = prerelease("") + + // Deprecated + Deprecated = prerelease("DEPRECATED") +) + +// FeatureGate indicates whether a given feature is enabled or not +type FeatureGate interface { + // Enabled returns true if the key is enabled. + Enabled(key Feature) bool + // KnownFeatures returns a slice of strings describing the FeatureGate's known features. + KnownFeatures() []string + // DeepCopy returns a deep copy of the FeatureGate object, such that gates can be + // set on the copy without mutating the original. This is useful for validating + // config against potential feature gate changes before committing those changes. + DeepCopy() MutableFeatureGate +} + +// MutableFeatureGate parses and stores flag gates for known features from +// a string like feature1=true,feature2=false,... +type MutableFeatureGate interface { + FeatureGate + + // AddFlag adds a flag for setting global feature gates to the specified FlagSet. + AddFlag(fs *pflag.FlagSet) + // Set parses and stores flag gates for known features + // from a string like feature1=true,feature2=false,... + Set(value string) error + // SetFromMap stores flag gates for known features from a map[string]bool or returns an error + SetFromMap(m map[string]bool) error + // Add adds features to the featureGate. + Add(features map[Feature]FeatureSpec) error + // GetAll returns a copy of the map of known feature names to feature specs. + GetAll() map[Feature]FeatureSpec +} + +// featureGate implements FeatureGate as well as pflag.Value for flag parsing. +type featureGate struct { + featureGateName string + + special map[Feature]func(map[Feature]FeatureSpec, map[Feature]bool, bool) + + // lock guards writes to known, enabled, and reads/writes of closed + lock sync.Mutex + // known holds a map[Feature]FeatureSpec + known *atomic.Value + // enabled holds a map[Feature]bool + enabled *atomic.Value + // closed is set to true when AddFlag is called, and prevents subsequent calls to Add + closed bool +} + +func setUnsetAlphaGates(known map[Feature]FeatureSpec, enabled map[Feature]bool, val bool) { + for k, v := range known { + if v.PreRelease == Alpha { + if _, found := enabled[k]; !found { + enabled[k] = val + } + } + } +} + +func setUnsetBetaGates(known map[Feature]FeatureSpec, enabled map[Feature]bool, val bool) { + for k, v := range known { + if v.PreRelease == Beta { + if _, found := enabled[k]; !found { + enabled[k] = val + } + } + } +} + +// Set, String, and Type implement pflag.Value +var _ pflag.Value = &featureGate{} + +// internalPackages are packages that ignored when creating a name for featureGates. These packages are in the common +// call chains, so they'd be unhelpful as names. +var internalPackages = []string{"k8s.io/component-base/featuregate/feature_gate.go"} + +func NewFeatureGate() *featureGate { + known := map[Feature]FeatureSpec{} + for k, v := range defaultFeatures { + known[k] = v + } + + knownValue := &atomic.Value{} + knownValue.Store(known) + + enabled := map[Feature]bool{} + enabledValue := &atomic.Value{} + enabledValue.Store(enabled) + + f := &featureGate{ + featureGateName: naming.GetNameFromCallsite(internalPackages...), + known: knownValue, + special: specialFeatures, + enabled: enabledValue, + } + return f +} + +// Set parses a string of the form "key1=value1,key2=value2,..." into a +// map[string]bool of known keys or returns an error. +func (f *featureGate) Set(value string) error { + m := make(map[string]bool) + for _, s := range strings.Split(value, ",") { + if len(s) == 0 { + continue + } + arr := strings.SplitN(s, "=", 2) + k := strings.TrimSpace(arr[0]) + if len(arr) != 2 { + return fmt.Errorf("missing bool value for %s", k) + } + v := strings.TrimSpace(arr[1]) + boolValue, err := strconv.ParseBool(v) + if err != nil { + return fmt.Errorf("invalid value of %s=%s, err: %v", k, v, err) + } + m[k] = boolValue + } + return f.SetFromMap(m) +} + +// SetFromMap stores flag gates for known features from a map[string]bool or returns an error +func (f *featureGate) SetFromMap(m map[string]bool) error { + f.lock.Lock() + defer f.lock.Unlock() + + // Copy existing state + known := map[Feature]FeatureSpec{} + for k, v := range f.known.Load().(map[Feature]FeatureSpec) { + known[k] = v + } + enabled := map[Feature]bool{} + for k, v := range f.enabled.Load().(map[Feature]bool) { + enabled[k] = v + } + + for k, v := range m { + k := Feature(k) + featureSpec, ok := known[k] + if !ok { + return fmt.Errorf("unrecognized feature gate: %s", k) + } + if featureSpec.LockToDefault && featureSpec.Default != v { + return fmt.Errorf("cannot set feature gate %v to %v, feature is locked to %v", k, v, featureSpec.Default) + } + enabled[k] = v + // Handle "special" features like "all alpha gates" + if fn, found := f.special[k]; found { + fn(known, enabled, v) + } + + if featureSpec.PreRelease == Deprecated { + klog.Warningf("Setting deprecated feature gate %s=%t. It will be removed in a future release.", k, v) + } else if featureSpec.PreRelease == GA { + klog.Warningf("Setting GA feature gate %s=%t. It will be removed in a future release.", k, v) + } + } + + // Persist changes + f.known.Store(known) + f.enabled.Store(enabled) + + klog.V(1).Infof("feature gates: %v", f.enabled) + return nil +} + +// String returns a string containing all enabled feature gates, formatted as "key1=value1,key2=value2,...". +func (f *featureGate) String() string { + pairs := []string{} + for k, v := range f.enabled.Load().(map[Feature]bool) { + pairs = append(pairs, fmt.Sprintf("%s=%t", k, v)) + } + sort.Strings(pairs) + return strings.Join(pairs, ",") +} + +func (f *featureGate) Type() string { + return "mapStringBool" +} + +// Add adds features to the featureGate. +func (f *featureGate) Add(features map[Feature]FeatureSpec) error { + f.lock.Lock() + defer f.lock.Unlock() + + if f.closed { + return fmt.Errorf("cannot add a feature gate after adding it to the flag set") + } + + // Copy existing state + known := map[Feature]FeatureSpec{} + for k, v := range f.known.Load().(map[Feature]FeatureSpec) { + known[k] = v + } + + for name, spec := range features { + if existingSpec, found := known[name]; found { + if existingSpec == spec { + continue + } + return fmt.Errorf("feature gate %q with different spec already exists: %v", name, existingSpec) + } + + known[name] = spec + } + + // Persist updated state + f.known.Store(known) + + return nil +} + +// GetAll returns a copy of the map of known feature names to feature specs. +func (f *featureGate) GetAll() map[Feature]FeatureSpec { + retval := map[Feature]FeatureSpec{} + for k, v := range f.known.Load().(map[Feature]FeatureSpec) { + retval[k] = v + } + return retval +} + +// Enabled returns true if the key is enabled. If the key is not known, this call will panic. +func (f *featureGate) Enabled(key Feature) bool { + if v, ok := f.enabled.Load().(map[Feature]bool)[key]; ok { + return v + } + if v, ok := f.known.Load().(map[Feature]FeatureSpec)[key]; ok { + return v.Default + } + + panic(fmt.Errorf("feature %q is not registered in FeatureGate %q", key, f.featureGateName)) +} + +// AddFlag adds a flag for setting global feature gates to the specified FlagSet. +func (f *featureGate) AddFlag(fs *pflag.FlagSet) { + f.lock.Lock() + // TODO(mtaufen): Shouldn't we just close it on the first Set/SetFromMap instead? + // Not all components expose a feature gates flag using this AddFlag method, and + // in the future, all components will completely stop exposing a feature gates flag, + // in favor of componentconfig. + f.closed = true + f.lock.Unlock() + + known := f.KnownFeatures() + fs.Var(f, flagName, ""+ + "A set of key=value pairs that describe feature gates for alpha/experimental features. "+ + "Options are:\n"+strings.Join(known, "\n")) +} + +// KnownFeatures returns a slice of strings describing the FeatureGate's known features. +// Deprecated and GA features are hidden from the list. +func (f *featureGate) KnownFeatures() []string { + var known []string + for k, v := range f.known.Load().(map[Feature]FeatureSpec) { + if v.PreRelease == GA || v.PreRelease == Deprecated { + continue + } + known = append(known, fmt.Sprintf("%s=true|false (%s - default=%t)", k, v.PreRelease, v.Default)) + } + sort.Strings(known) + return known +} + +// DeepCopy returns a deep copy of the FeatureGate object, such that gates can be +// set on the copy without mutating the original. This is useful for validating +// config against potential feature gate changes before committing those changes. +func (f *featureGate) DeepCopy() MutableFeatureGate { + // Copy existing state. + known := map[Feature]FeatureSpec{} + for k, v := range f.known.Load().(map[Feature]FeatureSpec) { + known[k] = v + } + enabled := map[Feature]bool{} + for k, v := range f.enabled.Load().(map[Feature]bool) { + enabled[k] = v + } + + // Store copied state in new atomics. + knownValue := &atomic.Value{} + knownValue.Store(known) + enabledValue := &atomic.Value{} + enabledValue.Store(enabled) + + // Construct a new featureGate around the copied state. + // Note that specialFeatures is treated as immutable by convention, + // and we maintain the value of f.closed across the copy. + return &featureGate{ + special: specialFeatures, + known: knownValue, + enabled: enabledValue, + closed: f.closed, + } +} diff --git a/vendor/k8s.io/kube-scheduler/config/v1beta1/doc.go b/vendor/k8s.io/kube-scheduler/config/v1beta2/doc.go similarity index 85% rename from vendor/k8s.io/kube-scheduler/config/v1beta1/doc.go rename to vendor/k8s.io/kube-scheduler/config/v1beta2/doc.go index c3bac316..c9f5f62e 100644 --- a/vendor/k8s.io/kube-scheduler/config/v1beta1/doc.go +++ b/vendor/k8s.io/kube-scheduler/config/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,4 +18,4 @@ limitations under the License. // +k8s:openapi-gen=true // +groupName=kubescheduler.config.k8s.io -package v1beta1 // import "k8s.io/kube-scheduler/config/v1beta1" +package v1beta2 // import "k8s.io/kube-scheduler/config/v1beta2" diff --git a/vendor/k8s.io/kube-scheduler/config/v1beta1/register.go b/vendor/k8s.io/kube-scheduler/config/v1beta2/register.go similarity index 87% rename from vendor/k8s.io/kube-scheduler/config/v1beta1/register.go rename to vendor/k8s.io/kube-scheduler/config/v1beta2/register.go index 71061212..59fc014a 100644 --- a/vendor/k8s.io/kube-scheduler/config/v1beta1/register.go +++ b/vendor/k8s.io/kube-scheduler/config/v1beta2/register.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1beta2 import ( "k8s.io/apimachinery/pkg/runtime" @@ -25,7 +25,7 @@ import ( const GroupName = "kubescheduler.config.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"} var ( // SchemeBuilder is the scheme builder with scheme init functions to run for this API package @@ -40,14 +40,9 @@ func addKnownTypes(scheme *runtime.Scheme) error { &KubeSchedulerConfiguration{}, &DefaultPreemptionArgs{}, &InterPodAffinityArgs{}, - &NodeLabelArgs{}, + &NodeResourcesBalancedAllocationArgs{}, &NodeResourcesFitArgs{}, &PodTopologySpreadArgs{}, - &RequestedToCapacityRatioArgs{}, - &ServiceAffinityArgs{}, - &NodeResourcesBalancedAllocationArgs{}, - &NodeResourcesLeastAllocatedArgs{}, - &NodeResourcesMostAllocatedArgs{}, &VolumeBindingArgs{}, &NodeAffinityArgs{}, ) diff --git a/vendor/k8s.io/kube-scheduler/config/v1beta1/types.go b/vendor/k8s.io/kube-scheduler/config/v1beta2/types.go similarity index 95% rename from vendor/k8s.io/kube-scheduler/config/v1beta1/types.go rename to vendor/k8s.io/kube-scheduler/config/v1beta2/types.go index b98090a1..4f132ea8 100644 --- a/vendor/k8s.io/kube-scheduler/config/v1beta1/types.go +++ b/vendor/k8s.io/kube-scheduler/config/v1beta2/types.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1beta2 import ( "bytes" @@ -158,45 +158,47 @@ type KubeSchedulerProfile struct { // be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order. type Plugins struct { // QueueSort is a list of plugins that should be invoked when sorting pods in the scheduling queue. - QueueSort *PluginSet `json:"queueSort,omitempty"` + QueueSort PluginSet `json:"queueSort,omitempty"` // PreFilter is a list of plugins that should be invoked at "PreFilter" extension point of the scheduling framework. - PreFilter *PluginSet `json:"preFilter,omitempty"` + PreFilter PluginSet `json:"preFilter,omitempty"` // Filter is a list of plugins that should be invoked when filtering out nodes that cannot run the Pod. - Filter *PluginSet `json:"filter,omitempty"` + Filter PluginSet `json:"filter,omitempty"` // PostFilter is a list of plugins that are invoked after filtering phase, no matter whether filtering succeeds or not. - PostFilter *PluginSet `json:"postFilter,omitempty"` + PostFilter PluginSet `json:"postFilter,omitempty"` // PreScore is a list of plugins that are invoked before scoring. - PreScore *PluginSet `json:"preScore,omitempty"` + PreScore PluginSet `json:"preScore,omitempty"` // Score is a list of plugins that should be invoked when ranking nodes that have passed the filtering phase. - Score *PluginSet `json:"score,omitempty"` + Score PluginSet `json:"score,omitempty"` // Reserve is a list of plugins invoked when reserving/unreserving resources // after a node is assigned to run the pod. - Reserve *PluginSet `json:"reserve,omitempty"` + Reserve PluginSet `json:"reserve,omitempty"` // Permit is a list of plugins that control binding of a Pod. These plugins can prevent or delay binding of a Pod. - Permit *PluginSet `json:"permit,omitempty"` + Permit PluginSet `json:"permit,omitempty"` // PreBind is a list of plugins that should be invoked before a pod is bound. - PreBind *PluginSet `json:"preBind,omitempty"` + PreBind PluginSet `json:"preBind,omitempty"` // Bind is a list of plugins that should be invoked at "Bind" extension point of the scheduling framework. // The scheduler call these plugins in order. Scheduler skips the rest of these plugins as soon as one returns success. - Bind *PluginSet `json:"bind,omitempty"` + Bind PluginSet `json:"bind,omitempty"` // PostBind is a list of plugins that should be invoked after a pod is successfully bound. - PostBind *PluginSet `json:"postBind,omitempty"` + PostBind PluginSet `json:"postBind,omitempty"` } // PluginSet specifies enabled and disabled plugins for an extension point. // If an array is empty, missing, or nil, default plugins at that extension point will be used. type PluginSet struct { // Enabled specifies plugins that should be enabled in addition to default plugins. + // If the default plugin is also configured in the scheduler config file, the weight of plugin will + // be overridden accordingly. // These are called after default plugins and in the same order specified here. // +listType=atomic Enabled []Plugin `json:"enabled,omitempty"` diff --git a/vendor/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go b/vendor/k8s.io/kube-scheduler/config/v1beta2/types_pluginargs.go similarity index 71% rename from vendor/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go rename to vendor/k8s.io/kube-scheduler/config/v1beta2/types_pluginargs.go index 6ce798bb..34768d3c 100644 --- a/vendor/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go +++ b/vendor/k8s.io/kube-scheduler/config/v1beta2/types_pluginargs.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1beta2 import ( corev1 "k8s.io/api/core/v1" @@ -56,30 +56,6 @@ type InterPodAffinityArgs struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// NodeLabelArgs holds arguments used to configure the NodeLabel plugin. -// -// This plugin has been deprecated and is only configurable through the -// scheduler policy API and the v1beta1 component config API. It is recommended -// to use the NodeAffinity plugin instead. -type NodeLabelArgs struct { - metav1.TypeMeta `json:",inline"` - - // PresentLabels should be present for the node to be considered a fit for hosting the pod - // +listType=atomic - PresentLabels []string `json:"presentLabels,omitempty"` - // AbsentLabels should be absent for the node to be considered a fit for hosting the pod - // +listType=atomic - AbsentLabels []string `json:"absentLabels,omitempty"` - // Nodes that have labels in the list will get a higher score. - // +listType=atomic - PresentLabelsPreference []string `json:"presentLabelsPreference,omitempty"` - // Nodes that don't have labels in the list will get a higher score. - // +listType=atomic - AbsentLabelsPreference []string `json:"absentLabelsPreference,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // NodeResourcesFitArgs holds arguments used to configure the NodeResourcesFit plugin. type NodeResourcesFitArgs struct { metav1.TypeMeta `json:",inline"` @@ -142,46 +118,6 @@ type PodTopologySpreadArgs struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// RequestedToCapacityRatioArgs holds arguments used to configure RequestedToCapacityRatio plugin. -type RequestedToCapacityRatioArgs struct { - metav1.TypeMeta `json:",inline"` - - // Points defining priority function shape - // +listType=atomic - Shape []UtilizationShapePoint `json:"shape"` - // Resources to be managed - // +listType=atomic - Resources []ResourceSpec `json:"resources,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeResourcesLeastAllocatedArgs holds arguments used to configure NodeResourcesLeastAllocated plugin. -type NodeResourcesLeastAllocatedArgs struct { - metav1.TypeMeta `json:",inline"` - - // Resources to be managed, if no resource is provided, default resource set with both - // the weight of "cpu" and "memory" set to "1" will be applied. - // Resource with "0" weight will not accountable for the final score. - // +listType=atomic - Resources []ResourceSpec `json:"resources,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeResourcesMostAllocatedArgs holds arguments used to configure NodeResourcesMostAllocated plugin. -type NodeResourcesMostAllocatedArgs struct { - metav1.TypeMeta `json:",inline"` - - // Resources to be managed, if no resource is provided, default resource set with both - // the weight of "cpu" and "memory" set to "1" will be applied. - // Resource with "0" weight will not accountable for the final score. - // +listType=atomic - Resources []ResourceSpec `json:"resources,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // NodeResourcesBalancedAllocationArgs holds arguments used to configure NodeResourcesBalancedAllocation plugin. type NodeResourcesBalancedAllocationArgs struct { metav1.TypeMeta `json:",inline"` @@ -210,26 +146,6 @@ type ResourceSpec struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ServiceAffinityArgs holds arguments used to configure the ServiceAffinity plugin. -// -// This plugin has been deprecated and is only configurable through the -// scheduler policy API and the v1beta1 component config API. It is recommended -// to use the InterPodAffinity plugin instead. -type ServiceAffinityArgs struct { - metav1.TypeMeta `json:",inline"` - - // AffinityLabels are homogeneous for pods that are scheduled to a node. - // (i.e. it returns true IFF this pod can be added to this node such that all other pods in - // the same service are running on nodes with the exact same values for Labels). - // +listType=atomic - AffinityLabels []string `json:"affinityLabels,omitempty"` - // AntiAffinityLabelsPreference are the labels to consider for service anti affinity scoring. - // +listType=atomic - AntiAffinityLabelsPreference []string `json:"antiAffinityLabelsPreference,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - // VolumeBindingArgs holds arguments used to configure the VolumeBinding plugin. type VolumeBindingArgs struct { metav1.TypeMeta `json:",inline"` @@ -295,7 +211,7 @@ type ScoringStrategy struct { // Allowed weights go from 1 to 100. // Weight defaults to 1 if not specified or explicitly set to 0. // +listType=map - // +listMapKey=name + // +listMapKey=topologyKey Resources []ResourceSpec `json:"resources,omitempty"` // Arguments specific to RequestedToCapacityRatio strategy. diff --git a/vendor/k8s.io/kube-scheduler/config/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/kube-scheduler/config/v1beta2/zz_generated.deepcopy.go similarity index 70% rename from vendor/k8s.io/kube-scheduler/config/v1beta1/zz_generated.deepcopy.go rename to vendor/k8s.io/kube-scheduler/config/v1beta2/zz_generated.deepcopy.go index 22066cec..e82d957e 100644 --- a/vendor/k8s.io/kube-scheduler/config/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/kube-scheduler/config/v1beta2/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1beta2 import ( corev1 "k8s.io/api/core/v1" @@ -253,51 +253,6 @@ func (in *NodeAffinityArgs) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeLabelArgs) DeepCopyInto(out *NodeLabelArgs) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.PresentLabels != nil { - in, out := &in.PresentLabels, &out.PresentLabels - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AbsentLabels != nil { - in, out := &in.AbsentLabels, &out.AbsentLabels - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PresentLabelsPreference != nil { - in, out := &in.PresentLabelsPreference, &out.PresentLabelsPreference - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AbsentLabelsPreference != nil { - in, out := &in.AbsentLabelsPreference, &out.AbsentLabelsPreference - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeLabelArgs. -func (in *NodeLabelArgs) DeepCopy() *NodeLabelArgs { - if in == nil { - return nil - } - out := new(NodeLabelArgs) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeLabelArgs) 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 *NodeResourcesBalancedAllocationArgs) DeepCopyInto(out *NodeResourcesBalancedAllocationArgs) { *out = *in @@ -368,66 +323,6 @@ func (in *NodeResourcesFitArgs) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeResourcesLeastAllocatedArgs) DeepCopyInto(out *NodeResourcesLeastAllocatedArgs) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ResourceSpec, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourcesLeastAllocatedArgs. -func (in *NodeResourcesLeastAllocatedArgs) DeepCopy() *NodeResourcesLeastAllocatedArgs { - if in == nil { - return nil - } - out := new(NodeResourcesLeastAllocatedArgs) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeResourcesLeastAllocatedArgs) 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 *NodeResourcesMostAllocatedArgs) DeepCopyInto(out *NodeResourcesMostAllocatedArgs) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ResourceSpec, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourcesMostAllocatedArgs. -func (in *NodeResourcesMostAllocatedArgs) DeepCopy() *NodeResourcesMostAllocatedArgs { - if in == nil { - return nil - } - out := new(NodeResourcesMostAllocatedArgs) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeResourcesMostAllocatedArgs) 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 *Plugin) DeepCopyInto(out *Plugin) { *out = *in @@ -499,61 +394,17 @@ func (in *PluginSet) DeepCopy() *PluginSet { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Plugins) DeepCopyInto(out *Plugins) { *out = *in - if in.QueueSort != nil { - in, out := &in.QueueSort, &out.QueueSort - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.PreFilter != nil { - in, out := &in.PreFilter, &out.PreFilter - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.Filter != nil { - in, out := &in.Filter, &out.Filter - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.PostFilter != nil { - in, out := &in.PostFilter, &out.PostFilter - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.PreScore != nil { - in, out := &in.PreScore, &out.PreScore - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.Score != nil { - in, out := &in.Score, &out.Score - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.Reserve != nil { - in, out := &in.Reserve, &out.Reserve - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.Permit != nil { - in, out := &in.Permit, &out.Permit - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.PreBind != nil { - in, out := &in.PreBind, &out.PreBind - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.Bind != nil { - in, out := &in.Bind, &out.Bind - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } - if in.PostBind != nil { - in, out := &in.PostBind, &out.PostBind - *out = new(PluginSet) - (*in).DeepCopyInto(*out) - } + in.QueueSort.DeepCopyInto(&out.QueueSort) + in.PreFilter.DeepCopyInto(&out.PreFilter) + in.Filter.DeepCopyInto(&out.Filter) + in.PostFilter.DeepCopyInto(&out.PostFilter) + in.PreScore.DeepCopyInto(&out.PreScore) + in.Score.DeepCopyInto(&out.Score) + in.Reserve.DeepCopyInto(&out.Reserve) + in.Permit.DeepCopyInto(&out.Permit) + in.PreBind.DeepCopyInto(&out.PreBind) + in.Bind.DeepCopyInto(&out.Bind) + in.PostBind.DeepCopyInto(&out.PostBind) return } @@ -599,41 +450,6 @@ func (in *PodTopologySpreadArgs) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RequestedToCapacityRatioArgs) DeepCopyInto(out *RequestedToCapacityRatioArgs) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.Shape != nil { - in, out := &in.Shape, &out.Shape - *out = make([]UtilizationShapePoint, len(*in)) - copy(*out, *in) - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ResourceSpec, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestedToCapacityRatioArgs. -func (in *RequestedToCapacityRatioArgs) DeepCopy() *RequestedToCapacityRatioArgs { - if in == nil { - return nil - } - out := new(RequestedToCapacityRatioArgs) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RequestedToCapacityRatioArgs) 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 *RequestedToCapacityRatioParam) DeepCopyInto(out *RequestedToCapacityRatioParam) { *out = *in @@ -697,41 +513,6 @@ func (in *ScoringStrategy) DeepCopy() *ScoringStrategy { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceAffinityArgs) DeepCopyInto(out *ServiceAffinityArgs) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.AffinityLabels != nil { - in, out := &in.AffinityLabels, &out.AffinityLabels - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.AntiAffinityLabelsPreference != nil { - in, out := &in.AntiAffinityLabelsPreference, &out.AntiAffinityLabelsPreference - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAffinityArgs. -func (in *ServiceAffinityArgs) DeepCopy() *ServiceAffinityArgs { - if in == nil { - return nil - } - out := new(ServiceAffinityArgs) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ServiceAffinityArgs) 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 *UtilizationShapePoint) DeepCopyInto(out *UtilizationShapePoint) { *out = *in diff --git a/vendor/k8s.io/kubernetes/pkg/features/OWNERS b/vendor/k8s.io/kubernetes/pkg/features/OWNERS new file mode 100644 index 00000000..05b08249 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/features/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- feature-approvers diff --git a/vendor/k8s.io/kubernetes/pkg/features/kube_features.go b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go new file mode 100644 index 00000000..c628e3eb --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/features/kube_features.go @@ -0,0 +1,934 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package features + +import ( + "k8s.io/apimachinery/pkg/util/runtime" + genericfeatures "k8s.io/apiserver/pkg/features" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/component-base/featuregate" +) + +const ( + // Every feature gate should add method here following this template: + // + // // owner: @username + // // kep: http://kep.k8s.io/NNN + // // alpha: v1.X + // MyFeature featuregate.Feature = "MyFeature" + + // owner: @tallclair + // beta: v1.4 + AppArmor featuregate.Feature = "AppArmor" + + // owner: @mtaufen + // alpha: v1.4 + // beta: v1.11 + // deprecated: 1.22 + DynamicKubeletConfig featuregate.Feature = "DynamicKubeletConfig" + + // owner: @pweil- + // alpha: v1.5 + // + // Default userns=host for containers that are using other host namespaces, host mounts, the pod + // contains a privileged container, or specific non-namespaced capabilities (MKNOD, SYS_MODULE, + // SYS_TIME). This should only be enabled if user namespace remapping is enabled in the docker daemon. + ExperimentalHostUserNamespaceDefaultingGate featuregate.Feature = "ExperimentalHostUserNamespaceDefaulting" + + // owner: @jiayingz + // beta: v1.10 + // + // Enables support for Device Plugins + DevicePlugins featuregate.Feature = "DevicePlugins" + + // owner: @dxist + // alpha: v1.16 + // + // Enables support of HPA scaling to zero pods when an object or custom metric is configured. + HPAScaleToZero featuregate.Feature = "HPAScaleToZero" + + // owner: @mikedanese + // alpha: v1.7 + // beta: v1.12 + // + // Gets a server certificate for the kubelet from the Certificate Signing + // Request API instead of generating one self signed and auto rotates the + // certificate as expiration approaches. + RotateKubeletServerCertificate featuregate.Feature = "RotateKubeletServerCertificate" + + // owner: @jinxu + // beta: v1.10 + // + // New local storage types to support local storage capacity isolation + LocalStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation" + + // owner: @gnufied + // beta: v1.11 + // Ability to Expand persistent volumes + ExpandPersistentVolumes featuregate.Feature = "ExpandPersistentVolumes" + + // owner: @mlmhl + // beta: v1.15 + // Ability to expand persistent volumes' file system without unmounting volumes. + ExpandInUsePersistentVolumes featuregate.Feature = "ExpandInUsePersistentVolumes" + + // owner: @gnufied + // alpha: v1.14 + // beta: v1.16 + // Ability to expand CSI volumes + ExpandCSIVolumes featuregate.Feature = "ExpandCSIVolumes" + + // owner: @verb + // alpha: v1.16 + // + // Allows running an ephemeral container in pod namespaces to troubleshoot a running pod. + EphemeralContainers featuregate.Feature = "EphemeralContainers" + + // owner: @sjenning + // alpha: v1.11 + // + // Allows resource reservations at the QoS level preventing pods at lower QoS levels from + // bursting into resources requested at higher QoS levels (memory only for now) + QOSReserved featuregate.Feature = "QOSReserved" + + // owner: @ConnorDoyle + // alpha: v1.8 + // beta: v1.10 + // + // Alternative container-level CPU affinity policies. + CPUManager featuregate.Feature = "CPUManager" + + // owner: @szuecs + // alpha: v1.12 + // + // Enable nodes to change CPUCFSQuotaPeriod + CPUCFSQuotaPeriod featuregate.Feature = "CustomCPUCFSQuotaPeriod" + + // owner: @lmdaly + // alpha: v1.16 + // beta: v1.18 + // + // Enable resource managers to make NUMA aligned decisions + TopologyManager featuregate.Feature = "TopologyManager" + + // owner: @cynepco3hahue(alukiano) @cezaryzukowski @k-wiatrzyk + // alpha: v1.21 + // beta: v1.22 + + // Allows setting memory affinity for a container based on NUMA topology + MemoryManager featuregate.Feature = "MemoryManager" + + // owner: @sjenning + // alpha: v1.4 + // beta: v1.11 + // ga: v1.21 + // + // Enable pods to set sysctls on a pod + Sysctls featuregate.Feature = "Sysctls" + + // owner: @pospispa + // GA: v1.11 + // + // Postpone deletion of a PV or a PVC when they are being used + StorageObjectInUseProtection featuregate.Feature = "StorageObjectInUseProtection" + + // owner: @dims, @derekwaynecarr + // alpha: v1.10 + // beta: v1.14 + // GA: v1.20 + // + // Implement support for limiting pids in pods + SupportPodPidsLimit featuregate.Feature = "SupportPodPidsLimit" + + // owner: @mikedanese + // alpha: v1.13 + // beta: v1.21 + // ga: v1.22 + // + // Migrate ServiceAccount volumes to use a projected volume consisting of a + // ServiceAccountTokenVolumeProjection. This feature adds new required flags + // to the API server. + BoundServiceAccountTokenVolume featuregate.Feature = "BoundServiceAccountTokenVolume" + + // owner: @mtaufen + // alpha: v1.18 + // beta: v1.20 + // stable: v1.21 + // + // Enable OIDC discovery endpoints (issuer and JWKS URLs) for the service + // account issuer in the API server. + // Note these endpoints serve minimally-compliant discovery docs that are + // intended to be used for service account token verification. + ServiceAccountIssuerDiscovery featuregate.Feature = "ServiceAccountIssuerDiscovery" + + // owner: @saad-ali + // ga: v1.10 + // + // Allow mounting a subpath of a volume in a container + // Do not remove this feature gate even though it's GA + VolumeSubpath featuregate.Feature = "VolumeSubpath" + + // owner: @pohly + // alpha: v1.14 + // beta: v1.16 + // + // Enables CSI Inline volumes support for pods + CSIInlineVolume featuregate.Feature = "CSIInlineVolume" + + // owner: @pohly + // alpha: v1.19 + // beta: v1.21 + // + // Enables tracking of available storage capacity that CSI drivers provide. + CSIStorageCapacity featuregate.Feature = "CSIStorageCapacity" + + // owner: @alculquicondor + // beta: v1.20 + // + // Enables the use of PodTopologySpread scheduling plugin to do default + // spreading and disables legacy SelectorSpread plugin. + DefaultPodTopologySpread featuregate.Feature = "DefaultPodTopologySpread" + + // owner: @pohly + // alpha: v1.19 + // beta: v1.21 + // + // Enables generic ephemeral inline volume support for pods + GenericEphemeralVolume featuregate.Feature = "GenericEphemeralVolume" + + // owner: @chendave + // alpha: v1.21 + // beta: v1.22 + // + // PreferNominatedNode tells scheduler whether the nominated node will be checked first before looping + // all the rest of nodes in the cluster. + // Enabling this feature also implies the preemptor pod might not be dispatched to the best candidate in + // some corner case, e.g. another node releases enough resources after the nominated node has been set + // and hence is the best candidate instead. + PreferNominatedNode featuregate.Feature = "PreferNominatedNode" + + // owner: @tallclair + // alpha: v1.12 + // beta: v1.14 + // GA: v1.20 + // + // Enables RuntimeClass, for selecting between multiple runtimes to run a pod. + RuntimeClass featuregate.Feature = "RuntimeClass" + + // owner: @mtaufen + // alpha: v1.12 + // beta: v1.14 + // GA: v1.17 + // + // Kubelet uses the new Lease API to report node heartbeats, + // (Kube) Node Lifecycle Controller uses these heartbeats as a node health signal. + NodeLease featuregate.Feature = "NodeLease" + + // owner: @rikatz + // kep: http://kep.k8s.io/2079 + // alpha: v1.21 + // beta: v1.22 + // + // Enables the endPort field in NetworkPolicy to enable a Port Range behavior in Network Policies. + NetworkPolicyEndPort featuregate.Feature = "NetworkPolicyEndPort" + + // owner: @jessfraz + // alpha: v1.12 + // + // Enables control over ProcMountType for containers. + ProcMountType featuregate.Feature = "ProcMountType" + + // owner: @janetkuo + // alpha: v1.12 + // + // Allow TTL controller to clean up Pods and Jobs after they finish. + TTLAfterFinished featuregate.Feature = "TTLAfterFinished" + + // owner: @alculquicondor + // alpha: v1.21 + // beta: v1.22 + // + // Allows Job controller to manage Pod completions per completion index. + IndexedJob featuregate.Feature = "IndexedJob" + + // owner: @alculquicondor + // alpha: v1.22 + // + // Track Job completion without relying on Pod remaining in the cluster + // indefinitely. Pod finalizers, in addition to a field in the Job status + // allow the Job controller to keep track of Pods that it didn't account for + // yet. + JobTrackingWithFinalizers featuregate.Feature = "JobTrackingWithFinalizers" + + // owner: @dashpole + // alpha: v1.13 + // beta: v1.15 + // + // Enables the kubelet's pod resources grpc endpoint + KubeletPodResources featuregate.Feature = "KubeletPodResources" + + // owner: @davidz627 + // alpha: v1.14 + // beta: v1.17 + // + // Enables the in-tree storage to CSI Plugin migration feature. + CSIMigration featuregate.Feature = "CSIMigration" + + // owner: @davidz627 + // alpha: v1.14 + // beta: v1.17 + // + // Enables the GCE PD in-tree driver to GCE CSI Driver migration feature. + CSIMigrationGCE featuregate.Feature = "CSIMigrationGCE" + + // owner: @Jiawei0227 + // alpha: v1.21 + // + // Disables the GCE PD in-tree driver. + InTreePluginGCEUnregister featuregate.Feature = "InTreePluginGCEUnregister" + + // owner: @leakingtapan + // alpha: v1.14 + // beta: v1.17 + // + // Enables the AWS EBS in-tree driver to AWS EBS CSI Driver migration feature. + CSIMigrationAWS featuregate.Feature = "CSIMigrationAWS" + + // owner: @leakingtapan + // alpha: v1.21 + // + // Disables the AWS EBS in-tree driver. + InTreePluginAWSUnregister featuregate.Feature = "InTreePluginAWSUnregister" + + // owner: @andyzhangx + // alpha: v1.15 + // beta: v1.19 + // + // Enables the Azure Disk in-tree driver to Azure Disk Driver migration feature. + CSIMigrationAzureDisk featuregate.Feature = "CSIMigrationAzureDisk" + + // owner: @andyzhangx + // alpha: v1.21 + // + // Disables the Azure Disk in-tree driver. + InTreePluginAzureDiskUnregister featuregate.Feature = "InTreePluginAzureDiskUnregister" + + // owner: @andyzhangx + // alpha: v1.15 + // beta: v1.21 + // + // Enables the Azure File in-tree driver to Azure File Driver migration feature. + CSIMigrationAzureFile featuregate.Feature = "CSIMigrationAzureFile" + + // owner: @andyzhangx + // alpha: v1.21 + // + // Disables the Azure File in-tree driver. + InTreePluginAzureFileUnregister featuregate.Feature = "InTreePluginAzureFileUnregister" + + // owner: @divyenpatel + // beta: v1.19 (requires: vSphere vCenter/ESXi Version: 7.0u1, HW Version: VM version 15) + // + // Enables the vSphere in-tree driver to vSphere CSI Driver migration feature. + CSIMigrationvSphere featuregate.Feature = "CSIMigrationvSphere" + + // owner: @divyenpatel + // alpha: v1.21 + // + // Disables the vSphere in-tree driver. + InTreePluginvSphereUnregister featuregate.Feature = "InTreePluginvSphereUnregister" + + // owner: @adisky + // alpha: v1.14 + // beta: v1.18 + // + // Enables the OpenStack Cinder in-tree driver to OpenStack Cinder CSI Driver migration feature. + CSIMigrationOpenStack featuregate.Feature = "CSIMigrationOpenStack" + + // owner: @adisky + // alpha: v1.21 + // + // Disables the OpenStack Cinder in-tree driver. + InTreePluginOpenStackUnregister featuregate.Feature = "InTreePluginOpenStackUnregister" + + // owner: @huffmanca + // alpha: v1.19 + // beta: v1.20 + // + // Determines if a CSI Driver supports applying fsGroup. + CSIVolumeFSGroupPolicy featuregate.Feature = "CSIVolumeFSGroupPolicy" + + // owner: @gnufied + // alpha: v1.18 + // beta: v1.20 + // Allows user to configure volume permission change policy for fsGroups when mounting + // a volume in a Pod. + ConfigurableFSGroupPolicy featuregate.Feature = "ConfigurableFSGroupPolicy" + + // owner: @gnufied, @verult + // alpha: v1.22 + // If supported by the CSI driver, delegates the role of applying FSGroup to + // the driver by passing FSGroup through the NodeStageVolume and + // NodePublishVolume calls. + DelegateFSGroupToCSIDriver featuregate.Feature = "DelegateFSGroupToCSIDriver" + + // owner: @RobertKrawitz, @derekwaynecarr + // beta: v1.15 + // GA: v1.20 + // + // Implement support for limiting pids in nodes + SupportNodePidsLimit featuregate.Feature = "SupportNodePidsLimit" + + // owner: @RobertKrawitz + // alpha: v1.15 + // + // Allow use of filesystems for ephemeral storage monitoring. + // Only applies if LocalStorageCapacityIsolation is set. + LocalStorageCapacityIsolationFSQuotaMonitoring featuregate.Feature = "LocalStorageCapacityIsolationFSQuotaMonitoring" + + // owner: @denkensk + // alpha: v1.15 + // beta: v1.19 + // + // Enables NonPreempting option for priorityClass and pod. + NonPreemptingPriority featuregate.Feature = "NonPreemptingPriority" + + // owner: @egernst + // alpha: v1.16 + // beta: v1.18 + // + // Enables PodOverhead, for accounting pod overheads which are specific to a given RuntimeClass + PodOverhead featuregate.Feature = "PodOverhead" + + // owner: @khenidak + // kep: http://kep.k8s.io/563 + // alpha: v1.15 + // beta: v1.21 + // + // Enables ipv6 dual stack + IPv6DualStack featuregate.Feature = "IPv6DualStack" + + // owner: @robscott @freehan + // kep: http://kep.k8s.io/752 + // alpha: v1.16 + // beta: v1.18 + // ga: v1.21 + // + // Enable Endpoint Slices for more scalable Service endpoints. + EndpointSlice featuregate.Feature = "EndpointSlice" + + // owner: @robscott @freehan + // kep: http://kep.k8s.io/752 + // alpha: v1.18 + // beta: v1.19 + // ga: v1.22 + // + // Enable Endpoint Slice consumption by kube-proxy for improved scalability. + EndpointSliceProxying featuregate.Feature = "EndpointSliceProxying" + + // owner: @robscott @kumarvin123 + // kep: http://kep.k8s.io/752 + // alpha: v1.19 + // beta: v1.21 + // ga: v1.22 + // + // Enable Endpoint Slice consumption by kube-proxy in Windows for improved scalability. + WindowsEndpointSliceProxying featuregate.Feature = "WindowsEndpointSliceProxying" + + // owner: @matthyx + // alpha: v1.16 + // beta: v1.18 + // GA: v1.20 + // + // Enables the startupProbe in kubelet worker. + StartupProbe featuregate.Feature = "StartupProbe" + + // owner: @deads2k + // beta: v1.17 + // GA: v1.21 + // + // Enables the users to skip TLS verification of kubelets on pod logs requests + AllowInsecureBackendProxy featuregate.Feature = "AllowInsecureBackendProxy" + + // owner: @mortent + // alpha: v1.3 + // beta: v1.5 + // + // Enable all logic related to the PodDisruptionBudget API object in policy + PodDisruptionBudget featuregate.Feature = "PodDisruptionBudget" + + // owner: @alaypatel07, @soltysh + // alpha: v1.20 + // beta: v1.21 + // GA: v1.22 + // + // CronJobControllerV2 controls whether the controller manager starts old cronjob + // controller or new one which is implemented with informers and delaying queue + CronJobControllerV2 featuregate.Feature = "CronJobControllerV2" + + // owner: @smarterclayton + // alpha: v1.21 + // beta: v1.22 + // DaemonSets allow workloads to maintain availability during update per node + DaemonSetUpdateSurge featuregate.Feature = "DaemonSetUpdateSurge" + + // owner: @wojtek-t + // alpha: v1.18 + // beta: v1.19 + // ga: v1.21 + // + // Enables a feature to make secrets and configmaps data immutable. + ImmutableEphemeralVolumes featuregate.Feature = "ImmutableEphemeralVolumes" + + // owner: @bart0sh + // alpha: v1.18 + // beta: v1.19 + // GA: 1.22 + // + // Enables usage of HugePages- in a volume medium, + // e.g. emptyDir: + // medium: HugePages-1Gi + HugePageStorageMediumSize featuregate.Feature = "HugePageStorageMediumSize" + + // owner: @derekwaynecarr + // alpha: v1.20 + // beta: v1.21 (off by default until 1.22) + // + // Enables usage of hugepages- in downward API. + DownwardAPIHugePages featuregate.Feature = "DownwardAPIHugePages" + + // owner: @bswartz + // alpha: v1.18 + // + // Enables usage of any object for volume data source in PVCs + AnyVolumeDataSource featuregate.Feature = "AnyVolumeDataSource" + + // owner: @javidiaz + // kep: http://kep.k8s.io/1797 + // alpha: v1.19 + // beta: v1.20 + // GA: v1.22 + // + // Allow setting the Fully Qualified Domain Name (FQDN) in the hostname of a Pod. If a Pod does not + // have FQDN, this feature has no effect. + SetHostnameAsFQDN featuregate.Feature = "SetHostnameAsFQDN" + + // owner: @ksubrmnn + // alpha: v1.14 + // beta: v1.20 + // + // Allows kube-proxy to run in Overlay mode for Windows + WinOverlay featuregate.Feature = "WinOverlay" + + // owner: @ksubrmnn + // alpha: v1.14 + // + // Allows kube-proxy to create DSR loadbalancers for Windows + WinDSR featuregate.Feature = "WinDSR" + + // owner: @RenaudWasTaken @dashpole + // alpha: v1.19 + // beta: v1.20 + // + // Disables Accelerator Metrics Collected by Kubelet + DisableAcceleratorUsageMetrics featuregate.Feature = "DisableAcceleratorUsageMetrics" + + // owner: @arjunrn @mwielgus @josephburnett + // alpha: v1.20 + // + // Add support for the HPA to scale based on metrics from individual containers + // in target pods + HPAContainerMetrics featuregate.Feature = "HPAContainerMetrics" + + // owner: @andrewsykim + // kep: http://kep.k8s.io/1672 + // alpha: v1.20 + // beta: v1.22 + // + // Enable Terminating condition in Endpoint Slices. + EndpointSliceTerminatingCondition featuregate.Feature = "EndpointSliceTerminatingCondition" + + // owner: @andrewsykim + // kep: http://kep.k8s.io/1669 + // alpha: v1.22 + // + // Enable kube-proxy to handle terminating ednpoints when externalTrafficPolicy=Local + ProxyTerminatingEndpoints featuregate.Feature = "ProxyTerminatingEndpoints" + + // owner: @robscott + // kep: http://kep.k8s.io/752 + // alpha: v1.20 + // + // Enable NodeName field on Endpoint Slices. + EndpointSliceNodeName featuregate.Feature = "EndpointSliceNodeName" + + // owner: @derekwaynecarr + // alpha: v1.20 + // beta: v1.22 + // + // Enables kubelet support to size memory backed volumes + SizeMemoryBackedVolumes featuregate.Feature = "SizeMemoryBackedVolumes" + + // owner: @andrewsykim @SergeyKanzhelev + // GA: v1.20 + // + // Ensure kubelet respects exec probe timeouts. Feature gate exists in-case existing workloads + // may depend on old behavior where exec probe timeouts were ignored. + // Lock to default and remove after v1.22 based on user feedback that should be reflected in KEP #1972 update + ExecProbeTimeout featuregate.Feature = "ExecProbeTimeout" + + // owner: @andrewsykim + // alpha: v1.20 + // + // Enable kubelet exec plugins for image pull credentials. + KubeletCredentialProviders featuregate.Feature = "KubeletCredentialProviders" + + // owner: @andrewsykim + // alpha: v1.22 + // + // Disable any functionality in kube-apiserver, kube-controller-manager and kubelet related to the `--cloud-provider` component flag. + DisableCloudProviders featuregate.Feature = "DisableCloudProviders" + + // owner: @zshihang + // alpha: v1.20 + // beta: v1.21 + // ga: v1.22 + // + // Enable kubelet to pass pod's service account token to NodePublishVolume + // call of CSI driver which is mounting volumes for that pod. + CSIServiceAccountToken featuregate.Feature = "CSIServiceAccountToken" + + // owner: @bobbypage + // alpha: v1.20 + // beta: v1.21 + // Adds support for kubelet to detect node shutdown and gracefully terminate pods prior to the node being shutdown. + GracefulNodeShutdown featuregate.Feature = "GracefulNodeShutdown" + + // owner: @andrewsykim @uablrek + // kep: http://kep.k8s.io/1864 + // alpha: v1.20 + // beta: v1.22 + // + // Allows control if NodePorts shall be created for services with "type: LoadBalancer" by defining the spec.AllocateLoadBalancerNodePorts field (bool) + ServiceLBNodePortControl featuregate.Feature = "ServiceLBNodePortControl" + + // owner: @janosi + // kep: http://kep.k8s.io/1435 + // alpha: v1.20 + // + // Enables the usage of different protocols in the same Service with type=LoadBalancer + MixedProtocolLBService featuregate.Feature = "MixedProtocolLBService" + + // owner: @cofyc + // alpha: v1.21 + VolumeCapacityPriority featuregate.Feature = "VolumeCapacityPriority" + + // owner: @ahg-g + // alpha: v1.21 + // beta: v1.22 + // + // Enables controlling pod ranking on replicaset scale-down. + PodDeletionCost featuregate.Feature = "PodDeletionCost" + + // owner: @robscott + // kep: http://kep.k8s.io/2433 + // alpha: v1.21 + // + // Enables topology aware hints for EndpointSlices + TopologyAwareHints featuregate.Feature = "TopologyAwareHints" + + // owner: @ehashman + // alpha: v1.21 + // + // Allows user to override pod-level terminationGracePeriod for probes + ProbeTerminationGracePeriod featuregate.Feature = "ProbeTerminationGracePeriod" + + // owner: @ehashman + // alpha: v1.22 + // + // Permits kubelet to run with swap enabled + NodeSwap featuregate.Feature = "NodeSwap" + + // owner: @ahg-g + // alpha: v1.21 + // beta: v1.22 + // + // Allow specifying NamespaceSelector in PodAffinityTerm. + PodAffinityNamespaceSelector featuregate.Feature = "PodAffinityNamespaceSelector" + + // owner: @andrewsykim @XudongLiuHarold + // kep: http://kep.k8s.io/1959 + // alpha: v1.21 + // beta: v1.22 + // + // Enable support multiple Service "type: LoadBalancer" implementations in a cluster by specifying LoadBalancerClass + ServiceLoadBalancerClass featuregate.Feature = "ServiceLoadBalancerClass" + + // owner: @damemi + // alpha: v1.21 + // beta: v1.22 + // + // Enables scaling down replicas via logarithmic comparison of creation/ready timestamps + LogarithmicScaleDown featuregate.Feature = "LogarithmicScaleDown" + + // owner: @hbagdi + // kep: http://kep.k8s.io/2365 + // alpha: v1.21 + // beta: v1.22 + // + // Enable Scope and Namespace fields on IngressClassParametersReference. + IngressClassNamespacedParams featuregate.Feature = "IngressClassNamespacedParams" + + // owner: @maplain @andrewsykim + // kep: http://kep.k8s.io/2086 + // alpha: v1.21 + // + // Enables node-local routing for Service internal traffic + ServiceInternalTrafficPolicy featuregate.Feature = "ServiceInternalTrafficPolicy" + + // owner: @adtac + // alpha: v1.21 + // beta: v1.22 + // + // Allows jobs to be created in the suspended state. + SuspendJob featuregate.Feature = "SuspendJob" + + // owner: @fromanirh + // alpha: v1.21 + // + // Enable POD resources API to return allocatable resources + KubeletPodResourcesGetAllocatable featuregate.Feature = "KubeletPodResourcesGetAllocatable" + + // owner: @jayunit100 @abhiraut @rikatz + // kep: http://kep.k8s.io/2161 + // beta: v1.21 + // ga: v1.22 + // + // Labels all namespaces with a default label "kubernetes.io/metadata.name: " + NamespaceDefaultLabelName featuregate.Feature = "NamespaceDefaultLabelName" + + // owner: @fengzixu + // alpha: v1.21 + // + // Enables kubelet to detect CSI volume condition and send the event of the abnormal volume to the corresponding pod that is using it. + CSIVolumeHealth featuregate.Feature = "CSIVolumeHealth" + + // owner: @marosset + // alpha: v1.22 + // + // Enables support for 'HostProcess' containers on Windows nodes. + WindowsHostProcessContainers featuregate.Feature = "WindowsHostProcessContainers" + + // owner: @ravig + // alpha: v1.22 + // + // StatefulSetMinReadySeconds allows minReadySeconds to be respected by StatefulSet controller + StatefulSetMinReadySeconds featuregate.Feature = "StatefulSetMinReadySeconds" + + // owner: @gjkim42 + // kep: http://kep.k8s.io/2595 + // alpha: v1.22 + // + // Enables apiserver and kubelet to allow up to 32 DNSSearchPaths and up to 2048 DNSSearchListChars. + ExpandedDNSConfig featuregate.Feature = "ExpandedDNSConfig" + + // owner: @saschagrunert + // alpha: v1.22 + // + // Enables the use of `RuntimeDefault` as the default seccomp profile for all workloads. + SeccompDefault featuregate.Feature = "SeccompDefault" + + // owner: @liggitt, @tallclair, sig-auth + // alpha: v1.22 + // + // Enables the PodSecurity admission plugin + PodSecurity featuregate.Feature = "PodSecurity" + + // owner: @chrishenzie + // alpha: v1.22 + // + // Enables usage of the ReadWriteOncePod PersistentVolume access mode. + ReadWriteOncePod featuregate.Feature = "ReadWriteOncePod" + + // owner: @enj + // beta: v1.22 + // + // Allows clients to request a duration for certificates issued via the Kubernetes CSR API. + CSRDuration featuregate.Feature = "CSRDuration" + + // owner: @AkihiroSuda + // alpha: v1.22 + // + // Enables support for running kubelet in a user namespace. + // The user namespace has to be created before running kubelet. + // All the node components such as CRI need to be running in the same user namespace. + KubeletInUserNamespace featuregate.Feature = "KubeletInUserNamespace" + + // owner: @xiaoxubeii + // kep: http://kep.k8s.io/2570 + // alpha: v1.22 + // + // Enables kubelet to support memory QoS with cgroups v2. + MemoryQoS featuregate.Feature = "MemoryQoS" + + // owner: @fromanirh + // alpha: v1.22 + // + // Allow fine-tuning of cpumanager policies + CPUManagerPolicyOptions featuregate.Feature = "CPUManagerPolicyOptions" + + // owner: @jiahuif + // alpha: v1.21 + // beta: v1.22 + // + // Enables Leader Migration for kube-controller-manager and cloud-controller-manager + ControllerManagerLeaderMigration featuregate.Feature = "ControllerManagerLeaderMigration" +) + +func init() { + runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates)) +} + +// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. +// To add a new feature, define a key for it above and add it here. The features will be +// available throughout Kubernetes binaries. +var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ + AppArmor: {Default: true, PreRelease: featuregate.Beta}, + DynamicKubeletConfig: {Default: false, PreRelease: featuregate.Deprecated}, // feature gate is deprecated in 1.22, remove no early than 1.23 + ExperimentalHostUserNamespaceDefaultingGate: {Default: false, PreRelease: featuregate.Beta}, + DevicePlugins: {Default: true, PreRelease: featuregate.Beta}, + RotateKubeletServerCertificate: {Default: true, PreRelease: featuregate.Beta}, + LocalStorageCapacityIsolation: {Default: true, PreRelease: featuregate.Beta}, + Sysctls: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + EphemeralContainers: {Default: false, PreRelease: featuregate.Alpha}, + QOSReserved: {Default: false, PreRelease: featuregate.Alpha}, + ExpandPersistentVolumes: {Default: true, PreRelease: featuregate.Beta}, + ExpandInUsePersistentVolumes: {Default: true, PreRelease: featuregate.Beta}, + ExpandCSIVolumes: {Default: true, PreRelease: featuregate.Beta}, + CPUManager: {Default: true, PreRelease: featuregate.Beta}, + MemoryManager: {Default: true, PreRelease: featuregate.Beta}, + CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha}, + TopologyManager: {Default: true, PreRelease: featuregate.Beta}, + StorageObjectInUseProtection: {Default: true, PreRelease: featuregate.GA}, + SupportPodPidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + SupportNodePidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + BoundServiceAccountTokenVolume: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + ServiceAccountIssuerDiscovery: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 + CSIMigration: {Default: true, PreRelease: featuregate.Beta}, + CSIMigrationGCE: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires GCE PD CSI Driver) + InTreePluginGCEUnregister: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationAWS: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires AWS EBS CSI driver) + InTreePluginAWSUnregister: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationAzureDisk: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires Azure Disk CSI driver) + InTreePluginAzureDiskUnregister: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationAzureFile: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires Azure File CSI driver) + InTreePluginAzureFileUnregister: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationvSphere: {Default: false, PreRelease: featuregate.Beta}, // Off by default (requires vSphere CSI driver) + InTreePluginvSphereUnregister: {Default: false, PreRelease: featuregate.Alpha}, + CSIMigrationOpenStack: {Default: true, PreRelease: featuregate.Beta}, + InTreePluginOpenStackUnregister: {Default: false, PreRelease: featuregate.Alpha}, + VolumeSubpath: {Default: true, PreRelease: featuregate.GA}, + ConfigurableFSGroupPolicy: {Default: true, PreRelease: featuregate.Beta}, + CSIInlineVolume: {Default: true, PreRelease: featuregate.Beta}, + CSIStorageCapacity: {Default: true, PreRelease: featuregate.Beta}, + CSIServiceAccountToken: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + GenericEphemeralVolume: {Default: true, PreRelease: featuregate.Beta}, + CSIVolumeFSGroupPolicy: {Default: true, PreRelease: featuregate.Beta}, + RuntimeClass: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + NodeLease: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, + NetworkPolicyEndPort: {Default: true, PreRelease: featuregate.Beta}, + ProcMountType: {Default: false, PreRelease: featuregate.Alpha}, + TTLAfterFinished: {Default: true, PreRelease: featuregate.Beta}, + IndexedJob: {Default: true, PreRelease: featuregate.Beta}, + JobTrackingWithFinalizers: {Default: false, PreRelease: featuregate.Alpha}, + KubeletPodResources: {Default: true, PreRelease: featuregate.Beta}, + LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha}, + NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta}, + PodOverhead: {Default: true, PreRelease: featuregate.Beta}, + IPv6DualStack: {Default: true, PreRelease: featuregate.Beta}, + EndpointSlice: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 + EndpointSliceProxying: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 + EndpointSliceTerminatingCondition: {Default: true, PreRelease: featuregate.Beta}, + ProxyTerminatingEndpoints: {Default: false, PreRelease: featuregate.Alpha}, + EndpointSliceNodeName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, //remove in 1.25 + WindowsEndpointSliceProxying: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 + StartupProbe: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + AllowInsecureBackendProxy: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + PodDisruptionBudget: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.25 + CronJobControllerV2: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + DaemonSetUpdateSurge: {Default: true, PreRelease: featuregate.Beta}, // on by default in 1.22 + ImmutableEphemeralVolumes: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 + HugePageStorageMediumSize: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.23 + DownwardAPIHugePages: {Default: false, PreRelease: featuregate.Beta}, // on by default in 1.22 + AnyVolumeDataSource: {Default: false, PreRelease: featuregate.Alpha}, + DefaultPodTopologySpread: {Default: true, PreRelease: featuregate.Beta}, + SetHostnameAsFQDN: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, //remove in 1.24 + WinOverlay: {Default: true, PreRelease: featuregate.Beta}, + WinDSR: {Default: false, PreRelease: featuregate.Alpha}, + DisableAcceleratorUsageMetrics: {Default: true, PreRelease: featuregate.Beta}, + HPAContainerMetrics: {Default: false, PreRelease: featuregate.Alpha}, + SizeMemoryBackedVolumes: {Default: true, PreRelease: featuregate.Beta}, + ExecProbeTimeout: {Default: true, PreRelease: featuregate.GA}, // lock to default and remove after v1.22 based on KEP #1972 update + KubeletCredentialProviders: {Default: false, PreRelease: featuregate.Alpha}, + GracefulNodeShutdown: {Default: true, PreRelease: featuregate.Beta}, + ServiceLBNodePortControl: {Default: true, PreRelease: featuregate.Beta}, + MixedProtocolLBService: {Default: false, PreRelease: featuregate.Alpha}, + VolumeCapacityPriority: {Default: false, PreRelease: featuregate.Alpha}, + PreferNominatedNode: {Default: true, PreRelease: featuregate.Beta}, + ProbeTerminationGracePeriod: {Default: false, PreRelease: featuregate.Beta}, // Default to false in beta 1.22, set to true in 1.24 + NodeSwap: {Default: false, PreRelease: featuregate.Alpha}, + PodDeletionCost: {Default: true, PreRelease: featuregate.Beta}, + TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha}, + PodAffinityNamespaceSelector: {Default: true, PreRelease: featuregate.Beta}, + ServiceLoadBalancerClass: {Default: true, PreRelease: featuregate.Beta}, + IngressClassNamespacedParams: {Default: true, PreRelease: featuregate.Beta}, + ServiceInternalTrafficPolicy: {Default: true, PreRelease: featuregate.Beta}, + LogarithmicScaleDown: {Default: true, PreRelease: featuregate.Beta}, + SuspendJob: {Default: true, PreRelease: featuregate.Beta}, + KubeletPodResourcesGetAllocatable: {Default: false, PreRelease: featuregate.Alpha}, + NamespaceDefaultLabelName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 + CSIVolumeHealth: {Default: false, PreRelease: featuregate.Alpha}, + WindowsHostProcessContainers: {Default: false, PreRelease: featuregate.Alpha}, + DisableCloudProviders: {Default: false, PreRelease: featuregate.Alpha}, + StatefulSetMinReadySeconds: {Default: false, PreRelease: featuregate.Alpha}, + ExpandedDNSConfig: {Default: false, PreRelease: featuregate.Alpha}, + SeccompDefault: {Default: false, PreRelease: featuregate.Alpha}, + PodSecurity: {Default: false, PreRelease: featuregate.Alpha}, + ReadWriteOncePod: {Default: false, PreRelease: featuregate.Alpha}, + CSRDuration: {Default: true, PreRelease: featuregate.Beta}, + DelegateFSGroupToCSIDriver: {Default: false, PreRelease: featuregate.Alpha}, + KubeletInUserNamespace: {Default: false, PreRelease: featuregate.Alpha}, + MemoryQoS: {Default: false, PreRelease: featuregate.Alpha}, + CPUManagerPolicyOptions: {Default: false, PreRelease: featuregate.Alpha}, + ControllerManagerLeaderMigration: {Default: true, PreRelease: featuregate.Beta}, + + // inherited features from generic apiserver, relisted here to get a conflict if it is changed + // unintentionally on either side: + genericfeatures.StreamingProxyRedirects: {Default: false, PreRelease: featuregate.Deprecated}, // remove in 1.24 + genericfeatures.ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated}, + genericfeatures.AdvancedAuditing: {Default: true, PreRelease: featuregate.GA}, + genericfeatures.APIResponseCompression: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.APIListChunking: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.DryRun: {Default: true, PreRelease: featuregate.GA}, + genericfeatures.ServerSideApply: {Default: true, PreRelease: featuregate.GA}, + genericfeatures.APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta}, + genericfeatures.WarningHeaders: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.24 + + // features that enable backwards compatibility but are scheduled to be removed + // ... + HPAScaleToZero: {Default: false, PreRelease: featuregate.Alpha}, +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/conversion.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/conversion.go new file mode 100644 index 00000000..9a656f56 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/conversion.go @@ -0,0 +1,107 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "fmt" + "sync" + + "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/kube-scheduler/config/v1beta2" + "k8s.io/kubernetes/pkg/scheduler/apis/config" +) + +var ( + // pluginArgConversionScheme is a scheme with internal and v1beta2 registered, + // used for defaulting/converting typed PluginConfig Args. + // Access via getPluginArgConversionScheme() + pluginArgConversionScheme *runtime.Scheme + initPluginArgConversionScheme sync.Once +) + +func GetPluginArgConversionScheme() *runtime.Scheme { + initPluginArgConversionScheme.Do(func() { + // set up the scheme used for plugin arg conversion + pluginArgConversionScheme = runtime.NewScheme() + utilruntime.Must(AddToScheme(pluginArgConversionScheme)) + utilruntime.Must(config.AddToScheme(pluginArgConversionScheme)) + }) + return pluginArgConversionScheme +} + +func Convert_v1beta2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in *v1beta2.KubeSchedulerConfiguration, out *config.KubeSchedulerConfiguration, s conversion.Scope) error { + if err := autoConvert_v1beta2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in, out, s); err != nil { + return err + } + return convertToInternalPluginConfigArgs(out) +} + +// convertToInternalPluginConfigArgs converts PluginConfig#Args into internal +// types using a scheme, after applying defaults. +func convertToInternalPluginConfigArgs(out *config.KubeSchedulerConfiguration) error { + scheme := GetPluginArgConversionScheme() + for i := range out.Profiles { + prof := &out.Profiles[i] + for j := range prof.PluginConfig { + args := prof.PluginConfig[j].Args + if args == nil { + continue + } + if _, isUnknown := args.(*runtime.Unknown); isUnknown { + continue + } + internalArgs, err := scheme.ConvertToVersion(args, config.SchemeGroupVersion) + if err != nil { + return fmt.Errorf("converting .Profiles[%d].PluginConfig[%d].Args into internal type: %w", i, j, err) + } + prof.PluginConfig[j].Args = internalArgs + } + } + return nil +} + +func Convert_config_KubeSchedulerConfiguration_To_v1beta2_KubeSchedulerConfiguration(in *config.KubeSchedulerConfiguration, out *v1beta2.KubeSchedulerConfiguration, s conversion.Scope) error { + if err := autoConvert_config_KubeSchedulerConfiguration_To_v1beta2_KubeSchedulerConfiguration(in, out, s); err != nil { + return err + } + return convertToExternalPluginConfigArgs(out) +} + +// convertToExternalPluginConfigArgs converts PluginConfig#Args into +// external (versioned) types using a scheme. +func convertToExternalPluginConfigArgs(out *v1beta2.KubeSchedulerConfiguration) error { + scheme := GetPluginArgConversionScheme() + for i := range out.Profiles { + for j := range out.Profiles[i].PluginConfig { + args := out.Profiles[i].PluginConfig[j].Args + if args.Object == nil { + continue + } + if _, isUnknown := args.Object.(*runtime.Unknown); isUnknown { + continue + } + externalArgs, err := scheme.ConvertToVersion(args.Object, SchemeGroupVersion) + if err != nil { + return err + } + out.Profiles[i].PluginConfig[j].Args.Object = externalArgs + } + } + return nil +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/default_plugins.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/default_plugins.go new file mode 100644 index 00000000..1d63003a --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/default_plugins.go @@ -0,0 +1,193 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "k8s.io/apimachinery/pkg/util/sets" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/klog/v2" + "k8s.io/kube-scheduler/config/v1beta2" + "k8s.io/kubernetes/pkg/features" + "k8s.io/kubernetes/pkg/scheduler/framework/plugins/names" + "k8s.io/utils/pointer" +) + +// getDefaultPlugins returns the default set of plugins. +func getDefaultPlugins() *v1beta2.Plugins { + plugins := &v1beta2.Plugins{ + QueueSort: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.PrioritySort}, + }, + }, + PreFilter: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.NodeResourcesFit}, + {Name: names.NodePorts}, + {Name: names.VolumeRestrictions}, + {Name: names.PodTopologySpread}, + {Name: names.InterPodAffinity}, + {Name: names.VolumeBinding}, + {Name: names.NodeAffinity}, + }, + }, + Filter: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.NodeUnschedulable}, + {Name: names.NodeName}, + {Name: names.TaintToleration}, + {Name: names.NodeAffinity}, + {Name: names.NodePorts}, + {Name: names.NodeResourcesFit}, + {Name: names.VolumeRestrictions}, + {Name: names.EBSLimits}, + {Name: names.GCEPDLimits}, + {Name: names.NodeVolumeLimits}, + {Name: names.AzureDiskLimits}, + {Name: names.VolumeBinding}, + {Name: names.VolumeZone}, + {Name: names.PodTopologySpread}, + {Name: names.InterPodAffinity}, + }, + }, + PostFilter: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.DefaultPreemption}, + }, + }, + PreScore: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.InterPodAffinity}, + {Name: names.PodTopologySpread}, + {Name: names.TaintToleration}, + {Name: names.NodeAffinity}, + }, + }, + Score: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.NodeResourcesBalancedAllocation, Weight: pointer.Int32Ptr(1)}, + {Name: names.ImageLocality, Weight: pointer.Int32Ptr(1)}, + {Name: names.InterPodAffinity, Weight: pointer.Int32Ptr(1)}, + {Name: names.NodeResourcesFit, Weight: pointer.Int32Ptr(1)}, + {Name: names.NodeAffinity, Weight: pointer.Int32Ptr(1)}, + // Weight is doubled because: + // - This is a score coming from user preference. + // - It makes its signal comparable to NodeResourcesFit.LeastAllocated. + {Name: names.PodTopologySpread, Weight: pointer.Int32Ptr(2)}, + {Name: names.TaintToleration, Weight: pointer.Int32Ptr(1)}, + }, + }, + Reserve: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.VolumeBinding}, + }, + }, + PreBind: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.VolumeBinding}, + }, + }, + Bind: v1beta2.PluginSet{ + Enabled: []v1beta2.Plugin{ + {Name: names.DefaultBinder}, + }, + }, + } + applyFeatureGates(plugins) + + return plugins +} + +func applyFeatureGates(config *v1beta2.Plugins) { + if utilfeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority) { + config.Score.Enabled = append(config.Score.Enabled, v1beta2.Plugin{Name: names.VolumeBinding, Weight: pointer.Int32Ptr(1)}) + } + + if !utilfeature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) { + // When feature is enabled, the default spreading is done by + // PodTopologySpread plugin, which is enabled by default. + klog.InfoS("Registering SelectorSpread plugin") + s := v1beta2.Plugin{Name: names.SelectorSpread} + config.PreScore.Enabled = append(config.PreScore.Enabled, s) + s.Weight = pointer.Int32Ptr(1) + config.Score.Enabled = append(config.Score.Enabled, s) + } +} + +// mergePlugins merges the custom set into the given default one, handling disabled sets. +func mergePlugins(defaultPlugins, customPlugins *v1beta2.Plugins) *v1beta2.Plugins { + if customPlugins == nil { + return defaultPlugins + } + + defaultPlugins.QueueSort = mergePluginSet(defaultPlugins.QueueSort, customPlugins.QueueSort) + defaultPlugins.PreFilter = mergePluginSet(defaultPlugins.PreFilter, customPlugins.PreFilter) + defaultPlugins.Filter = mergePluginSet(defaultPlugins.Filter, customPlugins.Filter) + defaultPlugins.PostFilter = mergePluginSet(defaultPlugins.PostFilter, customPlugins.PostFilter) + defaultPlugins.PreScore = mergePluginSet(defaultPlugins.PreScore, customPlugins.PreScore) + defaultPlugins.Score = mergePluginSet(defaultPlugins.Score, customPlugins.Score) + defaultPlugins.Reserve = mergePluginSet(defaultPlugins.Reserve, customPlugins.Reserve) + defaultPlugins.Permit = mergePluginSet(defaultPlugins.Permit, customPlugins.Permit) + defaultPlugins.PreBind = mergePluginSet(defaultPlugins.PreBind, customPlugins.PreBind) + defaultPlugins.Bind = mergePluginSet(defaultPlugins.Bind, customPlugins.Bind) + defaultPlugins.PostBind = mergePluginSet(defaultPlugins.PostBind, customPlugins.PostBind) + return defaultPlugins +} + +type pluginIndex struct { + index int + plugin v1beta2.Plugin +} + +func mergePluginSet(defaultPluginSet, customPluginSet v1beta2.PluginSet) v1beta2.PluginSet { + disabledPlugins := sets.NewString() + enabledCustomPlugins := make(map[string]pluginIndex) + // replacedPluginIndex is a set of index of plugins, which have replaced the default plugins. + replacedPluginIndex := sets.NewInt() + for _, disabledPlugin := range customPluginSet.Disabled { + disabledPlugins.Insert(disabledPlugin.Name) + } + for index, enabledPlugin := range customPluginSet.Enabled { + enabledCustomPlugins[enabledPlugin.Name] = pluginIndex{index, enabledPlugin} + } + var enabledPlugins []v1beta2.Plugin + if !disabledPlugins.Has("*") { + for _, defaultEnabledPlugin := range defaultPluginSet.Enabled { + if disabledPlugins.Has(defaultEnabledPlugin.Name) { + continue + } + // The default plugin is explicitly re-configured, update the default plugin accordingly. + if customPlugin, ok := enabledCustomPlugins[defaultEnabledPlugin.Name]; ok { + klog.InfoS("Default plugin is explicitly re-configured; overriding", "plugin", defaultEnabledPlugin.Name) + // Update the default plugin in place to preserve order. + defaultEnabledPlugin = customPlugin.plugin + replacedPluginIndex.Insert(customPlugin.index) + } + enabledPlugins = append(enabledPlugins, defaultEnabledPlugin) + } + } + + // Append all the custom plugins which haven't replaced any default plugins. + // Note: duplicated custom plugins will still be appended here. + // If so, the instantiation of scheduler framework will detect it and abort. + for index, plugin := range customPluginSet.Enabled { + if !replacedPluginIndex.Has(index) { + enabledPlugins = append(enabledPlugins, plugin) + } + } + return v1beta2.PluginSet{Enabled: enabledPlugins} +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/defaults.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/defaults.go new file mode 100644 index 00000000..8d577e15 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/defaults.go @@ -0,0 +1,304 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "net" + "strconv" + + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apiserver/pkg/util/feature" + componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" + "k8s.io/kube-scheduler/config/v1beta2" + "k8s.io/kubernetes/pkg/features" + "k8s.io/kubernetes/pkg/scheduler/apis/config" + "k8s.io/utils/pointer" +) + +var defaultResourceSpec = []v1beta2.ResourceSpec{ + {Name: string(v1.ResourceCPU), Weight: 1}, + {Name: string(v1.ResourceMemory), Weight: 1}, +} + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} + +func pluginsNames(p *v1beta2.Plugins) []string { + if p == nil { + return nil + } + extensions := []v1beta2.PluginSet{ + p.PreFilter, + p.Filter, + p.PostFilter, + p.Reserve, + p.PreScore, + p.Score, + p.PreBind, + p.Bind, + p.PostBind, + p.Permit, + p.QueueSort, + } + n := sets.NewString() + for _, e := range extensions { + for _, pg := range e.Enabled { + n.Insert(pg.Name) + } + } + return n.List() +} + +func setDefaults_KubeSchedulerProfile(prof *v1beta2.KubeSchedulerProfile) { + // Set default plugins. + prof.Plugins = mergePlugins(getDefaultPlugins(), prof.Plugins) + + // Set default plugin configs. + scheme := GetPluginArgConversionScheme() + existingConfigs := sets.NewString() + for j := range prof.PluginConfig { + existingConfigs.Insert(prof.PluginConfig[j].Name) + args := prof.PluginConfig[j].Args.Object + if _, isUnknown := args.(*runtime.Unknown); isUnknown { + continue + } + scheme.Default(args) + } + + // Append default configs for plugins that didn't have one explicitly set. + for _, name := range pluginsNames(prof.Plugins) { + if existingConfigs.Has(name) { + continue + } + gvk := v1beta2.SchemeGroupVersion.WithKind(name + "Args") + args, err := scheme.New(gvk) + if err != nil { + // This plugin is out-of-tree or doesn't require configuration. + continue + } + scheme.Default(args) + args.GetObjectKind().SetGroupVersionKind(gvk) + prof.PluginConfig = append(prof.PluginConfig, v1beta2.PluginConfig{ + Name: name, + Args: runtime.RawExtension{Object: args}, + }) + } +} + +// SetDefaults_KubeSchedulerConfiguration sets additional defaults +func SetDefaults_KubeSchedulerConfiguration(obj *v1beta2.KubeSchedulerConfiguration) { + if obj.Parallelism == nil { + obj.Parallelism = pointer.Int32Ptr(16) + } + + if len(obj.Profiles) == 0 { + obj.Profiles = append(obj.Profiles, v1beta2.KubeSchedulerProfile{}) + } + // Only apply a default scheduler name when there is a single profile. + // Validation will ensure that every profile has a non-empty unique name. + if len(obj.Profiles) == 1 && obj.Profiles[0].SchedulerName == nil { + obj.Profiles[0].SchedulerName = pointer.StringPtr(v1.DefaultSchedulerName) + } + + // Add the default set of plugins and apply the configuration. + for i := range obj.Profiles { + prof := &obj.Profiles[i] + setDefaults_KubeSchedulerProfile(prof) + } + + // For Healthz and Metrics bind addresses, we want to check: + // 1. If the value is nil, default to 0.0.0.0 and default scheduler port + // 2. If there is a value set, attempt to split it. If it's just a port (ie, ":1234"), default to 0.0.0.0 with that port + // 3. If splitting the value fails, check if the value is even a valid IP. If so, use that with the default port. + // Otherwise leave the address as-is, it will be caught during validation. + defaultBindAddress := net.JoinHostPort("0.0.0.0", strconv.Itoa(config.DefaultInsecureSchedulerPort)) + if obj.HealthzBindAddress == nil { + obj.HealthzBindAddress = &defaultBindAddress + } else { + if host, port, err := net.SplitHostPort(*obj.HealthzBindAddress); err == nil { + if len(host) == 0 { + host = "0.0.0.0" + } + hostPort := net.JoinHostPort(host, port) + obj.HealthzBindAddress = &hostPort + } else { + // Something went wrong splitting the host/port, could just be a missing port so check if the + // existing value is a valid IP address. If so, use that with the default scheduler port + if host := net.ParseIP(*obj.HealthzBindAddress); host != nil { + hostPort := net.JoinHostPort(*obj.HealthzBindAddress, strconv.Itoa(config.DefaultInsecureSchedulerPort)) + obj.HealthzBindAddress = &hostPort + } + } + } + + if obj.MetricsBindAddress == nil { + obj.MetricsBindAddress = &defaultBindAddress + } else { + if host, port, err := net.SplitHostPort(*obj.MetricsBindAddress); err == nil { + if len(host) == 0 { + host = "0.0.0.0" + } + hostPort := net.JoinHostPort(host, port) + obj.MetricsBindAddress = &hostPort + } else { + // Something went wrong splitting the host/port, could just be a missing port so check if the + // existing value is a valid IP address. If so, use that with the default scheduler port + if host := net.ParseIP(*obj.MetricsBindAddress); host != nil { + hostPort := net.JoinHostPort(*obj.MetricsBindAddress, strconv.Itoa(config.DefaultInsecureSchedulerPort)) + obj.MetricsBindAddress = &hostPort + } + } + } + + if obj.PercentageOfNodesToScore == nil { + percentageOfNodesToScore := int32(config.DefaultPercentageOfNodesToScore) + obj.PercentageOfNodesToScore = &percentageOfNodesToScore + } + + if len(obj.LeaderElection.ResourceLock) == 0 { + // Use lease-based leader election to reduce cost. + // We migrated for EndpointsLease lock in 1.17 and starting in 1.20 we + // migrated to Lease lock. + obj.LeaderElection.ResourceLock = "leases" + } + if len(obj.LeaderElection.ResourceNamespace) == 0 { + obj.LeaderElection.ResourceNamespace = v1beta2.SchedulerDefaultLockObjectNamespace + } + if len(obj.LeaderElection.ResourceName) == 0 { + obj.LeaderElection.ResourceName = v1beta2.SchedulerDefaultLockObjectName + } + + if len(obj.ClientConnection.ContentType) == 0 { + obj.ClientConnection.ContentType = "application/vnd.kubernetes.protobuf" + } + // Scheduler has an opinion about QPS/Burst, setting specific defaults for itself, instead of generic settings. + if obj.ClientConnection.QPS == 0.0 { + obj.ClientConnection.QPS = 50.0 + } + if obj.ClientConnection.Burst == 0 { + obj.ClientConnection.Burst = 100 + } + + // Use the default LeaderElectionConfiguration options + componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) + + if obj.PodInitialBackoffSeconds == nil { + val := int64(1) + obj.PodInitialBackoffSeconds = &val + } + + if obj.PodMaxBackoffSeconds == nil { + val := int64(10) + obj.PodMaxBackoffSeconds = &val + } + + // Enable profiling by default in the scheduler + if obj.EnableProfiling == nil { + enableProfiling := true + obj.EnableProfiling = &enableProfiling + } + + // Enable contention profiling by default if profiling is enabled + if *obj.EnableProfiling && obj.EnableContentionProfiling == nil { + enableContentionProfiling := true + obj.EnableContentionProfiling = &enableContentionProfiling + } +} + +func SetDefaults_DefaultPreemptionArgs(obj *v1beta2.DefaultPreemptionArgs) { + if obj.MinCandidateNodesPercentage == nil { + obj.MinCandidateNodesPercentage = pointer.Int32Ptr(10) + } + if obj.MinCandidateNodesAbsolute == nil { + obj.MinCandidateNodesAbsolute = pointer.Int32Ptr(100) + } +} + +func SetDefaults_InterPodAffinityArgs(obj *v1beta2.InterPodAffinityArgs) { + // Note that an object is created manually in cmd/kube-scheduler/app/options/deprecated.go + // DeprecatedOptions#ApplyTo. + // Update that object if a new default field is added here. + if obj.HardPodAffinityWeight == nil { + obj.HardPodAffinityWeight = pointer.Int32Ptr(1) + } +} + +func SetDefaults_VolumeBindingArgs(obj *v1beta2.VolumeBindingArgs) { + if obj.BindTimeoutSeconds == nil { + obj.BindTimeoutSeconds = pointer.Int64Ptr(600) + } + if len(obj.Shape) == 0 && feature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority) { + obj.Shape = []v1beta2.UtilizationShapePoint{ + { + Utilization: 0, + Score: 0, + }, + { + Utilization: 100, + Score: int32(config.MaxCustomPriorityScore), + }, + } + } +} + +func SetDefaults_NodeResourcesBalancedAllocationArgs(obj *v1beta2.NodeResourcesBalancedAllocationArgs) { + if len(obj.Resources) == 0 { + obj.Resources = append(obj.Resources, + v1beta2.ResourceSpec{Name: string(v1.ResourceCPU), Weight: 1}, + v1beta2.ResourceSpec{Name: string(v1.ResourceMemory), Weight: 1}, + ) + } + // If the weight is not set or it is explicitly set to 0, then apply the default weight(1) instead. + for i := range obj.Resources { + if obj.Resources[i].Weight == 0 { + obj.Resources[i].Weight = 1 + } + } +} + +func SetDefaults_PodTopologySpreadArgs(obj *v1beta2.PodTopologySpreadArgs) { + if feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) { + if obj.DefaultingType == "" { + obj.DefaultingType = v1beta2.SystemDefaulting + } + return + } + if obj.DefaultingType == "" { + obj.DefaultingType = v1beta2.ListDefaulting + } +} + +func SetDefaults_NodeResourcesFitArgs(obj *v1beta2.NodeResourcesFitArgs) { + if obj.ScoringStrategy == nil { + obj.ScoringStrategy = &v1beta2.ScoringStrategy{ + Type: v1beta2.ScoringStrategyType(config.LeastAllocated), + Resources: defaultResourceSpec, + } + } + if len(obj.ScoringStrategy.Resources) == 0 { + // If no resources specified, use the default set. + obj.ScoringStrategy.Resources = append(obj.ScoringStrategy.Resources, defaultResourceSpec...) + } + for i := range obj.ScoringStrategy.Resources { + if obj.ScoringStrategy.Resources[i].Weight == 0 { + obj.ScoringStrategy.Resources[i].Weight = 1 + } + } +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/doc.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/doc.go new file mode 100644 index 00000000..bc0f1a69 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:conversion-gen=k8s.io/kubernetes/pkg/scheduler/apis/config +// +k8s:conversion-gen-external-types=k8s.io/kube-scheduler/config/v1beta2 +// +k8s:defaulter-gen=TypeMeta +// +k8s:defaulter-gen-input=../../../../../vendor/k8s.io/kube-scheduler/config/v1beta2 +// +groupName=kubescheduler.config.k8s.io + +package v1beta2 // import "k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2" diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/register.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/register.go new file mode 100644 index 00000000..b8ca76de --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/register.go @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "k8s.io/kube-scheduler/config/v1beta2" +) + +// GroupName is the group name used in this package +const GroupName = v1beta2.GroupName + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = v1beta2.SchemeGroupVersion + +var ( + // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, + // defaulting and conversion init funcs are registered as well. + localSchemeBuilder = &v1beta2.SchemeBuilder + // AddToScheme is a global function that registers this API group & version to a scheme + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addDefaultingFuncs) +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.conversion.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.conversion.go new file mode 100644 index 00000000..c66b8ec6 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.conversion.go @@ -0,0 +1,868 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1beta2 + +import ( + unsafe "unsafe" + + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha1 "k8s.io/component-base/config/v1alpha1" + configv1 "k8s.io/kube-scheduler/config/v1" + v1beta2 "k8s.io/kube-scheduler/config/v1beta2" + config "k8s.io/kubernetes/pkg/scheduler/apis/config" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*v1beta2.DefaultPreemptionArgs)(nil), (*config.DefaultPreemptionArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_DefaultPreemptionArgs_To_config_DefaultPreemptionArgs(a.(*v1beta2.DefaultPreemptionArgs), b.(*config.DefaultPreemptionArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.DefaultPreemptionArgs)(nil), (*v1beta2.DefaultPreemptionArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_DefaultPreemptionArgs_To_v1beta2_DefaultPreemptionArgs(a.(*config.DefaultPreemptionArgs), b.(*v1beta2.DefaultPreemptionArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Extender)(nil), (*config.Extender)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Extender_To_config_Extender(a.(*v1beta2.Extender), b.(*config.Extender), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.Extender)(nil), (*v1beta2.Extender)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_Extender_To_v1beta2_Extender(a.(*config.Extender), b.(*v1beta2.Extender), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.InterPodAffinityArgs)(nil), (*config.InterPodAffinityArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_InterPodAffinityArgs_To_config_InterPodAffinityArgs(a.(*v1beta2.InterPodAffinityArgs), b.(*config.InterPodAffinityArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.InterPodAffinityArgs)(nil), (*v1beta2.InterPodAffinityArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_InterPodAffinityArgs_To_v1beta2_InterPodAffinityArgs(a.(*config.InterPodAffinityArgs), b.(*v1beta2.InterPodAffinityArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.KubeSchedulerProfile)(nil), (*config.KubeSchedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile(a.(*v1beta2.KubeSchedulerProfile), b.(*config.KubeSchedulerProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.KubeSchedulerProfile)(nil), (*v1beta2.KubeSchedulerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile(a.(*config.KubeSchedulerProfile), b.(*v1beta2.KubeSchedulerProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.NodeAffinityArgs)(nil), (*config.NodeAffinityArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NodeAffinityArgs_To_config_NodeAffinityArgs(a.(*v1beta2.NodeAffinityArgs), b.(*config.NodeAffinityArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.NodeAffinityArgs)(nil), (*v1beta2.NodeAffinityArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_NodeAffinityArgs_To_v1beta2_NodeAffinityArgs(a.(*config.NodeAffinityArgs), b.(*v1beta2.NodeAffinityArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.NodeResourcesBalancedAllocationArgs)(nil), (*config.NodeResourcesBalancedAllocationArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NodeResourcesBalancedAllocationArgs_To_config_NodeResourcesBalancedAllocationArgs(a.(*v1beta2.NodeResourcesBalancedAllocationArgs), b.(*config.NodeResourcesBalancedAllocationArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.NodeResourcesBalancedAllocationArgs)(nil), (*v1beta2.NodeResourcesBalancedAllocationArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_NodeResourcesBalancedAllocationArgs_To_v1beta2_NodeResourcesBalancedAllocationArgs(a.(*config.NodeResourcesBalancedAllocationArgs), b.(*v1beta2.NodeResourcesBalancedAllocationArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.NodeResourcesFitArgs)(nil), (*config.NodeResourcesFitArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NodeResourcesFitArgs_To_config_NodeResourcesFitArgs(a.(*v1beta2.NodeResourcesFitArgs), b.(*config.NodeResourcesFitArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.NodeResourcesFitArgs)(nil), (*v1beta2.NodeResourcesFitArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_NodeResourcesFitArgs_To_v1beta2_NodeResourcesFitArgs(a.(*config.NodeResourcesFitArgs), b.(*v1beta2.NodeResourcesFitArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Plugin)(nil), (*config.Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Plugin_To_config_Plugin(a.(*v1beta2.Plugin), b.(*config.Plugin), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.Plugin)(nil), (*v1beta2.Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_Plugin_To_v1beta2_Plugin(a.(*config.Plugin), b.(*v1beta2.Plugin), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PluginConfig)(nil), (*config.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PluginConfig_To_config_PluginConfig(a.(*v1beta2.PluginConfig), b.(*config.PluginConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.PluginConfig)(nil), (*v1beta2.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_PluginConfig_To_v1beta2_PluginConfig(a.(*config.PluginConfig), b.(*v1beta2.PluginConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PluginSet)(nil), (*config.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PluginSet_To_config_PluginSet(a.(*v1beta2.PluginSet), b.(*config.PluginSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.PluginSet)(nil), (*v1beta2.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_PluginSet_To_v1beta2_PluginSet(a.(*config.PluginSet), b.(*v1beta2.PluginSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Plugins)(nil), (*config.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Plugins_To_config_Plugins(a.(*v1beta2.Plugins), b.(*config.Plugins), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.Plugins)(nil), (*v1beta2.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_Plugins_To_v1beta2_Plugins(a.(*config.Plugins), b.(*v1beta2.Plugins), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PodTopologySpreadArgs)(nil), (*config.PodTopologySpreadArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(a.(*v1beta2.PodTopologySpreadArgs), b.(*config.PodTopologySpreadArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.PodTopologySpreadArgs)(nil), (*v1beta2.PodTopologySpreadArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_PodTopologySpreadArgs_To_v1beta2_PodTopologySpreadArgs(a.(*config.PodTopologySpreadArgs), b.(*v1beta2.PodTopologySpreadArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.RequestedToCapacityRatioParam)(nil), (*config.RequestedToCapacityRatioParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_RequestedToCapacityRatioParam_To_config_RequestedToCapacityRatioParam(a.(*v1beta2.RequestedToCapacityRatioParam), b.(*config.RequestedToCapacityRatioParam), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.RequestedToCapacityRatioParam)(nil), (*v1beta2.RequestedToCapacityRatioParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_RequestedToCapacityRatioParam_To_v1beta2_RequestedToCapacityRatioParam(a.(*config.RequestedToCapacityRatioParam), b.(*v1beta2.RequestedToCapacityRatioParam), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ResourceSpec)(nil), (*config.ResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ResourceSpec_To_config_ResourceSpec(a.(*v1beta2.ResourceSpec), b.(*config.ResourceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.ResourceSpec)(nil), (*v1beta2.ResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_ResourceSpec_To_v1beta2_ResourceSpec(a.(*config.ResourceSpec), b.(*v1beta2.ResourceSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ScoringStrategy)(nil), (*config.ScoringStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(a.(*v1beta2.ScoringStrategy), b.(*config.ScoringStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.ScoringStrategy)(nil), (*v1beta2.ScoringStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(a.(*config.ScoringStrategy), b.(*v1beta2.ScoringStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.UtilizationShapePoint)(nil), (*config.UtilizationShapePoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_UtilizationShapePoint_To_config_UtilizationShapePoint(a.(*v1beta2.UtilizationShapePoint), b.(*config.UtilizationShapePoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.UtilizationShapePoint)(nil), (*v1beta2.UtilizationShapePoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_UtilizationShapePoint_To_v1beta2_UtilizationShapePoint(a.(*config.UtilizationShapePoint), b.(*v1beta2.UtilizationShapePoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.VolumeBindingArgs)(nil), (*config.VolumeBindingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_VolumeBindingArgs_To_config_VolumeBindingArgs(a.(*v1beta2.VolumeBindingArgs), b.(*config.VolumeBindingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.VolumeBindingArgs)(nil), (*v1beta2.VolumeBindingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_VolumeBindingArgs_To_v1beta2_VolumeBindingArgs(a.(*config.VolumeBindingArgs), b.(*v1beta2.VolumeBindingArgs), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*config.KubeSchedulerConfiguration)(nil), (*v1beta2.KubeSchedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_KubeSchedulerConfiguration_To_v1beta2_KubeSchedulerConfiguration(a.(*config.KubeSchedulerConfiguration), b.(*v1beta2.KubeSchedulerConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.KubeSchedulerConfiguration)(nil), (*config.KubeSchedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(a.(*v1beta2.KubeSchedulerConfiguration), b.(*config.KubeSchedulerConfiguration), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta2_DefaultPreemptionArgs_To_config_DefaultPreemptionArgs(in *v1beta2.DefaultPreemptionArgs, out *config.DefaultPreemptionArgs, s conversion.Scope) error { + if err := v1.Convert_Pointer_int32_To_int32(&in.MinCandidateNodesPercentage, &out.MinCandidateNodesPercentage, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.MinCandidateNodesAbsolute, &out.MinCandidateNodesAbsolute, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_DefaultPreemptionArgs_To_config_DefaultPreemptionArgs is an autogenerated conversion function. +func Convert_v1beta2_DefaultPreemptionArgs_To_config_DefaultPreemptionArgs(in *v1beta2.DefaultPreemptionArgs, out *config.DefaultPreemptionArgs, s conversion.Scope) error { + return autoConvert_v1beta2_DefaultPreemptionArgs_To_config_DefaultPreemptionArgs(in, out, s) +} + +func autoConvert_config_DefaultPreemptionArgs_To_v1beta2_DefaultPreemptionArgs(in *config.DefaultPreemptionArgs, out *v1beta2.DefaultPreemptionArgs, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.MinCandidateNodesPercentage, &out.MinCandidateNodesPercentage, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.MinCandidateNodesAbsolute, &out.MinCandidateNodesAbsolute, s); err != nil { + return err + } + return nil +} + +// Convert_config_DefaultPreemptionArgs_To_v1beta2_DefaultPreemptionArgs is an autogenerated conversion function. +func Convert_config_DefaultPreemptionArgs_To_v1beta2_DefaultPreemptionArgs(in *config.DefaultPreemptionArgs, out *v1beta2.DefaultPreemptionArgs, s conversion.Scope) error { + return autoConvert_config_DefaultPreemptionArgs_To_v1beta2_DefaultPreemptionArgs(in, out, s) +} + +func autoConvert_v1beta2_Extender_To_config_Extender(in *v1beta2.Extender, out *config.Extender, s conversion.Scope) error { + out.URLPrefix = in.URLPrefix + out.FilterVerb = in.FilterVerb + out.PreemptVerb = in.PreemptVerb + out.PrioritizeVerb = in.PrioritizeVerb + out.Weight = in.Weight + out.BindVerb = in.BindVerb + out.EnableHTTPS = in.EnableHTTPS + out.TLSConfig = (*config.ExtenderTLSConfig)(unsafe.Pointer(in.TLSConfig)) + out.HTTPTimeout = in.HTTPTimeout + out.NodeCacheCapable = in.NodeCacheCapable + out.ManagedResources = *(*[]config.ExtenderManagedResource)(unsafe.Pointer(&in.ManagedResources)) + out.Ignorable = in.Ignorable + return nil +} + +// Convert_v1beta2_Extender_To_config_Extender is an autogenerated conversion function. +func Convert_v1beta2_Extender_To_config_Extender(in *v1beta2.Extender, out *config.Extender, s conversion.Scope) error { + return autoConvert_v1beta2_Extender_To_config_Extender(in, out, s) +} + +func autoConvert_config_Extender_To_v1beta2_Extender(in *config.Extender, out *v1beta2.Extender, s conversion.Scope) error { + out.URLPrefix = in.URLPrefix + out.FilterVerb = in.FilterVerb + out.PreemptVerb = in.PreemptVerb + out.PrioritizeVerb = in.PrioritizeVerb + out.Weight = in.Weight + out.BindVerb = in.BindVerb + out.EnableHTTPS = in.EnableHTTPS + out.TLSConfig = (*configv1.ExtenderTLSConfig)(unsafe.Pointer(in.TLSConfig)) + out.HTTPTimeout = in.HTTPTimeout + out.NodeCacheCapable = in.NodeCacheCapable + out.ManagedResources = *(*[]configv1.ExtenderManagedResource)(unsafe.Pointer(&in.ManagedResources)) + out.Ignorable = in.Ignorable + return nil +} + +// Convert_config_Extender_To_v1beta2_Extender is an autogenerated conversion function. +func Convert_config_Extender_To_v1beta2_Extender(in *config.Extender, out *v1beta2.Extender, s conversion.Scope) error { + return autoConvert_config_Extender_To_v1beta2_Extender(in, out, s) +} + +func autoConvert_v1beta2_InterPodAffinityArgs_To_config_InterPodAffinityArgs(in *v1beta2.InterPodAffinityArgs, out *config.InterPodAffinityArgs, s conversion.Scope) error { + if err := v1.Convert_Pointer_int32_To_int32(&in.HardPodAffinityWeight, &out.HardPodAffinityWeight, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_InterPodAffinityArgs_To_config_InterPodAffinityArgs is an autogenerated conversion function. +func Convert_v1beta2_InterPodAffinityArgs_To_config_InterPodAffinityArgs(in *v1beta2.InterPodAffinityArgs, out *config.InterPodAffinityArgs, s conversion.Scope) error { + return autoConvert_v1beta2_InterPodAffinityArgs_To_config_InterPodAffinityArgs(in, out, s) +} + +func autoConvert_config_InterPodAffinityArgs_To_v1beta2_InterPodAffinityArgs(in *config.InterPodAffinityArgs, out *v1beta2.InterPodAffinityArgs, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.HardPodAffinityWeight, &out.HardPodAffinityWeight, s); err != nil { + return err + } + return nil +} + +// Convert_config_InterPodAffinityArgs_To_v1beta2_InterPodAffinityArgs is an autogenerated conversion function. +func Convert_config_InterPodAffinityArgs_To_v1beta2_InterPodAffinityArgs(in *config.InterPodAffinityArgs, out *v1beta2.InterPodAffinityArgs, s conversion.Scope) error { + return autoConvert_config_InterPodAffinityArgs_To_v1beta2_InterPodAffinityArgs(in, out, s) +} + +func autoConvert_v1beta2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in *v1beta2.KubeSchedulerConfiguration, out *config.KubeSchedulerConfiguration, s conversion.Scope) error { + if err := v1.Convert_Pointer_int32_To_int32(&in.Parallelism, &out.Parallelism, s); err != nil { + return err + } + if err := v1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + return err + } + if err := v1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.HealthzBindAddress, &out.HealthzBindAddress, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.MetricsBindAddress, &out.MetricsBindAddress, s); err != nil { + return err + } + if err := v1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.PercentageOfNodesToScore, &out.PercentageOfNodesToScore, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int64_To_int64(&in.PodInitialBackoffSeconds, &out.PodInitialBackoffSeconds, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int64_To_int64(&in.PodMaxBackoffSeconds, &out.PodMaxBackoffSeconds, s); err != nil { + return err + } + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]config.KubeSchedulerProfile, len(*in)) + for i := range *in { + if err := Convert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Profiles = nil + } + out.Extenders = *(*[]config.Extender)(unsafe.Pointer(&in.Extenders)) + return nil +} + +func autoConvert_config_KubeSchedulerConfiguration_To_v1beta2_KubeSchedulerConfiguration(in *config.KubeSchedulerConfiguration, out *v1beta2.KubeSchedulerConfiguration, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.Parallelism, &out.Parallelism, s); err != nil { + return err + } + if err := v1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { + return err + } + if err := v1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.HealthzBindAddress, &out.HealthzBindAddress, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.MetricsBindAddress, &out.MetricsBindAddress, s); err != nil { + return err + } + if err := v1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.DebuggingConfiguration, &out.DebuggingConfiguration, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.PercentageOfNodesToScore, &out.PercentageOfNodesToScore, s); err != nil { + return err + } + if err := v1.Convert_int64_To_Pointer_int64(&in.PodInitialBackoffSeconds, &out.PodInitialBackoffSeconds, s); err != nil { + return err + } + if err := v1.Convert_int64_To_Pointer_int64(&in.PodMaxBackoffSeconds, &out.PodMaxBackoffSeconds, s); err != nil { + return err + } + if in.Profiles != nil { + in, out := &in.Profiles, &out.Profiles + *out = make([]v1beta2.KubeSchedulerProfile, len(*in)) + for i := range *in { + if err := Convert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Profiles = nil + } + out.Extenders = *(*[]v1beta2.Extender)(unsafe.Pointer(&in.Extenders)) + return nil +} + +func autoConvert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile(in *v1beta2.KubeSchedulerProfile, out *config.KubeSchedulerProfile, s conversion.Scope) error { + if err := v1.Convert_Pointer_string_To_string(&in.SchedulerName, &out.SchedulerName, s); err != nil { + return err + } + if in.Plugins != nil { + in, out := &in.Plugins, &out.Plugins + *out = new(config.Plugins) + if err := Convert_v1beta2_Plugins_To_config_Plugins(*in, *out, s); err != nil { + return err + } + } else { + out.Plugins = nil + } + if in.PluginConfig != nil { + in, out := &in.PluginConfig, &out.PluginConfig + *out = make([]config.PluginConfig, len(*in)) + for i := range *in { + if err := Convert_v1beta2_PluginConfig_To_config_PluginConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.PluginConfig = nil + } + return nil +} + +// Convert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile is an autogenerated conversion function. +func Convert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile(in *v1beta2.KubeSchedulerProfile, out *config.KubeSchedulerProfile, s conversion.Scope) error { + return autoConvert_v1beta2_KubeSchedulerProfile_To_config_KubeSchedulerProfile(in, out, s) +} + +func autoConvert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile(in *config.KubeSchedulerProfile, out *v1beta2.KubeSchedulerProfile, s conversion.Scope) error { + if err := v1.Convert_string_To_Pointer_string(&in.SchedulerName, &out.SchedulerName, s); err != nil { + return err + } + if in.Plugins != nil { + in, out := &in.Plugins, &out.Plugins + *out = new(v1beta2.Plugins) + if err := Convert_config_Plugins_To_v1beta2_Plugins(*in, *out, s); err != nil { + return err + } + } else { + out.Plugins = nil + } + if in.PluginConfig != nil { + in, out := &in.PluginConfig, &out.PluginConfig + *out = make([]v1beta2.PluginConfig, len(*in)) + for i := range *in { + if err := Convert_config_PluginConfig_To_v1beta2_PluginConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.PluginConfig = nil + } + return nil +} + +// Convert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile is an autogenerated conversion function. +func Convert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile(in *config.KubeSchedulerProfile, out *v1beta2.KubeSchedulerProfile, s conversion.Scope) error { + return autoConvert_config_KubeSchedulerProfile_To_v1beta2_KubeSchedulerProfile(in, out, s) +} + +func autoConvert_v1beta2_NodeAffinityArgs_To_config_NodeAffinityArgs(in *v1beta2.NodeAffinityArgs, out *config.NodeAffinityArgs, s conversion.Scope) error { + out.AddedAffinity = (*corev1.NodeAffinity)(unsafe.Pointer(in.AddedAffinity)) + return nil +} + +// Convert_v1beta2_NodeAffinityArgs_To_config_NodeAffinityArgs is an autogenerated conversion function. +func Convert_v1beta2_NodeAffinityArgs_To_config_NodeAffinityArgs(in *v1beta2.NodeAffinityArgs, out *config.NodeAffinityArgs, s conversion.Scope) error { + return autoConvert_v1beta2_NodeAffinityArgs_To_config_NodeAffinityArgs(in, out, s) +} + +func autoConvert_config_NodeAffinityArgs_To_v1beta2_NodeAffinityArgs(in *config.NodeAffinityArgs, out *v1beta2.NodeAffinityArgs, s conversion.Scope) error { + out.AddedAffinity = (*corev1.NodeAffinity)(unsafe.Pointer(in.AddedAffinity)) + return nil +} + +// Convert_config_NodeAffinityArgs_To_v1beta2_NodeAffinityArgs is an autogenerated conversion function. +func Convert_config_NodeAffinityArgs_To_v1beta2_NodeAffinityArgs(in *config.NodeAffinityArgs, out *v1beta2.NodeAffinityArgs, s conversion.Scope) error { + return autoConvert_config_NodeAffinityArgs_To_v1beta2_NodeAffinityArgs(in, out, s) +} + +func autoConvert_v1beta2_NodeResourcesBalancedAllocationArgs_To_config_NodeResourcesBalancedAllocationArgs(in *v1beta2.NodeResourcesBalancedAllocationArgs, out *config.NodeResourcesBalancedAllocationArgs, s conversion.Scope) error { + out.Resources = *(*[]config.ResourceSpec)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_v1beta2_NodeResourcesBalancedAllocationArgs_To_config_NodeResourcesBalancedAllocationArgs is an autogenerated conversion function. +func Convert_v1beta2_NodeResourcesBalancedAllocationArgs_To_config_NodeResourcesBalancedAllocationArgs(in *v1beta2.NodeResourcesBalancedAllocationArgs, out *config.NodeResourcesBalancedAllocationArgs, s conversion.Scope) error { + return autoConvert_v1beta2_NodeResourcesBalancedAllocationArgs_To_config_NodeResourcesBalancedAllocationArgs(in, out, s) +} + +func autoConvert_config_NodeResourcesBalancedAllocationArgs_To_v1beta2_NodeResourcesBalancedAllocationArgs(in *config.NodeResourcesBalancedAllocationArgs, out *v1beta2.NodeResourcesBalancedAllocationArgs, s conversion.Scope) error { + out.Resources = *(*[]v1beta2.ResourceSpec)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_config_NodeResourcesBalancedAllocationArgs_To_v1beta2_NodeResourcesBalancedAllocationArgs is an autogenerated conversion function. +func Convert_config_NodeResourcesBalancedAllocationArgs_To_v1beta2_NodeResourcesBalancedAllocationArgs(in *config.NodeResourcesBalancedAllocationArgs, out *v1beta2.NodeResourcesBalancedAllocationArgs, s conversion.Scope) error { + return autoConvert_config_NodeResourcesBalancedAllocationArgs_To_v1beta2_NodeResourcesBalancedAllocationArgs(in, out, s) +} + +func autoConvert_v1beta2_NodeResourcesFitArgs_To_config_NodeResourcesFitArgs(in *v1beta2.NodeResourcesFitArgs, out *config.NodeResourcesFitArgs, s conversion.Scope) error { + out.IgnoredResources = *(*[]string)(unsafe.Pointer(&in.IgnoredResources)) + out.IgnoredResourceGroups = *(*[]string)(unsafe.Pointer(&in.IgnoredResourceGroups)) + out.ScoringStrategy = (*config.ScoringStrategy)(unsafe.Pointer(in.ScoringStrategy)) + return nil +} + +// Convert_v1beta2_NodeResourcesFitArgs_To_config_NodeResourcesFitArgs is an autogenerated conversion function. +func Convert_v1beta2_NodeResourcesFitArgs_To_config_NodeResourcesFitArgs(in *v1beta2.NodeResourcesFitArgs, out *config.NodeResourcesFitArgs, s conversion.Scope) error { + return autoConvert_v1beta2_NodeResourcesFitArgs_To_config_NodeResourcesFitArgs(in, out, s) +} + +func autoConvert_config_NodeResourcesFitArgs_To_v1beta2_NodeResourcesFitArgs(in *config.NodeResourcesFitArgs, out *v1beta2.NodeResourcesFitArgs, s conversion.Scope) error { + out.IgnoredResources = *(*[]string)(unsafe.Pointer(&in.IgnoredResources)) + out.IgnoredResourceGroups = *(*[]string)(unsafe.Pointer(&in.IgnoredResourceGroups)) + out.ScoringStrategy = (*v1beta2.ScoringStrategy)(unsafe.Pointer(in.ScoringStrategy)) + return nil +} + +// Convert_config_NodeResourcesFitArgs_To_v1beta2_NodeResourcesFitArgs is an autogenerated conversion function. +func Convert_config_NodeResourcesFitArgs_To_v1beta2_NodeResourcesFitArgs(in *config.NodeResourcesFitArgs, out *v1beta2.NodeResourcesFitArgs, s conversion.Scope) error { + return autoConvert_config_NodeResourcesFitArgs_To_v1beta2_NodeResourcesFitArgs(in, out, s) +} + +func autoConvert_v1beta2_Plugin_To_config_Plugin(in *v1beta2.Plugin, out *config.Plugin, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_Pointer_int32_To_int32(&in.Weight, &out.Weight, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_Plugin_To_config_Plugin is an autogenerated conversion function. +func Convert_v1beta2_Plugin_To_config_Plugin(in *v1beta2.Plugin, out *config.Plugin, s conversion.Scope) error { + return autoConvert_v1beta2_Plugin_To_config_Plugin(in, out, s) +} + +func autoConvert_config_Plugin_To_v1beta2_Plugin(in *config.Plugin, out *v1beta2.Plugin, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_int32_To_Pointer_int32(&in.Weight, &out.Weight, s); err != nil { + return err + } + return nil +} + +// Convert_config_Plugin_To_v1beta2_Plugin is an autogenerated conversion function. +func Convert_config_Plugin_To_v1beta2_Plugin(in *config.Plugin, out *v1beta2.Plugin, s conversion.Scope) error { + return autoConvert_config_Plugin_To_v1beta2_Plugin(in, out, s) +} + +func autoConvert_v1beta2_PluginConfig_To_config_PluginConfig(in *v1beta2.PluginConfig, out *config.PluginConfig, s conversion.Scope) error { + out.Name = in.Name + if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Args, &out.Args, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_PluginConfig_To_config_PluginConfig is an autogenerated conversion function. +func Convert_v1beta2_PluginConfig_To_config_PluginConfig(in *v1beta2.PluginConfig, out *config.PluginConfig, s conversion.Scope) error { + return autoConvert_v1beta2_PluginConfig_To_config_PluginConfig(in, out, s) +} + +func autoConvert_config_PluginConfig_To_v1beta2_PluginConfig(in *config.PluginConfig, out *v1beta2.PluginConfig, s conversion.Scope) error { + out.Name = in.Name + if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Args, &out.Args, s); err != nil { + return err + } + return nil +} + +// Convert_config_PluginConfig_To_v1beta2_PluginConfig is an autogenerated conversion function. +func Convert_config_PluginConfig_To_v1beta2_PluginConfig(in *config.PluginConfig, out *v1beta2.PluginConfig, s conversion.Scope) error { + return autoConvert_config_PluginConfig_To_v1beta2_PluginConfig(in, out, s) +} + +func autoConvert_v1beta2_PluginSet_To_config_PluginSet(in *v1beta2.PluginSet, out *config.PluginSet, s conversion.Scope) error { + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = make([]config.Plugin, len(*in)) + for i := range *in { + if err := Convert_v1beta2_Plugin_To_config_Plugin(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Enabled = nil + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = make([]config.Plugin, len(*in)) + for i := range *in { + if err := Convert_v1beta2_Plugin_To_config_Plugin(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Disabled = nil + } + return nil +} + +// Convert_v1beta2_PluginSet_To_config_PluginSet is an autogenerated conversion function. +func Convert_v1beta2_PluginSet_To_config_PluginSet(in *v1beta2.PluginSet, out *config.PluginSet, s conversion.Scope) error { + return autoConvert_v1beta2_PluginSet_To_config_PluginSet(in, out, s) +} + +func autoConvert_config_PluginSet_To_v1beta2_PluginSet(in *config.PluginSet, out *v1beta2.PluginSet, s conversion.Scope) error { + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = make([]v1beta2.Plugin, len(*in)) + for i := range *in { + if err := Convert_config_Plugin_To_v1beta2_Plugin(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Enabled = nil + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = make([]v1beta2.Plugin, len(*in)) + for i := range *in { + if err := Convert_config_Plugin_To_v1beta2_Plugin(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Disabled = nil + } + return nil +} + +// Convert_config_PluginSet_To_v1beta2_PluginSet is an autogenerated conversion function. +func Convert_config_PluginSet_To_v1beta2_PluginSet(in *config.PluginSet, out *v1beta2.PluginSet, s conversion.Scope) error { + return autoConvert_config_PluginSet_To_v1beta2_PluginSet(in, out, s) +} + +func autoConvert_v1beta2_Plugins_To_config_Plugins(in *v1beta2.Plugins, out *config.Plugins, s conversion.Scope) error { + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.QueueSort, &out.QueueSort, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.PreFilter, &out.PreFilter, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.Filter, &out.Filter, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.PostFilter, &out.PostFilter, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.PreScore, &out.PreScore, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.Score, &out.Score, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.Reserve, &out.Reserve, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.Permit, &out.Permit, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.PreBind, &out.PreBind, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.Bind, &out.Bind, s); err != nil { + return err + } + if err := Convert_v1beta2_PluginSet_To_config_PluginSet(&in.PostBind, &out.PostBind, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_Plugins_To_config_Plugins is an autogenerated conversion function. +func Convert_v1beta2_Plugins_To_config_Plugins(in *v1beta2.Plugins, out *config.Plugins, s conversion.Scope) error { + return autoConvert_v1beta2_Plugins_To_config_Plugins(in, out, s) +} + +func autoConvert_config_Plugins_To_v1beta2_Plugins(in *config.Plugins, out *v1beta2.Plugins, s conversion.Scope) error { + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.QueueSort, &out.QueueSort, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.PreFilter, &out.PreFilter, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.Filter, &out.Filter, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.PostFilter, &out.PostFilter, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.PreScore, &out.PreScore, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.Score, &out.Score, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.Reserve, &out.Reserve, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.Permit, &out.Permit, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.PreBind, &out.PreBind, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.Bind, &out.Bind, s); err != nil { + return err + } + if err := Convert_config_PluginSet_To_v1beta2_PluginSet(&in.PostBind, &out.PostBind, s); err != nil { + return err + } + return nil +} + +// Convert_config_Plugins_To_v1beta2_Plugins is an autogenerated conversion function. +func Convert_config_Plugins_To_v1beta2_Plugins(in *config.Plugins, out *v1beta2.Plugins, s conversion.Scope) error { + return autoConvert_config_Plugins_To_v1beta2_Plugins(in, out, s) +} + +func autoConvert_v1beta2_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(in *v1beta2.PodTopologySpreadArgs, out *config.PodTopologySpreadArgs, s conversion.Scope) error { + out.DefaultConstraints = *(*[]corev1.TopologySpreadConstraint)(unsafe.Pointer(&in.DefaultConstraints)) + out.DefaultingType = config.PodTopologySpreadConstraintsDefaulting(in.DefaultingType) + return nil +} + +// Convert_v1beta2_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs is an autogenerated conversion function. +func Convert_v1beta2_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(in *v1beta2.PodTopologySpreadArgs, out *config.PodTopologySpreadArgs, s conversion.Scope) error { + return autoConvert_v1beta2_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(in, out, s) +} + +func autoConvert_config_PodTopologySpreadArgs_To_v1beta2_PodTopologySpreadArgs(in *config.PodTopologySpreadArgs, out *v1beta2.PodTopologySpreadArgs, s conversion.Scope) error { + out.DefaultConstraints = *(*[]corev1.TopologySpreadConstraint)(unsafe.Pointer(&in.DefaultConstraints)) + out.DefaultingType = v1beta2.PodTopologySpreadConstraintsDefaulting(in.DefaultingType) + return nil +} + +// Convert_config_PodTopologySpreadArgs_To_v1beta2_PodTopologySpreadArgs is an autogenerated conversion function. +func Convert_config_PodTopologySpreadArgs_To_v1beta2_PodTopologySpreadArgs(in *config.PodTopologySpreadArgs, out *v1beta2.PodTopologySpreadArgs, s conversion.Scope) error { + return autoConvert_config_PodTopologySpreadArgs_To_v1beta2_PodTopologySpreadArgs(in, out, s) +} + +func autoConvert_v1beta2_RequestedToCapacityRatioParam_To_config_RequestedToCapacityRatioParam(in *v1beta2.RequestedToCapacityRatioParam, out *config.RequestedToCapacityRatioParam, s conversion.Scope) error { + out.Shape = *(*[]config.UtilizationShapePoint)(unsafe.Pointer(&in.Shape)) + return nil +} + +// Convert_v1beta2_RequestedToCapacityRatioParam_To_config_RequestedToCapacityRatioParam is an autogenerated conversion function. +func Convert_v1beta2_RequestedToCapacityRatioParam_To_config_RequestedToCapacityRatioParam(in *v1beta2.RequestedToCapacityRatioParam, out *config.RequestedToCapacityRatioParam, s conversion.Scope) error { + return autoConvert_v1beta2_RequestedToCapacityRatioParam_To_config_RequestedToCapacityRatioParam(in, out, s) +} + +func autoConvert_config_RequestedToCapacityRatioParam_To_v1beta2_RequestedToCapacityRatioParam(in *config.RequestedToCapacityRatioParam, out *v1beta2.RequestedToCapacityRatioParam, s conversion.Scope) error { + out.Shape = *(*[]v1beta2.UtilizationShapePoint)(unsafe.Pointer(&in.Shape)) + return nil +} + +// Convert_config_RequestedToCapacityRatioParam_To_v1beta2_RequestedToCapacityRatioParam is an autogenerated conversion function. +func Convert_config_RequestedToCapacityRatioParam_To_v1beta2_RequestedToCapacityRatioParam(in *config.RequestedToCapacityRatioParam, out *v1beta2.RequestedToCapacityRatioParam, s conversion.Scope) error { + return autoConvert_config_RequestedToCapacityRatioParam_To_v1beta2_RequestedToCapacityRatioParam(in, out, s) +} + +func autoConvert_v1beta2_ResourceSpec_To_config_ResourceSpec(in *v1beta2.ResourceSpec, out *config.ResourceSpec, s conversion.Scope) error { + out.Name = in.Name + out.Weight = in.Weight + return nil +} + +// Convert_v1beta2_ResourceSpec_To_config_ResourceSpec is an autogenerated conversion function. +func Convert_v1beta2_ResourceSpec_To_config_ResourceSpec(in *v1beta2.ResourceSpec, out *config.ResourceSpec, s conversion.Scope) error { + return autoConvert_v1beta2_ResourceSpec_To_config_ResourceSpec(in, out, s) +} + +func autoConvert_config_ResourceSpec_To_v1beta2_ResourceSpec(in *config.ResourceSpec, out *v1beta2.ResourceSpec, s conversion.Scope) error { + out.Name = in.Name + out.Weight = in.Weight + return nil +} + +// Convert_config_ResourceSpec_To_v1beta2_ResourceSpec is an autogenerated conversion function. +func Convert_config_ResourceSpec_To_v1beta2_ResourceSpec(in *config.ResourceSpec, out *v1beta2.ResourceSpec, s conversion.Scope) error { + return autoConvert_config_ResourceSpec_To_v1beta2_ResourceSpec(in, out, s) +} + +func autoConvert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in *v1beta2.ScoringStrategy, out *config.ScoringStrategy, s conversion.Scope) error { + out.Type = config.ScoringStrategyType(in.Type) + out.Resources = *(*[]config.ResourceSpec)(unsafe.Pointer(&in.Resources)) + out.RequestedToCapacityRatio = (*config.RequestedToCapacityRatioParam)(unsafe.Pointer(in.RequestedToCapacityRatio)) + return nil +} + +// Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy is an autogenerated conversion function. +func Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in *v1beta2.ScoringStrategy, out *config.ScoringStrategy, s conversion.Scope) error { + return autoConvert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in, out, s) +} + +func autoConvert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in *config.ScoringStrategy, out *v1beta2.ScoringStrategy, s conversion.Scope) error { + out.Type = v1beta2.ScoringStrategyType(in.Type) + out.Resources = *(*[]v1beta2.ResourceSpec)(unsafe.Pointer(&in.Resources)) + out.RequestedToCapacityRatio = (*v1beta2.RequestedToCapacityRatioParam)(unsafe.Pointer(in.RequestedToCapacityRatio)) + return nil +} + +// Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy is an autogenerated conversion function. +func Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in *config.ScoringStrategy, out *v1beta2.ScoringStrategy, s conversion.Scope) error { + return autoConvert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in, out, s) +} + +func autoConvert_v1beta2_UtilizationShapePoint_To_config_UtilizationShapePoint(in *v1beta2.UtilizationShapePoint, out *config.UtilizationShapePoint, s conversion.Scope) error { + out.Utilization = in.Utilization + out.Score = in.Score + return nil +} + +// Convert_v1beta2_UtilizationShapePoint_To_config_UtilizationShapePoint is an autogenerated conversion function. +func Convert_v1beta2_UtilizationShapePoint_To_config_UtilizationShapePoint(in *v1beta2.UtilizationShapePoint, out *config.UtilizationShapePoint, s conversion.Scope) error { + return autoConvert_v1beta2_UtilizationShapePoint_To_config_UtilizationShapePoint(in, out, s) +} + +func autoConvert_config_UtilizationShapePoint_To_v1beta2_UtilizationShapePoint(in *config.UtilizationShapePoint, out *v1beta2.UtilizationShapePoint, s conversion.Scope) error { + out.Utilization = in.Utilization + out.Score = in.Score + return nil +} + +// Convert_config_UtilizationShapePoint_To_v1beta2_UtilizationShapePoint is an autogenerated conversion function. +func Convert_config_UtilizationShapePoint_To_v1beta2_UtilizationShapePoint(in *config.UtilizationShapePoint, out *v1beta2.UtilizationShapePoint, s conversion.Scope) error { + return autoConvert_config_UtilizationShapePoint_To_v1beta2_UtilizationShapePoint(in, out, s) +} + +func autoConvert_v1beta2_VolumeBindingArgs_To_config_VolumeBindingArgs(in *v1beta2.VolumeBindingArgs, out *config.VolumeBindingArgs, s conversion.Scope) error { + if err := v1.Convert_Pointer_int64_To_int64(&in.BindTimeoutSeconds, &out.BindTimeoutSeconds, s); err != nil { + return err + } + out.Shape = *(*[]config.UtilizationShapePoint)(unsafe.Pointer(&in.Shape)) + return nil +} + +// Convert_v1beta2_VolumeBindingArgs_To_config_VolumeBindingArgs is an autogenerated conversion function. +func Convert_v1beta2_VolumeBindingArgs_To_config_VolumeBindingArgs(in *v1beta2.VolumeBindingArgs, out *config.VolumeBindingArgs, s conversion.Scope) error { + return autoConvert_v1beta2_VolumeBindingArgs_To_config_VolumeBindingArgs(in, out, s) +} + +func autoConvert_config_VolumeBindingArgs_To_v1beta2_VolumeBindingArgs(in *config.VolumeBindingArgs, out *v1beta2.VolumeBindingArgs, s conversion.Scope) error { + if err := v1.Convert_int64_To_Pointer_int64(&in.BindTimeoutSeconds, &out.BindTimeoutSeconds, s); err != nil { + return err + } + out.Shape = *(*[]v1beta2.UtilizationShapePoint)(unsafe.Pointer(&in.Shape)) + return nil +} + +// Convert_config_VolumeBindingArgs_To_v1beta2_VolumeBindingArgs is an autogenerated conversion function. +func Convert_config_VolumeBindingArgs_To_v1beta2_VolumeBindingArgs(in *config.VolumeBindingArgs, out *v1beta2.VolumeBindingArgs, s conversion.Scope) error { + return autoConvert_config_VolumeBindingArgs_To_v1beta2_VolumeBindingArgs(in, out, s) +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.deepcopy.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 00000000..8465e099 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,21 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1beta2 diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.defaults.go b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.defaults.go new file mode 100644 index 00000000..0cd004b8 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2/zz_generated.defaults.go @@ -0,0 +1,72 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1beta2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta2 "k8s.io/kube-scheduler/config/v1beta2" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&v1beta2.DefaultPreemptionArgs{}, func(obj interface{}) { SetObjectDefaults_DefaultPreemptionArgs(obj.(*v1beta2.DefaultPreemptionArgs)) }) + scheme.AddTypeDefaultingFunc(&v1beta2.InterPodAffinityArgs{}, func(obj interface{}) { SetObjectDefaults_InterPodAffinityArgs(obj.(*v1beta2.InterPodAffinityArgs)) }) + scheme.AddTypeDefaultingFunc(&v1beta2.KubeSchedulerConfiguration{}, func(obj interface{}) { + SetObjectDefaults_KubeSchedulerConfiguration(obj.(*v1beta2.KubeSchedulerConfiguration)) + }) + scheme.AddTypeDefaultingFunc(&v1beta2.NodeResourcesBalancedAllocationArgs{}, func(obj interface{}) { + SetObjectDefaults_NodeResourcesBalancedAllocationArgs(obj.(*v1beta2.NodeResourcesBalancedAllocationArgs)) + }) + scheme.AddTypeDefaultingFunc(&v1beta2.NodeResourcesFitArgs{}, func(obj interface{}) { SetObjectDefaults_NodeResourcesFitArgs(obj.(*v1beta2.NodeResourcesFitArgs)) }) + scheme.AddTypeDefaultingFunc(&v1beta2.PodTopologySpreadArgs{}, func(obj interface{}) { SetObjectDefaults_PodTopologySpreadArgs(obj.(*v1beta2.PodTopologySpreadArgs)) }) + scheme.AddTypeDefaultingFunc(&v1beta2.VolumeBindingArgs{}, func(obj interface{}) { SetObjectDefaults_VolumeBindingArgs(obj.(*v1beta2.VolumeBindingArgs)) }) + return nil +} + +func SetObjectDefaults_DefaultPreemptionArgs(in *v1beta2.DefaultPreemptionArgs) { + SetDefaults_DefaultPreemptionArgs(in) +} + +func SetObjectDefaults_InterPodAffinityArgs(in *v1beta2.InterPodAffinityArgs) { + SetDefaults_InterPodAffinityArgs(in) +} + +func SetObjectDefaults_KubeSchedulerConfiguration(in *v1beta2.KubeSchedulerConfiguration) { + SetDefaults_KubeSchedulerConfiguration(in) +} + +func SetObjectDefaults_NodeResourcesBalancedAllocationArgs(in *v1beta2.NodeResourcesBalancedAllocationArgs) { + SetDefaults_NodeResourcesBalancedAllocationArgs(in) +} + +func SetObjectDefaults_NodeResourcesFitArgs(in *v1beta2.NodeResourcesFitArgs) { + SetDefaults_NodeResourcesFitArgs(in) +} + +func SetObjectDefaults_PodTopologySpreadArgs(in *v1beta2.PodTopologySpreadArgs) { + SetDefaults_PodTopologySpreadArgs(in) +} + +func SetObjectDefaults_VolumeBindingArgs(in *v1beta2.VolumeBindingArgs) { + SetDefaults_VolumeBindingArgs(in) +} diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/names/names.go b/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/names/names.go new file mode 100644 index 00000000..744662d0 --- /dev/null +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/framework/plugins/names/names.go @@ -0,0 +1,48 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package names + +const ( + PrioritySort = "PrioritySort" + DefaultBinder = "DefaultBinder" + DefaultPreemption = "DefaultPreemption" + ImageLocality = "ImageLocality" + InterPodAffinity = "InterPodAffinity" + NodeAffinity = "NodeAffinity" + NodeLabel = "NodeLabel" + NodeName = "NodeName" + NodePorts = "NodePorts" + NodePreferAvoidPods = "NodePreferAvoidPods" + NodeResourcesBalancedAllocation = "NodeResourcesBalancedAllocation" + NodeResourcesFit = "NodeResourcesFit" + NodeResourcesLeastAllocated = "NodeResourcesLeastAllocated" + NodeResourcesMostAllocated = "NodeResourcesMostAllocated" + RequestedToCapacityRatio = "RequestedToCapacityRatio" + NodeUnschedulable = "NodeUnschedulable" + NodeVolumeLimits = "NodeVolumeLimits" + AzureDiskLimits = "AzureDiskLimits" + CinderLimits = "CinderLimits" + EBSLimits = "EBSLimits" + GCEPDLimits = "GCEPDLimits" + PodTopologySpread = "PodTopologySpread" + SelectorSpread = "SelectorSpread" + ServiceAffinity = "ServiceAffinity" + TaintToleration = "TaintToleration" + VolumeBinding = "VolumeBinding" + VolumeRestrictions = "VolumeRestrictions" + VolumeZone = "VolumeZone" +) diff --git a/vendor/modules.txt b/vendor/modules.txt index bde666f6..263c57b5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -359,6 +359,10 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect +# k8s.io/apiserver v0.22.6 => k8s.io/apiserver v0.22.3 +## explicit; go 1.16 +k8s.io/apiserver/pkg/features +k8s.io/apiserver/pkg/util/feature # k8s.io/client-go v0.22.6 => k8s.io/client-go v0.22.3 ## explicit; go 1.16 k8s.io/client-go/applyconfigurations/admissionregistration/v1 @@ -478,6 +482,7 @@ k8s.io/client-go/util/workqueue ## explicit; go 1.16 k8s.io/component-base/config k8s.io/component-base/config/v1alpha1 +k8s.io/component-base/featuregate # k8s.io/klog/v2 v2.10.0 ## explicit; go 1.13 k8s.io/klog/v2 @@ -487,13 +492,16 @@ k8s.io/kube-openapi/pkg/util/proto # k8s.io/kube-scheduler v0.22.6 => k8s.io/kube-scheduler v0.22.3 ## explicit; go 1.16 k8s.io/kube-scheduler/config/v1 -k8s.io/kube-scheduler/config/v1beta1 +k8s.io/kube-scheduler/config/v1beta2 # k8s.io/kubelet v0.22.3 => k8s.io/kubelet v0.22.3 ## explicit; go 1.16 k8s.io/kubelet/config/v1beta1 # k8s.io/kubernetes v1.22.6 ## explicit; go 1.16 +k8s.io/kubernetes/pkg/features k8s.io/kubernetes/pkg/scheduler/apis/config +k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2 +k8s.io/kubernetes/pkg/scheduler/framework/plugins/names # k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a ## explicit; go 1.12 k8s.io/utils/integer @@ -508,6 +516,7 @@ sigs.k8s.io/controller-runtime/pkg/log # sigs.k8s.io/scheduler-plugins v0.22.6 ## explicit; go 1.16 sigs.k8s.io/scheduler-plugins/pkg/apis/config +sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2 # sigs.k8s.io/structured-merge-diff/v4 v4.2.1 ## explicit; go 1.13 sigs.k8s.io/structured-merge-diff/v4/fieldpath diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/defaults.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/defaults.go new file mode 100644 index 00000000..822bc13e --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/defaults.go @@ -0,0 +1,152 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:defaulter-gen=true + +package v1beta2 + +import ( + "strconv" + + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + schedulerconfig "k8s.io/kube-scheduler/config/v1" + schedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2" + + k8sschedulerconfigv1beta2 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2" + pluginConfig "sigs.k8s.io/scheduler-plugins/pkg/apis/config" +) + +var ( + defaultPermitWaitingTimeSeconds int64 = 60 + defaultDeniedPGExpirationTimeSeconds int64 = 20 + + defaultNodeResourcesAllocatableMode = Least + + // defaultResourcesToWeightMap is used to set the default resourceToWeight map for CPU and memory + // used by the NodeResourcesAllocatable scoring plugin. + // The base unit for CPU is millicore, while the base using for memory is a byte. + // The default CPU weight is 1<<20 and default memory weight is 1. That means a millicore + // has a weighted score equivalent to 1 MiB. + defaultNodeResourcesAllocatableResourcesToWeightMap = []schedulerconfig.ResourceSpec{ + {Name: "cpu", Weight: 1 << 20}, {Name: "memory", Weight: 1}, + } + + // Defaults for TargetLoadPacking plugin + + // Default 1 core CPU usage for containers without requests and limits i.e. Best Effort QoS. + DefaultRequestsMilliCores int64 = 1000 + // DefaultRequestsMultiplier for containers without limits predicted as 1.5*requests i.e. Burstable QoS class + DefaultRequestsMultiplier = "1.5" + // DefaultTargetUtilizationPercent Recommended to keep -10 than desired limit. + DefaultTargetUtilizationPercent int64 = 40 + + // Defaults for LoadVariationRiskBalancing plugin + + // Risk is usually calculated as average (aka. mu) plus standard deviation (aka. sigma). + // In order to allow customization in the calculation of risk, two parameters are provided: + // Margin and Sensitivity. Margin is a multiplier of sigma, and Sensitivity is a root power of sigma. + // For example, Margin=3 and Sensitivity=2 leads to a risk evaluated as: mu + 3 sqrt(sigma). + // The default value for both parameters is 1, leading to: mu + sigma. + // DefaultSafeVarianceMargin is one + DefaultSafeVarianceMargin = 1.0 + // DefaultSafeVarianceSensitivity is one + DefaultSafeVarianceSensitivity = 1.0 + // DefaultMetricProviderType is the Kubernetes metrics server + DefaultMetricProviderType = pluginConfig.KubernetesMetricsServer + + defaultResourceSpec = []schedulerconfig.ResourceSpec{ + {Name: string(v1.ResourceCPU), Weight: 1}, + {Name: string(v1.ResourceMemory), Weight: 1}, + } +) + +// SetDefaultsCoschedulingArgs sets the default parameters for Coscheduling plugin. +func SetDefaultsCoschedulingArgs(obj *CoschedulingArgs) { + if obj.PermitWaitingTimeSeconds == nil { + obj.PermitWaitingTimeSeconds = &defaultPermitWaitingTimeSeconds + } + if obj.DeniedPGExpirationTimeSeconds == nil { + obj.DeniedPGExpirationTimeSeconds = &defaultDeniedPGExpirationTimeSeconds + } +} + +// SetDefaultsNodeResourcesAllocatableArgs sets the defaults parameters for NodeResourceAllocatable. +func SetDefaultsNodeResourcesAllocatableArgs(obj *NodeResourcesAllocatableArgs) { + if len(obj.Resources) == 0 { + obj.Resources = defaultNodeResourcesAllocatableResourcesToWeightMap + } + + if obj.Mode == "" { + obj.Mode = defaultNodeResourcesAllocatableMode + } +} + +// SetDefaultTargetLoadPackingArgs sets the default parameters for TargetLoadPacking plugin +func SetDefaultTargetLoadPackingArgs(args *TargetLoadPackingArgs) { + if args.DefaultRequests == nil { + args.DefaultRequests = v1.ResourceList{v1.ResourceCPU: resource.MustParse( + strconv.FormatInt(DefaultRequestsMilliCores, 10) + "m")} + } + if args.DefaultRequestsMultiplier == nil { + args.DefaultRequestsMultiplier = &DefaultRequestsMultiplier + } + if args.TargetUtilization == nil || *args.TargetUtilization <= 0 { + args.TargetUtilization = &DefaultTargetUtilizationPercent + } + if args.WatcherAddress == nil && args.MetricProvider.Type == "" { + args.MetricProvider.Type = MetricProviderType(DefaultMetricProviderType) + } +} + +// SetDefaultLoadVariationRiskBalancingArgs sets the default parameters for LoadVariationRiskBalancing plugin +func SetDefaultLoadVariationRiskBalancingArgs(args *LoadVariationRiskBalancingArgs) { + if args.WatcherAddress == nil && args.MetricProvider.Type == "" { + args.MetricProvider.Type = MetricProviderType(DefaultMetricProviderType) + } + if args.SafeVarianceMargin == nil || *args.SafeVarianceMargin < 0 { + args.SafeVarianceMargin = &DefaultSafeVarianceMargin + } + if args.SafeVarianceSensitivity == nil || *args.SafeVarianceSensitivity < 0 { + args.SafeVarianceSensitivity = &DefaultSafeVarianceSensitivity + } +} + +// SetDefaultsNodeResourceTopologyMatchArgs sets the default parameters for NodeResourceTopologyMatch plugin. +func SetDefaultsNodeResourceTopologyMatchArgs(obj *NodeResourceTopologyMatchArgs) { + if obj.ScoringStrategy == nil { + obj.ScoringStrategy = &ScoringStrategy{ + Type: LeastAllocated, + Resources: defaultResourceSpec, + } + } + + if len(obj.ScoringStrategy.Resources) == 0 { + // If no resources specified, use the default set. + obj.ScoringStrategy.Resources = append(obj.ScoringStrategy.Resources, defaultResourceSpec...) + } + + for i := range obj.ScoringStrategy.Resources { + if obj.ScoringStrategy.Resources[i].Weight == 0 { + obj.ScoringStrategy.Resources[i].Weight = 1 + } + } +} + +// PreemptionTolerationArgs reuses SetDefaults_DefaultPreemptionArgs +func SetDefaultsPreemptionTolerationArgs(obj *PreemptionTolerationArgs) { + k8sschedulerconfigv1beta2.SetDefaults_DefaultPreemptionArgs((*schedulerconfigv1beta2.DefaultPreemptionArgs)(obj)) +} diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/doc.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/doc.go new file mode 100644 index 00000000..4157448b --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:conversion-gen=sigs.k8s.io/scheduler-plugins/pkg/apis/config +// +k8s:defaulter-gen=TypeMeta +// +groupName=kubescheduler.config.k8s.io + +// Package v1beta2 is the v1beta2 version of the API. +package v1beta2 // import "sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2" diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/register.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/register.go new file mode 100644 index 00000000..f28b796f --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/register.go @@ -0,0 +1,57 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + schedschemev1beta2 "k8s.io/kube-scheduler/config/v1beta2" +) + +// GroupName is the group name used in this package +const GroupName = "kubescheduler.config.k8s.io" + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta2"} + +var ( + localSchemeBuilder = &schedschemev1beta2.SchemeBuilder + // AddToScheme is a global function that registers this API group & version to a scheme + AddToScheme = localSchemeBuilder.AddToScheme +) + +// addKnownTypes registers known types to the given scheme +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &CoschedulingArgs{}, + &NodeResourcesAllocatableArgs{}, + &TargetLoadPackingArgs{}, + &LoadVariationRiskBalancingArgs{}, + &NodeResourceTopologyMatchArgs{}, + &PreemptionTolerationArgs{}, + ) + return nil +} + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) + localSchemeBuilder.Register(RegisterDefaults) + localSchemeBuilder.Register(RegisterConversions) +} diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/types.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/types.go new file mode 100644 index 00000000..edaef158 --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/types.go @@ -0,0 +1,151 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta2 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schedulerconfig "k8s.io/kube-scheduler/config/v1" + schedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CoschedulingArgs defines the scheduling parameters for Coscheduling plugin. +type CoschedulingArgs struct { + metav1.TypeMeta `json:",inline"` + + // PermitWaitingTime is the wait timeout in seconds. + PermitWaitingTimeSeconds *int64 `json:"permitWaitingTimeSeconds,omitempty"` + // DeniedPGExpirationTimeSeconds is the expiration time of the denied podgroup store. + DeniedPGExpirationTimeSeconds *int64 `json:"deniedPGExpirationTimeSeconds,omitempty"` +} + +// ModeType is a type "string". +type ModeType string + +const ( + // Least is the string "Least". + Least ModeType = "Least" + // Most is the string "Most". + Most ModeType = "Most" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NodeResourcesAllocatableArgs holds arguments used to configure NodeResourcesAllocatable plugin. +type NodeResourcesAllocatableArgs struct { + metav1.TypeMeta `json:",inline"` + + // Resources to be considered when scoring. + // Allowed weights start from 1. + // An example resource set might include "cpu" (millicores) and "memory" (bytes) + // with weights of 1<<20 and 1 respectfully. That would mean 1 MiB has equivalent + // weight as 1 millicore. + Resources []schedulerconfig.ResourceSpec `json:"resources,omitempty"` + + // Whether to prioritize nodes with least or most allocatable resources. + Mode ModeType `json:"mode,omitempty"` +} + +// MetricProviderType is a "string" type. +type MetricProviderType string + +const ( + KubernetesMetricsServer MetricProviderType = "KubernetesMetricsServer" + Prometheus MetricProviderType = "Prometheus" + SignalFx MetricProviderType = "SignalFx" +) + +// Denote the spec of the metric provider +type MetricProviderSpec struct { + // Types of the metric provider + Type MetricProviderType `json:"type,omitempty"` + // The address of the metric provider + Address *string `json:"address,omitempty"` + // The authentication token of the metric provider + Token *string `json:"token,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// TargetLoadPackingArgs holds arguments used to configure TargetLoadPacking plugin. +type TargetLoadPackingArgs struct { + metav1.TypeMeta `json:",inline"` + + // Default requests to use for best effort QoS + DefaultRequests v1.ResourceList `json:"defaultRequests,omitempty"` + // Default requests multiplier for busrtable QoS + DefaultRequestsMultiplier *string `json:"defaultRequestsMultiplier,omitempty"` + // Node target CPU Utilization for bin packing + TargetUtilization *int64 `json:"targetUtilization,omitempty"` + // Specify the metric provider type, address and token using MetricProviderSpec + MetricProvider MetricProviderSpec `json:"metricProvider,omitempty"` + // Address of load watcher service + WatcherAddress *string `json:"watcherAddress,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// LoadVariationRiskBalancingArgs holds arguments used to configure LoadVariationRiskBalancing plugin. +type LoadVariationRiskBalancingArgs struct { + metav1.TypeMeta `json:",inline"` + + // Metric Provider specification when using load watcher as library + MetricProvider MetricProviderSpec `json:"metricProvider,omitempty"` + // Address of load watcher service + WatcherAddress *string `json:"watcherAddress,omitempty"` + // Multiplier of standard deviation in risk value + SafeVarianceMargin *float64 `json:"safeVarianceMargin,omitempty"` + // Root power of standard deviation in risk value + SafeVarianceSensitivity *float64 `json:"safeVarianceSensitivity,omitempty"` +} + +// ScoringStrategyType is a "string" type. +type ScoringStrategyType string + +const ( + // MostAllocated strategy favors node with the least amount of available resource + MostAllocated ScoringStrategyType = "MostAllocated" + // BalancedAllocation strategy favors nodes with balanced resource usage rate + BalancedAllocation ScoringStrategyType = "BalancedAllocation" + // LeastAllocated strategy favors node with the most amount of available resource + LeastAllocated ScoringStrategyType = "LeastAllocated" +) + +type ScoringStrategy struct { + Type ScoringStrategyType `json:"type,omitempty"` + Resources []schedulerconfig.ResourceSpec `json:"resources,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// NodeResourceTopologyMatchArgs holds arguments used to configure the NodeResourceTopologyMatch plugin +type NodeResourceTopologyMatchArgs struct { + metav1.TypeMeta `json:",inline"` + + ScoringStrategy *ScoringStrategy `json:"scoringStrategy,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:defaulter-gen=true + +// PreemptionTolerationArgs reuses DefaultPluginArgs. +type PreemptionTolerationArgs schedulerconfigv1beta2.DefaultPreemptionArgs diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.conversion.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.conversion.go new file mode 100644 index 00000000..bda29d9f --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.conversion.go @@ -0,0 +1,369 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1beta2 + +import ( + unsafe "unsafe" + + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + configv1 "k8s.io/kube-scheduler/config/v1" + config "sigs.k8s.io/scheduler-plugins/pkg/apis/config" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*CoschedulingArgs)(nil), (*config.CoschedulingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_CoschedulingArgs_To_config_CoschedulingArgs(a.(*CoschedulingArgs), b.(*config.CoschedulingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.CoschedulingArgs)(nil), (*CoschedulingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_CoschedulingArgs_To_v1beta2_CoschedulingArgs(a.(*config.CoschedulingArgs), b.(*CoschedulingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*LoadVariationRiskBalancingArgs)(nil), (*config.LoadVariationRiskBalancingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_LoadVariationRiskBalancingArgs_To_config_LoadVariationRiskBalancingArgs(a.(*LoadVariationRiskBalancingArgs), b.(*config.LoadVariationRiskBalancingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.LoadVariationRiskBalancingArgs)(nil), (*LoadVariationRiskBalancingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_LoadVariationRiskBalancingArgs_To_v1beta2_LoadVariationRiskBalancingArgs(a.(*config.LoadVariationRiskBalancingArgs), b.(*LoadVariationRiskBalancingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MetricProviderSpec)(nil), (*config.MetricProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(a.(*MetricProviderSpec), b.(*config.MetricProviderSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.MetricProviderSpec)(nil), (*MetricProviderSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(a.(*config.MetricProviderSpec), b.(*MetricProviderSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NodeResourceTopologyMatchArgs)(nil), (*config.NodeResourceTopologyMatchArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NodeResourceTopologyMatchArgs_To_config_NodeResourceTopologyMatchArgs(a.(*NodeResourceTopologyMatchArgs), b.(*config.NodeResourceTopologyMatchArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.NodeResourceTopologyMatchArgs)(nil), (*NodeResourceTopologyMatchArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_NodeResourceTopologyMatchArgs_To_v1beta2_NodeResourceTopologyMatchArgs(a.(*config.NodeResourceTopologyMatchArgs), b.(*NodeResourceTopologyMatchArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NodeResourcesAllocatableArgs)(nil), (*config.NodeResourcesAllocatableArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NodeResourcesAllocatableArgs_To_config_NodeResourcesAllocatableArgs(a.(*NodeResourcesAllocatableArgs), b.(*config.NodeResourcesAllocatableArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.NodeResourcesAllocatableArgs)(nil), (*NodeResourcesAllocatableArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_NodeResourcesAllocatableArgs_To_v1beta2_NodeResourcesAllocatableArgs(a.(*config.NodeResourcesAllocatableArgs), b.(*NodeResourcesAllocatableArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PreemptionTolerationArgs)(nil), (*config.PreemptionTolerationArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PreemptionTolerationArgs_To_config_PreemptionTolerationArgs(a.(*PreemptionTolerationArgs), b.(*config.PreemptionTolerationArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.PreemptionTolerationArgs)(nil), (*PreemptionTolerationArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_PreemptionTolerationArgs_To_v1beta2_PreemptionTolerationArgs(a.(*config.PreemptionTolerationArgs), b.(*PreemptionTolerationArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ScoringStrategy)(nil), (*config.ScoringStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(a.(*ScoringStrategy), b.(*config.ScoringStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.ScoringStrategy)(nil), (*ScoringStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(a.(*config.ScoringStrategy), b.(*ScoringStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TargetLoadPackingArgs)(nil), (*config.TargetLoadPackingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_TargetLoadPackingArgs_To_config_TargetLoadPackingArgs(a.(*TargetLoadPackingArgs), b.(*config.TargetLoadPackingArgs), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*config.TargetLoadPackingArgs)(nil), (*TargetLoadPackingArgs)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_config_TargetLoadPackingArgs_To_v1beta2_TargetLoadPackingArgs(a.(*config.TargetLoadPackingArgs), b.(*TargetLoadPackingArgs), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta2_CoschedulingArgs_To_config_CoschedulingArgs(in *CoschedulingArgs, out *config.CoschedulingArgs, s conversion.Scope) error { + if err := v1.Convert_Pointer_int64_To_int64(&in.PermitWaitingTimeSeconds, &out.PermitWaitingTimeSeconds, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int64_To_int64(&in.DeniedPGExpirationTimeSeconds, &out.DeniedPGExpirationTimeSeconds, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_CoschedulingArgs_To_config_CoschedulingArgs is an autogenerated conversion function. +func Convert_v1beta2_CoschedulingArgs_To_config_CoschedulingArgs(in *CoschedulingArgs, out *config.CoschedulingArgs, s conversion.Scope) error { + return autoConvert_v1beta2_CoschedulingArgs_To_config_CoschedulingArgs(in, out, s) +} + +func autoConvert_config_CoschedulingArgs_To_v1beta2_CoschedulingArgs(in *config.CoschedulingArgs, out *CoschedulingArgs, s conversion.Scope) error { + if err := v1.Convert_int64_To_Pointer_int64(&in.PermitWaitingTimeSeconds, &out.PermitWaitingTimeSeconds, s); err != nil { + return err + } + if err := v1.Convert_int64_To_Pointer_int64(&in.DeniedPGExpirationTimeSeconds, &out.DeniedPGExpirationTimeSeconds, s); err != nil { + return err + } + return nil +} + +// Convert_config_CoschedulingArgs_To_v1beta2_CoschedulingArgs is an autogenerated conversion function. +func Convert_config_CoschedulingArgs_To_v1beta2_CoschedulingArgs(in *config.CoschedulingArgs, out *CoschedulingArgs, s conversion.Scope) error { + return autoConvert_config_CoschedulingArgs_To_v1beta2_CoschedulingArgs(in, out, s) +} + +func autoConvert_v1beta2_LoadVariationRiskBalancingArgs_To_config_LoadVariationRiskBalancingArgs(in *LoadVariationRiskBalancingArgs, out *config.LoadVariationRiskBalancingArgs, s conversion.Scope) error { + if err := Convert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(&in.MetricProvider, &out.MetricProvider, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.WatcherAddress, &out.WatcherAddress, s); err != nil { + return err + } + if err := v1.Convert_Pointer_float64_To_float64(&in.SafeVarianceMargin, &out.SafeVarianceMargin, s); err != nil { + return err + } + if err := v1.Convert_Pointer_float64_To_float64(&in.SafeVarianceSensitivity, &out.SafeVarianceSensitivity, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_LoadVariationRiskBalancingArgs_To_config_LoadVariationRiskBalancingArgs is an autogenerated conversion function. +func Convert_v1beta2_LoadVariationRiskBalancingArgs_To_config_LoadVariationRiskBalancingArgs(in *LoadVariationRiskBalancingArgs, out *config.LoadVariationRiskBalancingArgs, s conversion.Scope) error { + return autoConvert_v1beta2_LoadVariationRiskBalancingArgs_To_config_LoadVariationRiskBalancingArgs(in, out, s) +} + +func autoConvert_config_LoadVariationRiskBalancingArgs_To_v1beta2_LoadVariationRiskBalancingArgs(in *config.LoadVariationRiskBalancingArgs, out *LoadVariationRiskBalancingArgs, s conversion.Scope) error { + if err := Convert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(&in.MetricProvider, &out.MetricProvider, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.WatcherAddress, &out.WatcherAddress, s); err != nil { + return err + } + if err := v1.Convert_float64_To_Pointer_float64(&in.SafeVarianceMargin, &out.SafeVarianceMargin, s); err != nil { + return err + } + if err := v1.Convert_float64_To_Pointer_float64(&in.SafeVarianceSensitivity, &out.SafeVarianceSensitivity, s); err != nil { + return err + } + return nil +} + +// Convert_config_LoadVariationRiskBalancingArgs_To_v1beta2_LoadVariationRiskBalancingArgs is an autogenerated conversion function. +func Convert_config_LoadVariationRiskBalancingArgs_To_v1beta2_LoadVariationRiskBalancingArgs(in *config.LoadVariationRiskBalancingArgs, out *LoadVariationRiskBalancingArgs, s conversion.Scope) error { + return autoConvert_config_LoadVariationRiskBalancingArgs_To_v1beta2_LoadVariationRiskBalancingArgs(in, out, s) +} + +func autoConvert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(in *MetricProviderSpec, out *config.MetricProviderSpec, s conversion.Scope) error { + out.Type = config.MetricProviderType(in.Type) + if err := v1.Convert_Pointer_string_To_string(&in.Address, &out.Address, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.Token, &out.Token, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec is an autogenerated conversion function. +func Convert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(in *MetricProviderSpec, out *config.MetricProviderSpec, s conversion.Scope) error { + return autoConvert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(in, out, s) +} + +func autoConvert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(in *config.MetricProviderSpec, out *MetricProviderSpec, s conversion.Scope) error { + out.Type = MetricProviderType(in.Type) + if err := v1.Convert_string_To_Pointer_string(&in.Address, &out.Address, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.Token, &out.Token, s); err != nil { + return err + } + return nil +} + +// Convert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec is an autogenerated conversion function. +func Convert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(in *config.MetricProviderSpec, out *MetricProviderSpec, s conversion.Scope) error { + return autoConvert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(in, out, s) +} + +func autoConvert_v1beta2_NodeResourceTopologyMatchArgs_To_config_NodeResourceTopologyMatchArgs(in *NodeResourceTopologyMatchArgs, out *config.NodeResourceTopologyMatchArgs, s conversion.Scope) error { + // WARNING: in.ScoringStrategy requires manual conversion: inconvertible types (*sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2.ScoringStrategy vs sigs.k8s.io/scheduler-plugins/pkg/apis/config.ScoringStrategy) + // Added manually + out.ScoringStrategy = *(*config.ScoringStrategy)(unsafe.Pointer(in.ScoringStrategy)) + return nil +} + +// Convert_v1beta2_NodeResourceTopologyMatchArgs_To_config_NodeResourceTopologyMatchArgs is an autogenerated conversion function. +func Convert_v1beta2_NodeResourceTopologyMatchArgs_To_config_NodeResourceTopologyMatchArgs(in *NodeResourceTopologyMatchArgs, out *config.NodeResourceTopologyMatchArgs, s conversion.Scope) error { + return autoConvert_v1beta2_NodeResourceTopologyMatchArgs_To_config_NodeResourceTopologyMatchArgs(in, out, s) +} + +func autoConvert_config_NodeResourceTopologyMatchArgs_To_v1beta2_NodeResourceTopologyMatchArgs(in *config.NodeResourceTopologyMatchArgs, out *NodeResourceTopologyMatchArgs, s conversion.Scope) error { + // WARNING: in.ScoringStrategy requires manual conversion: inconvertible types (sigs.k8s.io/scheduler-plugins/pkg/apis/config.ScoringStrategy vs *sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2.ScoringStrategy) + // Added manually + out.ScoringStrategy = (*ScoringStrategy)(unsafe.Pointer(&in.ScoringStrategy)) + return nil +} + +// Convert_config_NodeResourceTopologyMatchArgs_To_v1beta2_NodeResourceTopologyMatchArgs is an autogenerated conversion function. +func Convert_config_NodeResourceTopologyMatchArgs_To_v1beta2_NodeResourceTopologyMatchArgs(in *config.NodeResourceTopologyMatchArgs, out *NodeResourceTopologyMatchArgs, s conversion.Scope) error { + return autoConvert_config_NodeResourceTopologyMatchArgs_To_v1beta2_NodeResourceTopologyMatchArgs(in, out, s) +} + +func autoConvert_v1beta2_NodeResourcesAllocatableArgs_To_config_NodeResourcesAllocatableArgs(in *NodeResourcesAllocatableArgs, out *config.NodeResourcesAllocatableArgs, s conversion.Scope) error { + out.Resources = *(*[]configv1.ResourceSpec)(unsafe.Pointer(&in.Resources)) + out.Mode = config.ModeType(in.Mode) + return nil +} + +// Convert_v1beta2_NodeResourcesAllocatableArgs_To_config_NodeResourcesAllocatableArgs is an autogenerated conversion function. +func Convert_v1beta2_NodeResourcesAllocatableArgs_To_config_NodeResourcesAllocatableArgs(in *NodeResourcesAllocatableArgs, out *config.NodeResourcesAllocatableArgs, s conversion.Scope) error { + return autoConvert_v1beta2_NodeResourcesAllocatableArgs_To_config_NodeResourcesAllocatableArgs(in, out, s) +} + +func autoConvert_config_NodeResourcesAllocatableArgs_To_v1beta2_NodeResourcesAllocatableArgs(in *config.NodeResourcesAllocatableArgs, out *NodeResourcesAllocatableArgs, s conversion.Scope) error { + out.Resources = *(*[]configv1.ResourceSpec)(unsafe.Pointer(&in.Resources)) + out.Mode = ModeType(in.Mode) + return nil +} + +// Convert_config_NodeResourcesAllocatableArgs_To_v1beta2_NodeResourcesAllocatableArgs is an autogenerated conversion function. +func Convert_config_NodeResourcesAllocatableArgs_To_v1beta2_NodeResourcesAllocatableArgs(in *config.NodeResourcesAllocatableArgs, out *NodeResourcesAllocatableArgs, s conversion.Scope) error { + return autoConvert_config_NodeResourcesAllocatableArgs_To_v1beta2_NodeResourcesAllocatableArgs(in, out, s) +} + +func autoConvert_v1beta2_PreemptionTolerationArgs_To_config_PreemptionTolerationArgs(in *PreemptionTolerationArgs, out *config.PreemptionTolerationArgs, s conversion.Scope) error { + if err := v1.Convert_Pointer_int32_To_int32(&in.MinCandidateNodesPercentage, &out.MinCandidateNodesPercentage, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.MinCandidateNodesAbsolute, &out.MinCandidateNodesAbsolute, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_PreemptionTolerationArgs_To_config_PreemptionTolerationArgs is an autogenerated conversion function. +func Convert_v1beta2_PreemptionTolerationArgs_To_config_PreemptionTolerationArgs(in *PreemptionTolerationArgs, out *config.PreemptionTolerationArgs, s conversion.Scope) error { + return autoConvert_v1beta2_PreemptionTolerationArgs_To_config_PreemptionTolerationArgs(in, out, s) +} + +func autoConvert_config_PreemptionTolerationArgs_To_v1beta2_PreemptionTolerationArgs(in *config.PreemptionTolerationArgs, out *PreemptionTolerationArgs, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.MinCandidateNodesPercentage, &out.MinCandidateNodesPercentage, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.MinCandidateNodesAbsolute, &out.MinCandidateNodesAbsolute, s); err != nil { + return err + } + return nil +} + +// Convert_config_PreemptionTolerationArgs_To_v1beta2_PreemptionTolerationArgs is an autogenerated conversion function. +func Convert_config_PreemptionTolerationArgs_To_v1beta2_PreemptionTolerationArgs(in *config.PreemptionTolerationArgs, out *PreemptionTolerationArgs, s conversion.Scope) error { + return autoConvert_config_PreemptionTolerationArgs_To_v1beta2_PreemptionTolerationArgs(in, out, s) +} + +func autoConvert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in *ScoringStrategy, out *config.ScoringStrategy, s conversion.Scope) error { + out.Type = config.ScoringStrategyType(in.Type) + out.Resources = *(*[]configv1.ResourceSpec)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy is an autogenerated conversion function. +func Convert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in *ScoringStrategy, out *config.ScoringStrategy, s conversion.Scope) error { + return autoConvert_v1beta2_ScoringStrategy_To_config_ScoringStrategy(in, out, s) +} + +func autoConvert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in *config.ScoringStrategy, out *ScoringStrategy, s conversion.Scope) error { + out.Type = ScoringStrategyType(in.Type) + out.Resources = *(*[]configv1.ResourceSpec)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy is an autogenerated conversion function. +func Convert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in *config.ScoringStrategy, out *ScoringStrategy, s conversion.Scope) error { + return autoConvert_config_ScoringStrategy_To_v1beta2_ScoringStrategy(in, out, s) +} + +func autoConvert_v1beta2_TargetLoadPackingArgs_To_config_TargetLoadPackingArgs(in *TargetLoadPackingArgs, out *config.TargetLoadPackingArgs, s conversion.Scope) error { + out.DefaultRequests = *(*corev1.ResourceList)(unsafe.Pointer(&in.DefaultRequests)) + if err := v1.Convert_Pointer_string_To_string(&in.DefaultRequestsMultiplier, &out.DefaultRequestsMultiplier, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int64_To_int64(&in.TargetUtilization, &out.TargetUtilization, s); err != nil { + return err + } + if err := Convert_v1beta2_MetricProviderSpec_To_config_MetricProviderSpec(&in.MetricProvider, &out.MetricProvider, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.WatcherAddress, &out.WatcherAddress, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_TargetLoadPackingArgs_To_config_TargetLoadPackingArgs is an autogenerated conversion function. +func Convert_v1beta2_TargetLoadPackingArgs_To_config_TargetLoadPackingArgs(in *TargetLoadPackingArgs, out *config.TargetLoadPackingArgs, s conversion.Scope) error { + return autoConvert_v1beta2_TargetLoadPackingArgs_To_config_TargetLoadPackingArgs(in, out, s) +} + +func autoConvert_config_TargetLoadPackingArgs_To_v1beta2_TargetLoadPackingArgs(in *config.TargetLoadPackingArgs, out *TargetLoadPackingArgs, s conversion.Scope) error { + out.DefaultRequests = *(*corev1.ResourceList)(unsafe.Pointer(&in.DefaultRequests)) + if err := v1.Convert_string_To_Pointer_string(&in.DefaultRequestsMultiplier, &out.DefaultRequestsMultiplier, s); err != nil { + return err + } + if err := v1.Convert_int64_To_Pointer_int64(&in.TargetUtilization, &out.TargetUtilization, s); err != nil { + return err + } + if err := Convert_config_MetricProviderSpec_To_v1beta2_MetricProviderSpec(&in.MetricProvider, &out.MetricProvider, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.WatcherAddress, &out.WatcherAddress, s); err != nil { + return err + } + return nil +} + +// Convert_config_TargetLoadPackingArgs_To_v1beta2_TargetLoadPackingArgs is an autogenerated conversion function. +func Convert_config_TargetLoadPackingArgs_To_v1beta2_TargetLoadPackingArgs(in *config.TargetLoadPackingArgs, out *TargetLoadPackingArgs, s conversion.Scope) error { + return autoConvert_config_TargetLoadPackingArgs_To_v1beta2_TargetLoadPackingArgs(in, out, s) +} diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 00000000..f76cd3c1 --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,294 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + v1 "k8s.io/kube-scheduler/config/v1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CoschedulingArgs) DeepCopyInto(out *CoschedulingArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.PermitWaitingTimeSeconds != nil { + in, out := &in.PermitWaitingTimeSeconds, &out.PermitWaitingTimeSeconds + *out = new(int64) + **out = **in + } + if in.DeniedPGExpirationTimeSeconds != nil { + in, out := &in.DeniedPGExpirationTimeSeconds, &out.DeniedPGExpirationTimeSeconds + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoschedulingArgs. +func (in *CoschedulingArgs) DeepCopy() *CoschedulingArgs { + if in == nil { + return nil + } + out := new(CoschedulingArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CoschedulingArgs) 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 *LoadVariationRiskBalancingArgs) DeepCopyInto(out *LoadVariationRiskBalancingArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + in.MetricProvider.DeepCopyInto(&out.MetricProvider) + if in.WatcherAddress != nil { + in, out := &in.WatcherAddress, &out.WatcherAddress + *out = new(string) + **out = **in + } + if in.SafeVarianceMargin != nil { + in, out := &in.SafeVarianceMargin, &out.SafeVarianceMargin + *out = new(float64) + **out = **in + } + if in.SafeVarianceSensitivity != nil { + in, out := &in.SafeVarianceSensitivity, &out.SafeVarianceSensitivity + *out = new(float64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadVariationRiskBalancingArgs. +func (in *LoadVariationRiskBalancingArgs) DeepCopy() *LoadVariationRiskBalancingArgs { + if in == nil { + return nil + } + out := new(LoadVariationRiskBalancingArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LoadVariationRiskBalancingArgs) 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 *MetricProviderSpec) DeepCopyInto(out *MetricProviderSpec) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricProviderSpec. +func (in *MetricProviderSpec) DeepCopy() *MetricProviderSpec { + if in == nil { + return nil + } + out := new(MetricProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeResourceTopologyMatchArgs) DeepCopyInto(out *NodeResourceTopologyMatchArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.ScoringStrategy != nil { + in, out := &in.ScoringStrategy, &out.ScoringStrategy + *out = new(ScoringStrategy) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourceTopologyMatchArgs. +func (in *NodeResourceTopologyMatchArgs) DeepCopy() *NodeResourceTopologyMatchArgs { + if in == nil { + return nil + } + out := new(NodeResourceTopologyMatchArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeResourceTopologyMatchArgs) 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 *NodeResourcesAllocatableArgs) DeepCopyInto(out *NodeResourcesAllocatableArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]v1.ResourceSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeResourcesAllocatableArgs. +func (in *NodeResourcesAllocatableArgs) DeepCopy() *NodeResourcesAllocatableArgs { + if in == nil { + return nil + } + out := new(NodeResourcesAllocatableArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeResourcesAllocatableArgs) 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 *PreemptionTolerationArgs) DeepCopyInto(out *PreemptionTolerationArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.MinCandidateNodesPercentage != nil { + in, out := &in.MinCandidateNodesPercentage, &out.MinCandidateNodesPercentage + *out = new(int32) + **out = **in + } + if in.MinCandidateNodesAbsolute != nil { + in, out := &in.MinCandidateNodesAbsolute, &out.MinCandidateNodesAbsolute + *out = new(int32) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreemptionTolerationArgs. +func (in *PreemptionTolerationArgs) DeepCopy() *PreemptionTolerationArgs { + if in == nil { + return nil + } + out := new(PreemptionTolerationArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PreemptionTolerationArgs) 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 *ScoringStrategy) DeepCopyInto(out *ScoringStrategy) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]v1.ResourceSpec, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScoringStrategy. +func (in *ScoringStrategy) DeepCopy() *ScoringStrategy { + if in == nil { + return nil + } + out := new(ScoringStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetLoadPackingArgs) DeepCopyInto(out *TargetLoadPackingArgs) { + *out = *in + out.TypeMeta = in.TypeMeta + if in.DefaultRequests != nil { + in, out := &in.DefaultRequests, &out.DefaultRequests + *out = make(corev1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + if in.DefaultRequestsMultiplier != nil { + in, out := &in.DefaultRequestsMultiplier, &out.DefaultRequestsMultiplier + *out = new(string) + **out = **in + } + if in.TargetUtilization != nil { + in, out := &in.TargetUtilization, &out.TargetUtilization + *out = new(int64) + **out = **in + } + in.MetricProvider.DeepCopyInto(&out.MetricProvider) + if in.WatcherAddress != nil { + in, out := &in.WatcherAddress, &out.WatcherAddress + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetLoadPackingArgs. +func (in *TargetLoadPackingArgs) DeepCopy() *TargetLoadPackingArgs { + if in == nil { + return nil + } + out := new(TargetLoadPackingArgs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TargetLoadPackingArgs) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.defaults.go b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.defaults.go new file mode 100644 index 00000000..cb5b0fc8 --- /dev/null +++ b/vendor/sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta2/zz_generated.defaults.go @@ -0,0 +1,73 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1beta2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&CoschedulingArgs{}, func(obj interface{}) { SetObjectDefaultsCoschedulingArgs(obj.(*CoschedulingArgs)) }) + scheme.AddTypeDefaultingFunc(&NodeResourcesAllocatableArgs{}, func(obj interface{}) { + SetObjectDefaultsNodeResourcesAllocatableArgs(obj.(*NodeResourcesAllocatableArgs)) + }) + scheme.AddTypeDefaultingFunc(&TargetLoadPackingArgs{}, func(obj interface{}) { + SetObjectDefaultsTargetLoadPackingArgs(obj.(*TargetLoadPackingArgs)) + }) + scheme.AddTypeDefaultingFunc(&LoadVariationRiskBalancingArgs{}, func(obj interface{}) { + SetObjectDefaultsLoadVariationRiskBalancingArgs(obj.(*LoadVariationRiskBalancingArgs)) + }) + scheme.AddTypeDefaultingFunc(&NodeResourceTopologyMatchArgs{}, func(obj interface{}) { + SetObjectDefaultsNodeResourceTopologyMatchArgs(obj.(*NodeResourceTopologyMatchArgs)) + }) + scheme.AddTypeDefaultingFunc(&PreemptionTolerationArgs{}, func(obj interface{}) { + SetObjectDefaultsPreemptionTolerationArgs(obj.(*PreemptionTolerationArgs)) + }) + return nil +} + +func SetObjectDefaultsCoschedulingArgs(in *CoschedulingArgs) { + SetDefaultsCoschedulingArgs(in) +} + +func SetObjectDefaultsNodeResourcesAllocatableArgs(in *NodeResourcesAllocatableArgs) { + SetDefaultsNodeResourcesAllocatableArgs(in) +} + +func SetObjectDefaultsTargetLoadPackingArgs(in *TargetLoadPackingArgs) { + SetDefaultTargetLoadPackingArgs(in) +} + +func SetObjectDefaultsLoadVariationRiskBalancingArgs(in *LoadVariationRiskBalancingArgs) { + SetDefaultLoadVariationRiskBalancingArgs(in) +} + +func SetObjectDefaultsNodeResourceTopologyMatchArgs(in *NodeResourceTopologyMatchArgs) { + SetDefaultsNodeResourceTopologyMatchArgs(in) +} + +func SetObjectDefaultsPreemptionTolerationArgs(in *PreemptionTolerationArgs) { + SetDefaultsPreemptionTolerationArgs(in) +}