mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-30 17:58:14 +00:00 
			
		
		
		
	Merge pull request #87628 from alculquicondor/cc-v1alpha2
Add kubescheduler.config.k8s.io/v1alpha2
This commit is contained in:
		| @@ -491,9 +491,6 @@ API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1,Policy,Pri | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1,RequestedToCapacityRatioArguments,Resources | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1,RequestedToCapacityRatioArguments,Shape | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1,ServiceAffinity,Labels | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1alpha1,KubeSchedulerConfiguration,PluginConfig | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1alpha1,PluginSet,Disabled | ||||
| API rule violation: list_type_missing,k8s.io/kube-scheduler/config/v1alpha1,PluginSet,Enabled | ||||
| API rule violation: list_type_missing,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,AllowedUnsafeSysctls | ||||
| API rule violation: list_type_missing,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,ClusterDNS | ||||
| API rule violation: list_type_missing,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,EnforceNodeAllocatable | ||||
|   | ||||
| @@ -100,6 +100,7 @@ tags_values_pkgs = {"openapi-gen": { | ||||
|         "staging/src/k8s.io/kube-proxy/config/v1alpha1", | ||||
|         "staging/src/k8s.io/kube-scheduler/config/v1", | ||||
|         "staging/src/k8s.io/kube-scheduler/config/v1alpha1", | ||||
|         "staging/src/k8s.io/kube-scheduler/config/v1alpha2", | ||||
|         "staging/src/k8s.io/kubelet/config/v1beta1", | ||||
|         "staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1", | ||||
|         "staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2", | ||||
| @@ -187,6 +188,7 @@ tags_pkgs_values = {"openapi-gen": { | ||||
|     "staging/src/k8s.io/kube-proxy/config/v1alpha1": ["true"], | ||||
|     "staging/src/k8s.io/kube-scheduler/config/v1": ["true"], | ||||
|     "staging/src/k8s.io/kube-scheduler/config/v1alpha1": ["true"], | ||||
|     "staging/src/k8s.io/kube-scheduler/config/v1alpha2": ["true"], | ||||
|     "staging/src/k8s.io/kubelet/config/v1beta1": ["true"], | ||||
|     "staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1": ["true"], | ||||
|     "staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2": ["true"], | ||||
|   | ||||
| @@ -19,6 +19,7 @@ go_library( | ||||
|         "//pkg/scheduler/apis/config:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/scheme:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/v1alpha1:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/v1alpha2:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/validation:go_default_library", | ||||
|         "//staging/src/k8s.io/api/core/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||||
|   | ||||
| @@ -28,6 +28,7 @@ import ( | ||||
| 	kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| 	kubeschedulerscheme "k8s.io/kubernetes/pkg/scheduler/apis/config/scheme" | ||||
| 	kubeschedulerconfigv1alpha1 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha1" | ||||
| 	kubeschedulerconfigv1alpha2 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha2" | ||||
| ) | ||||
|  | ||||
| func loadConfigFromFile(file string) (*kubeschedulerconfig.KubeSchedulerConfiguration, error) { | ||||
| @@ -55,6 +56,7 @@ func loadConfig(data []byte) (*kubeschedulerconfig.KubeSchedulerConfiguration, e | ||||
| 		_, lenientCodecs, lenientErr := codec.NewLenientSchemeAndCodecs( | ||||
| 			kubeschedulerconfig.AddToScheme, | ||||
| 			kubeschedulerconfigv1alpha1.AddToScheme, | ||||
| 			kubeschedulerconfigv1alpha2.AddToScheme, | ||||
| 		) | ||||
| 		if lenientErr != nil { | ||||
| 			return nil, lenientErr | ||||
| @@ -76,7 +78,7 @@ func WriteConfigFile(fileName string, cfg *kubeschedulerconfig.KubeSchedulerConf | ||||
| 		return fmt.Errorf("unable to locate encoder -- %q is not a supported media type", mediaType) | ||||
| 	} | ||||
|  | ||||
| 	encoder := kubeschedulerscheme.Codecs.EncoderForVersion(info.Serializer, kubeschedulerconfigv1alpha1.SchemeGroupVersion) | ||||
| 	encoder := kubeschedulerscheme.Codecs.EncoderForVersion(info.Serializer, kubeschedulerconfigv1alpha2.SchemeGroupVersion) | ||||
|  | ||||
| 	configFile, err := os.Create(fileName) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -189,6 +189,7 @@ pkg/registry/settings/rest | ||||
| pkg/registry/storage/rest | ||||
| pkg/registry/storage/storageclass | ||||
| pkg/scheduler/apis/config/v1alpha1 | ||||
| pkg/scheduler/apis/config/v1alpha2 | ||||
| pkg/security/podsecuritypolicy | ||||
| pkg/security/podsecuritypolicy/group | ||||
| pkg/security/podsecuritypolicy/selinux | ||||
|   | ||||
| @@ -35,6 +35,7 @@ filegroup( | ||||
|         "//pkg/scheduler/apis/config/testing:all-srcs", | ||||
|         "//pkg/scheduler/apis/config/v1:all-srcs", | ||||
|         "//pkg/scheduler/apis/config/v1alpha1:all-srcs", | ||||
|         "//pkg/scheduler/apis/config/v1alpha2:all-srcs", | ||||
|         "//pkg/scheduler/apis/config/validation:all-srcs", | ||||
|     ], | ||||
|     tags = ["automanaged"], | ||||
|   | ||||
| @@ -9,6 +9,7 @@ go_library( | ||||
|         "//pkg/scheduler/apis/config:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/v1:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/v1alpha1:go_default_library", | ||||
|         "//pkg/scheduler/apis/config/v1alpha2:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library", | ||||
|   | ||||
| @@ -23,6 +23,7 @@ import ( | ||||
| 	kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| 	kubeschedulerconfigv1 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1" | ||||
| 	kubeschedulerconfigv1alpha1 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha1" | ||||
| 	kubeschedulerconfigv1alpha2 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha2" | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| @@ -42,5 +43,6 @@ func AddToScheme(scheme *runtime.Scheme) { | ||||
| 	utilruntime.Must(kubeschedulerconfig.AddToScheme(Scheme)) | ||||
| 	utilruntime.Must(kubeschedulerconfigv1.AddToScheme(Scheme)) | ||||
| 	utilruntime.Must(kubeschedulerconfigv1alpha1.AddToScheme(Scheme)) | ||||
| 	utilruntime.Must(kubeschedulerconfigv1alpha2.AddToScheme(Scheme)) | ||||
| 	utilruntime.Must(scheme.SetVersionPriority(kubeschedulerconfigv1alpha1.SchemeGroupVersion)) | ||||
| } | ||||
|   | ||||
| @@ -19,9 +19,9 @@ package v1alpha1 | ||||
| import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	conversion "k8s.io/apimachinery/pkg/conversion" | ||||
| 	v1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" | ||||
| 	config "k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| 	"k8s.io/apimachinery/pkg/conversion" | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha1" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| ) | ||||
|  | ||||
| // Convert_v1alpha1_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration is an autogenerated conversion function. | ||||
|   | ||||
| @@ -23,11 +23,11 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/runtime" | ||||
| 	componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" | ||||
| 	kubeschedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
|  | ||||
| 	// this package shouldn't really depend on other k8s.io/kubernetes code | ||||
| 	api "k8s.io/kubernetes/pkg/apis/core" | ||||
| 	"k8s.io/kubernetes/pkg/master/ports" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| ) | ||||
|  | ||||
| func addDefaultingFuncs(scheme *runtime.Scheme) error { | ||||
|   | ||||
							
								
								
									
										58
									
								
								pkg/scheduler/apis/config/v1alpha2/BUILD
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								pkg/scheduler/apis/config/v1alpha2/BUILD
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,58 @@ | ||||
| load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||||
|  | ||||
| go_library( | ||||
|     name = "go_default_library", | ||||
|     srcs = [ | ||||
|         "conversion.go", | ||||
|         "defaults.go", | ||||
|         "doc.go", | ||||
|         "register.go", | ||||
|         "zz_generated.conversion.go", | ||||
|         "zz_generated.deepcopy.go", | ||||
|         "zz_generated.defaults.go", | ||||
|     ], | ||||
|     importpath = "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha2", | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//pkg/apis/core:go_default_library", | ||||
|         "//pkg/master/ports:go_default_library", | ||||
|         "//pkg/scheduler/apis/config:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", | ||||
|         "//staging/src/k8s.io/kube-scheduler/config/v1alpha2:go_default_library", | ||||
|     ], | ||||
| ) | ||||
|  | ||||
| go_test( | ||||
|     name = "go_default_test", | ||||
|     srcs = [ | ||||
|         "conversion_test.go", | ||||
|         "defaults_test.go", | ||||
|     ], | ||||
|     embed = [":go_default_library"], | ||||
|     deps = [ | ||||
|         "//pkg/scheduler/apis/config:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/config:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", | ||||
|         "//staging/src/k8s.io/kube-scheduler/config/v1alpha2:go_default_library", | ||||
|         "//vendor/k8s.io/utils/pointer:go_default_library", | ||||
|     ], | ||||
| ) | ||||
|  | ||||
| filegroup( | ||||
|     name = "package-srcs", | ||||
|     srcs = glob(["**"]), | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:private"], | ||||
| ) | ||||
|  | ||||
| filegroup( | ||||
|     name = "all-srcs", | ||||
|     srcs = [":package-srcs"], | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:public"], | ||||
| ) | ||||
							
								
								
									
										68
									
								
								pkg/scheduler/apis/config/v1alpha2/conversion.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								pkg/scheduler/apis/config/v1alpha2/conversion.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	"k8s.io/apimachinery/pkg/conversion" | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha2" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| ) | ||||
|  | ||||
| // Convert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(in *v1alpha2.KubeSchedulerLeaderElectionConfiguration, out *config.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { | ||||
| 	if err := autoConvert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(in, out, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if len(in.ResourceNamespace) > 0 && len(in.LockObjectNamespace) == 0 { | ||||
| 		out.ResourceNamespace = in.ResourceNamespace | ||||
| 	} else if len(in.ResourceNamespace) == 0 && len(in.LockObjectNamespace) > 0 { | ||||
| 		out.ResourceNamespace = in.LockObjectNamespace | ||||
| 	} else if len(in.ResourceNamespace) > 0 && len(in.LockObjectNamespace) > 0 { | ||||
| 		if in.ResourceNamespace == in.LockObjectNamespace { | ||||
| 			out.ResourceNamespace = in.ResourceNamespace | ||||
| 		} else { | ||||
| 			return fmt.Errorf("ResourceNamespace and LockObjectNamespace are both set and do not match, ResourceNamespace: %s, LockObjectNamespace: %s", in.ResourceNamespace, in.LockObjectNamespace) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if len(in.ResourceName) > 0 && len(in.LockObjectName) == 0 { | ||||
| 		out.ResourceName = in.ResourceName | ||||
| 	} else if len(in.ResourceName) == 0 && len(in.LockObjectName) > 0 { | ||||
| 		out.ResourceName = in.LockObjectName | ||||
| 	} else if len(in.ResourceName) > 0 && len(in.LockObjectName) > 0 { | ||||
| 		if in.ResourceName == in.LockObjectName { | ||||
| 			out.ResourceName = in.ResourceName | ||||
| 		} else { | ||||
| 			return fmt.Errorf("ResourceName and LockObjectName are both set and do not match, ResourceName: %s, LockObjectName: %s", in.ResourceName, in.LockObjectName) | ||||
| 		} | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration is an autogenerated conversion function. | ||||
| func Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(in *config.KubeSchedulerLeaderElectionConfiguration, out *v1alpha2.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { | ||||
| 	if err := autoConvert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(in, out, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	out.ResourceNamespace = in.ResourceNamespace | ||||
| 	out.LockObjectNamespace = in.ResourceNamespace | ||||
| 	out.ResourceName = in.ResourceName | ||||
| 	out.LockObjectName = in.ResourceName | ||||
| 	return nil | ||||
| } | ||||
							
								
								
									
										193
									
								
								pkg/scheduler/apis/config/v1alpha2/conversion_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								pkg/scheduler/apis/config/v1alpha2/conversion_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,193 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"testing" | ||||
|  | ||||
| 	"k8s.io/apimachinery/pkg/conversion" | ||||
| 	componentbaseconfig "k8s.io/component-base/config" | ||||
| 	componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha2" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
| ) | ||||
|  | ||||
| func TestV1alpha1ToConfigKubeSchedulerLeaderElectionConfiguration(t *testing.T) { | ||||
| 	configuration := &v1alpha2.KubeSchedulerLeaderElectionConfiguration{ | ||||
| 		LockObjectName:      "name", | ||||
| 		LockObjectNamespace: "namespace", | ||||
| 		LeaderElectionConfiguration: componentbaseconfigv1alpha1.LeaderElectionConfiguration{ | ||||
| 			ResourceName:      "name", | ||||
| 			ResourceNamespace: "namespace", | ||||
| 		}, | ||||
| 	} | ||||
| 	emptyLockObjectNameConfig := configuration.DeepCopy() | ||||
| 	emptyLockObjectNameConfig.LockObjectName = "" | ||||
|  | ||||
| 	emptyLockObjectNamespaceConfig := configuration.DeepCopy() | ||||
| 	emptyLockObjectNamespaceConfig.LockObjectNamespace = "" | ||||
|  | ||||
| 	emptyResourceNameConfig := configuration.DeepCopy() | ||||
| 	emptyResourceNameConfig.ResourceName = "" | ||||
|  | ||||
| 	emptyResourceNamespaceConfig := configuration.DeepCopy() | ||||
| 	emptyResourceNamespaceConfig.ResourceNamespace = "" | ||||
|  | ||||
| 	differentNameConfig := configuration.DeepCopy() | ||||
| 	differentNameConfig.LockObjectName = "name1" | ||||
|  | ||||
| 	differentNamespaceConfig := configuration.DeepCopy() | ||||
| 	differentNamespaceConfig.LockObjectNamespace = "namespace1" | ||||
|  | ||||
| 	emptyconfig := &v1alpha2.KubeSchedulerLeaderElectionConfiguration{} | ||||
|  | ||||
| 	scenarios := map[string]struct { | ||||
| 		expectedResourceNamespace string | ||||
| 		expectedResourceName      string | ||||
| 		expectedToFailed          bool | ||||
| 		config                    *v1alpha2.KubeSchedulerLeaderElectionConfiguration | ||||
| 	}{ | ||||
| 		"both-set-same-name-and-namespace": { | ||||
| 			expectedResourceNamespace: "namespace", | ||||
| 			expectedResourceName:      "name", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    configuration, | ||||
| 		}, | ||||
| 		"not-set-lock-object-name": { | ||||
| 			expectedResourceNamespace: "namespace", | ||||
| 			expectedResourceName:      "name", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    emptyLockObjectNameConfig, | ||||
| 		}, | ||||
| 		"not-set-lock-object-namespace": { | ||||
| 			expectedResourceNamespace: "namespace", | ||||
| 			expectedResourceName:      "name", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    emptyLockObjectNamespaceConfig, | ||||
| 		}, | ||||
| 		"not-set-resource-name": { | ||||
| 			expectedResourceNamespace: "namespace", | ||||
| 			expectedResourceName:      "name", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    emptyResourceNameConfig, | ||||
| 		}, | ||||
| 		"not-set-resource-namespace": { | ||||
| 			expectedResourceNamespace: "namespace", | ||||
| 			expectedResourceName:      "name", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    emptyResourceNamespaceConfig, | ||||
| 		}, | ||||
| 		"set-different-name": { | ||||
| 			expectedResourceNamespace: "", | ||||
| 			expectedResourceName:      "", | ||||
| 			expectedToFailed:          true, | ||||
| 			config:                    differentNameConfig, | ||||
| 		}, | ||||
| 		"set-different-namespace": { | ||||
| 			expectedResourceNamespace: "", | ||||
| 			expectedResourceName:      "", | ||||
| 			expectedToFailed:          true, | ||||
| 			config:                    differentNamespaceConfig, | ||||
| 		}, | ||||
| 		"set-empty-name-and-namespace": { | ||||
| 			expectedResourceNamespace: "", | ||||
| 			expectedResourceName:      "", | ||||
| 			expectedToFailed:          false, | ||||
| 			config:                    emptyconfig, | ||||
| 		}, | ||||
| 	} | ||||
| 	for name, scenario := range scenarios { | ||||
| 		out := &config.KubeSchedulerLeaderElectionConfiguration{} | ||||
| 		s := conversion.Scope(nil) | ||||
| 		err := Convert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(scenario.config, out, s) | ||||
| 		if err == nil && scenario.expectedToFailed { | ||||
| 			t.Errorf("Unexpected success for scenario: %s", name) | ||||
| 		} | ||||
| 		if err == nil && !scenario.expectedToFailed { | ||||
| 			if out.ResourceName != scenario.expectedResourceName { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.ResourceName: %s, expectedResourceName: %s", name, out.ResourceName, scenario.expectedResourceName) | ||||
| 			} | ||||
| 			if out.ResourceNamespace != scenario.expectedResourceNamespace { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.ResourceNamespace: %s, expectedResourceNamespace: %s", name, out.ResourceNamespace, scenario.expectedResourceNamespace) | ||||
| 			} | ||||
| 		} | ||||
| 		if err != nil && !scenario.expectedToFailed { | ||||
| 			t.Errorf("Unexpected failure for scenario: %s - %+v", name, err) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func TestConfigToV1alpha1KubeSchedulerLeaderElectionConfiguration(t *testing.T) { | ||||
| 	configuration := &config.KubeSchedulerLeaderElectionConfiguration{ | ||||
| 		LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ | ||||
| 			ResourceName:      "name", | ||||
| 			ResourceNamespace: "namespace", | ||||
| 		}, | ||||
| 	} | ||||
| 	emptyconfig := &config.KubeSchedulerLeaderElectionConfiguration{} | ||||
|  | ||||
| 	scenarios := map[string]struct { | ||||
| 		expectedResourceNamespace   string | ||||
| 		expectedResourceName        string | ||||
| 		expectedLockObjectNamespace string | ||||
| 		expectedLockObjectName      string | ||||
| 		expectedToFailed            bool | ||||
| 		config                      *config.KubeSchedulerLeaderElectionConfiguration | ||||
| 	}{ | ||||
| 		"both-set-name-and-namespace": { | ||||
| 			expectedResourceNamespace:   "namespace", | ||||
| 			expectedResourceName:        "name", | ||||
| 			expectedLockObjectNamespace: "namespace", | ||||
| 			expectedLockObjectName:      "name", | ||||
| 			expectedToFailed:            false, | ||||
| 			config:                      configuration, | ||||
| 		}, | ||||
| 		"set-empty-name-and-namespace": { | ||||
| 			expectedResourceNamespace:   "", | ||||
| 			expectedResourceName:        "", | ||||
| 			expectedLockObjectNamespace: "", | ||||
| 			expectedLockObjectName:      "", | ||||
| 			expectedToFailed:            false, | ||||
| 			config:                      emptyconfig, | ||||
| 		}, | ||||
| 	} | ||||
| 	for name, scenario := range scenarios { | ||||
| 		out := &v1alpha2.KubeSchedulerLeaderElectionConfiguration{} | ||||
| 		s := conversion.Scope(nil) | ||||
| 		err := Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(scenario.config, out, s) | ||||
| 		if err == nil && scenario.expectedToFailed { | ||||
| 			t.Errorf("Unexpected success for scenario: %s", name) | ||||
| 		} | ||||
| 		if err == nil && !scenario.expectedToFailed { | ||||
| 			if out.ResourceName != scenario.expectedResourceName { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.ResourceName: %s, expectedResourceName: %s", name, out.ResourceName, scenario.expectedResourceName) | ||||
| 			} | ||||
| 			if out.LockObjectName != scenario.expectedLockObjectName { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.LockObjectName: %s, expectedLockObjectName: %s", name, out.LockObjectName, scenario.expectedLockObjectName) | ||||
| 			} | ||||
| 			if out.ResourceNamespace != scenario.expectedResourceNamespace { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.ResourceNamespace: %s, expectedResourceNamespace: %s", name, out.ResourceNamespace, scenario.expectedResourceNamespace) | ||||
| 			} | ||||
| 			if out.LockObjectNamespace != scenario.expectedLockObjectNamespace { | ||||
| 				t.Errorf("Unexpected success for scenario: %s, out.LockObjectNamespace: %s, expectedLockObjectNamespace: %s", name, out.LockObjectNamespace, scenario.expectedLockObjectNamespace) | ||||
| 			} | ||||
| 		} | ||||
| 		if err != nil && !scenario.expectedToFailed { | ||||
| 			t.Errorf("Unexpected failure for scenario: %s - %+v", name, err) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										171
									
								
								pkg/scheduler/apis/config/v1alpha2/defaults.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										171
									
								
								pkg/scheduler/apis/config/v1alpha2/defaults.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,171 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"net" | ||||
| 	"strconv" | ||||
|  | ||||
| 	"k8s.io/apimachinery/pkg/runtime" | ||||
| 	componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha2" | ||||
| 	"k8s.io/kubernetes/pkg/scheduler/apis/config" | ||||
|  | ||||
| 	// this package shouldn't really depend on other k8s.io/kubernetes code | ||||
| 	api "k8s.io/kubernetes/pkg/apis/core" | ||||
| 	"k8s.io/kubernetes/pkg/master/ports" | ||||
| ) | ||||
|  | ||||
| func addDefaultingFuncs(scheme *runtime.Scheme) error { | ||||
| 	return RegisterDefaults(scheme) | ||||
| } | ||||
|  | ||||
| // SetDefaults_KubeSchedulerConfiguration sets additional defaults | ||||
| func SetDefaults_KubeSchedulerConfiguration(obj *v1alpha2.KubeSchedulerConfiguration) { | ||||
| 	if obj.SchedulerName == nil { | ||||
| 		val := api.DefaultSchedulerName | ||||
| 		obj.SchedulerName = &val | ||||
| 	} | ||||
|  | ||||
| 	if obj.HardPodAffinitySymmetricWeight == nil { | ||||
| 		val := api.DefaultHardPodAffinitySymmetricWeight | ||||
| 		obj.HardPodAffinitySymmetricWeight = &val | ||||
| 	} | ||||
|  | ||||
| 	if obj.AlgorithmSource.Policy == nil && | ||||
| 		(obj.AlgorithmSource.Provider == nil || len(*obj.AlgorithmSource.Provider) == 0) { | ||||
| 		val := v1alpha2.SchedulerDefaultProviderName | ||||
| 		obj.AlgorithmSource.Provider = &val | ||||
| 	} | ||||
|  | ||||
| 	if policy := obj.AlgorithmSource.Policy; policy != nil { | ||||
| 		if policy.ConfigMap != nil && len(policy.ConfigMap.Namespace) == 0 { | ||||
| 			obj.AlgorithmSource.Policy.ConfigMap.Namespace = api.NamespaceSystem | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	// 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 use the default bind address | ||||
| 	defaultBindAddress := net.JoinHostPort("0.0.0.0", strconv.Itoa(ports.InsecureSchedulerPort)) | ||||
| 	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(ports.InsecureSchedulerPort)) | ||||
| 				obj.HealthzBindAddress = &hostPort | ||||
| 			} else { | ||||
| 				// TODO: in v1beta1 we should let this error instead of stomping with a default value | ||||
| 				obj.HealthzBindAddress = &defaultBindAddress | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	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(ports.InsecureSchedulerPort)) | ||||
| 				obj.MetricsBindAddress = &hostPort | ||||
| 			} else { | ||||
| 				// TODO: in v1beta1 we should let this error instead of stomping with a default value | ||||
| 				obj.MetricsBindAddress = &defaultBindAddress | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if obj.DisablePreemption == nil { | ||||
| 		disablePreemption := false | ||||
| 		obj.DisablePreemption = &disablePreemption | ||||
| 	} | ||||
|  | ||||
| 	if obj.PercentageOfNodesToScore == nil { | ||||
| 		percentageOfNodesToScore := int32(config.DefaultPercentageOfNodesToScore) | ||||
| 		obj.PercentageOfNodesToScore = &percentageOfNodesToScore | ||||
| 	} | ||||
|  | ||||
| 	if len(obj.LeaderElection.ResourceLock) == 0 { | ||||
| 		obj.LeaderElection.ResourceLock = "endpointsleases" | ||||
| 	} | ||||
| 	if len(obj.LeaderElection.LockObjectNamespace) == 0 && len(obj.LeaderElection.ResourceNamespace) == 0 { | ||||
| 		obj.LeaderElection.LockObjectNamespace = v1alpha2.SchedulerDefaultLockObjectNamespace | ||||
| 	} | ||||
| 	if len(obj.LeaderElection.LockObjectName) == 0 && len(obj.LeaderElection.ResourceName) == 0 { | ||||
| 		obj.LeaderElection.LockObjectName = v1alpha2.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.LeaderElectionConfiguration) | ||||
|  | ||||
| 	if obj.BindTimeoutSeconds == nil { | ||||
| 		val := int64(600) | ||||
| 		obj.BindTimeoutSeconds = &val | ||||
| 	} | ||||
|  | ||||
| 	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 | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										169
									
								
								pkg/scheduler/apis/config/v1alpha2/defaults_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										169
									
								
								pkg/scheduler/apis/config/v1alpha2/defaults_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,169 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"reflect" | ||||
| 	"testing" | ||||
| 	"time" | ||||
|  | ||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| 	componentbaseconfig "k8s.io/component-base/config/v1alpha1" | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha2" | ||||
| 	"k8s.io/utils/pointer" | ||||
| ) | ||||
|  | ||||
| func TestSchedulerDefaults(t *testing.T) { | ||||
| 	enable := true | ||||
| 	tests := []struct { | ||||
| 		name     string | ||||
| 		config   *v1alpha2.KubeSchedulerConfiguration | ||||
| 		expected *v1alpha2.KubeSchedulerConfiguration | ||||
| 	}{ | ||||
| 		{ | ||||
| 			name:   "empty config", | ||||
| 			config: &v1alpha2.KubeSchedulerConfiguration{}, | ||||
| 			expected: &v1alpha2.KubeSchedulerConfiguration{ | ||||
| 				SchedulerName:                  pointer.StringPtr("default-scheduler"), | ||||
| 				AlgorithmSource:                v1alpha2.SchedulerAlgorithmSource{Provider: pointer.StringPtr("DefaultProvider")}, | ||||
| 				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1), | ||||
| 				HealthzBindAddress:             pointer.StringPtr("0.0.0.0:10251"), | ||||
| 				MetricsBindAddress:             pointer.StringPtr("0.0.0.0:10251"), | ||||
| 				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{ | ||||
| 					EnableProfiling:           &enable, | ||||
| 					EnableContentionProfiling: &enable, | ||||
| 				}, | ||||
| 				LeaderElection: v1alpha2.KubeSchedulerLeaderElectionConfiguration{ | ||||
| 					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ | ||||
| 						LeaderElect:       pointer.BoolPtr(true), | ||||
| 						LeaseDuration:     metav1.Duration{Duration: 15 * time.Second}, | ||||
| 						RenewDeadline:     metav1.Duration{Duration: 10 * time.Second}, | ||||
| 						RetryPeriod:       metav1.Duration{Duration: 2 * time.Second}, | ||||
| 						ResourceLock:      "endpointsleases", | ||||
| 						ResourceNamespace: "", | ||||
| 						ResourceName:      "", | ||||
| 					}, | ||||
| 					LockObjectName:      "kube-scheduler", | ||||
| 					LockObjectNamespace: "kube-system", | ||||
| 				}, | ||||
| 				ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ | ||||
| 					QPS:         50, | ||||
| 					Burst:       100, | ||||
| 					ContentType: "application/vnd.kubernetes.protobuf", | ||||
| 				}, | ||||
| 				DisablePreemption:        pointer.BoolPtr(false), | ||||
| 				PercentageOfNodesToScore: pointer.Int32Ptr(0), | ||||
| 				BindTimeoutSeconds:       pointer.Int64Ptr(600), | ||||
| 				PodInitialBackoffSeconds: pointer.Int64Ptr(1), | ||||
| 				PodMaxBackoffSeconds:     pointer.Int64Ptr(10), | ||||
| 				Plugins:                  nil, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name: "metrics and healthz address with no port", | ||||
| 			config: &v1alpha2.KubeSchedulerConfiguration{ | ||||
| 				MetricsBindAddress: pointer.StringPtr("1.2.3.4"), | ||||
| 				HealthzBindAddress: pointer.StringPtr("1.2.3.4"), | ||||
| 			}, | ||||
| 			expected: &v1alpha2.KubeSchedulerConfiguration{ | ||||
| 				SchedulerName:                  pointer.StringPtr("default-scheduler"), | ||||
| 				AlgorithmSource:                v1alpha2.SchedulerAlgorithmSource{Provider: pointer.StringPtr("DefaultProvider")}, | ||||
| 				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1), | ||||
| 				HealthzBindAddress:             pointer.StringPtr("1.2.3.4:10251"), | ||||
| 				MetricsBindAddress:             pointer.StringPtr("1.2.3.4:10251"), | ||||
| 				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{ | ||||
| 					EnableProfiling:           &enable, | ||||
| 					EnableContentionProfiling: &enable, | ||||
| 				}, | ||||
| 				LeaderElection: v1alpha2.KubeSchedulerLeaderElectionConfiguration{ | ||||
| 					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ | ||||
| 						LeaderElect:       pointer.BoolPtr(true), | ||||
| 						LeaseDuration:     metav1.Duration{Duration: 15 * time.Second}, | ||||
| 						RenewDeadline:     metav1.Duration{Duration: 10 * time.Second}, | ||||
| 						RetryPeriod:       metav1.Duration{Duration: 2 * time.Second}, | ||||
| 						ResourceLock:      "endpointsleases", | ||||
| 						ResourceNamespace: "", | ||||
| 						ResourceName:      "", | ||||
| 					}, | ||||
| 					LockObjectName:      "kube-scheduler", | ||||
| 					LockObjectNamespace: "kube-system", | ||||
| 				}, | ||||
| 				ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ | ||||
| 					QPS:         50, | ||||
| 					Burst:       100, | ||||
| 					ContentType: "application/vnd.kubernetes.protobuf", | ||||
| 				}, | ||||
| 				DisablePreemption:        pointer.BoolPtr(false), | ||||
| 				PercentageOfNodesToScore: pointer.Int32Ptr(0), | ||||
| 				BindTimeoutSeconds:       pointer.Int64Ptr(600), | ||||
| 				PodInitialBackoffSeconds: pointer.Int64Ptr(1), | ||||
| 				PodMaxBackoffSeconds:     pointer.Int64Ptr(10), | ||||
| 				Plugins:                  nil, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name: "metrics and healthz port with no address", | ||||
| 			config: &v1alpha2.KubeSchedulerConfiguration{ | ||||
| 				MetricsBindAddress: pointer.StringPtr(":12345"), | ||||
| 				HealthzBindAddress: pointer.StringPtr(":12345"), | ||||
| 			}, | ||||
| 			expected: &v1alpha2.KubeSchedulerConfiguration{ | ||||
| 				SchedulerName:                  pointer.StringPtr("default-scheduler"), | ||||
| 				AlgorithmSource:                v1alpha2.SchedulerAlgorithmSource{Provider: pointer.StringPtr("DefaultProvider")}, | ||||
| 				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1), | ||||
| 				HealthzBindAddress:             pointer.StringPtr("0.0.0.0:12345"), | ||||
| 				MetricsBindAddress:             pointer.StringPtr("0.0.0.0:12345"), | ||||
| 				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{ | ||||
| 					EnableProfiling:           &enable, | ||||
| 					EnableContentionProfiling: &enable, | ||||
| 				}, | ||||
| 				LeaderElection: v1alpha2.KubeSchedulerLeaderElectionConfiguration{ | ||||
| 					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{ | ||||
| 						LeaderElect:       pointer.BoolPtr(true), | ||||
| 						LeaseDuration:     metav1.Duration{Duration: 15 * time.Second}, | ||||
| 						RenewDeadline:     metav1.Duration{Duration: 10 * time.Second}, | ||||
| 						RetryPeriod:       metav1.Duration{Duration: 2 * time.Second}, | ||||
| 						ResourceLock:      "endpointsleases", | ||||
| 						ResourceNamespace: "", | ||||
| 						ResourceName:      "", | ||||
| 					}, | ||||
| 					LockObjectName:      "kube-scheduler", | ||||
| 					LockObjectNamespace: "kube-system", | ||||
| 				}, | ||||
| 				ClientConnection: componentbaseconfig.ClientConnectionConfiguration{ | ||||
| 					QPS:         50, | ||||
| 					Burst:       100, | ||||
| 					ContentType: "application/vnd.kubernetes.protobuf", | ||||
| 				}, | ||||
| 				DisablePreemption:        pointer.BoolPtr(false), | ||||
| 				PercentageOfNodesToScore: pointer.Int32Ptr(0), | ||||
| 				BindTimeoutSeconds:       pointer.Int64Ptr(600), | ||||
| 				PodInitialBackoffSeconds: pointer.Int64Ptr(1), | ||||
| 				PodMaxBackoffSeconds:     pointer.Int64Ptr(10), | ||||
| 				Plugins:                  nil, | ||||
| 			}, | ||||
| 		}, | ||||
| 	} | ||||
| 	for _, tc := range tests { | ||||
| 		t.Run(tc.name, func(t *testing.T) { | ||||
| 			SetDefaults_KubeSchedulerConfiguration(tc.config) | ||||
| 			if !reflect.DeepEqual(tc.expected, tc.config) { | ||||
| 				t.Errorf("Expected:\n%#v\n\nGot:\n%#v", tc.expected, tc.config) | ||||
| 			} | ||||
| 		}) | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										24
									
								
								pkg/scheduler/apis/config/v1alpha2/doc.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								pkg/scheduler/apis/config/v1alpha2/doc.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| /* | ||||
| Copyright 2020 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/v1alpha2 | ||||
| // +k8s:defaulter-gen=TypeMeta | ||||
| // +k8s:defaulter-gen-input=../../../../../vendor/k8s.io/kube-scheduler/config/v1alpha2 | ||||
| // +groupName=kubescheduler.config.k8s.io | ||||
|  | ||||
| package v1alpha2 // import "k8s.io/kubernetes/pkg/scheduler/apis/config/v1alpha2" | ||||
							
								
								
									
										42
									
								
								pkg/scheduler/apis/config/v1alpha2/register.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								pkg/scheduler/apis/config/v1alpha2/register.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,42 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"k8s.io/kube-scheduler/config/v1alpha2" | ||||
| ) | ||||
|  | ||||
| // GroupName is the group name used in this package | ||||
| const GroupName = v1alpha2.GroupName | ||||
|  | ||||
| // SchemeGroupVersion is group version used to register these objects | ||||
| var SchemeGroupVersion = v1alpha2.SchemeGroupVersion | ||||
|  | ||||
| var ( | ||||
| 	// localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package, | ||||
| 	// defaulting and conversion init funcs are registered as well. | ||||
| 	localSchemeBuilder = &v1alpha2.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) | ||||
| } | ||||
							
								
								
									
										686
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.conversion.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										686
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.conversion.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,686 @@ | ||||
| // +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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	unsafe "unsafe" | ||||
|  | ||||
| 	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" | ||||
| 	v1alpha2 "k8s.io/kube-scheduler/config/v1alpha2" | ||||
| 	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((*v1alpha2.KubeSchedulerConfiguration)(nil), (*config.KubeSchedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(a.(*v1alpha2.KubeSchedulerConfiguration), b.(*config.KubeSchedulerConfiguration), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.KubeSchedulerConfiguration)(nil), (*v1alpha2.KubeSchedulerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_KubeSchedulerConfiguration_To_v1alpha2_KubeSchedulerConfiguration(a.(*config.KubeSchedulerConfiguration), b.(*v1alpha2.KubeSchedulerConfiguration), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.Plugin)(nil), (*config.Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_Plugin_To_config_Plugin(a.(*v1alpha2.Plugin), b.(*config.Plugin), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.Plugin)(nil), (*v1alpha2.Plugin)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_Plugin_To_v1alpha2_Plugin(a.(*config.Plugin), b.(*v1alpha2.Plugin), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.PluginConfig)(nil), (*config.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_PluginConfig_To_config_PluginConfig(a.(*v1alpha2.PluginConfig), b.(*config.PluginConfig), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.PluginConfig)(nil), (*v1alpha2.PluginConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_PluginConfig_To_v1alpha2_PluginConfig(a.(*config.PluginConfig), b.(*v1alpha2.PluginConfig), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.PluginSet)(nil), (*config.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_PluginSet_To_config_PluginSet(a.(*v1alpha2.PluginSet), b.(*config.PluginSet), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.PluginSet)(nil), (*v1alpha2.PluginSet)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_PluginSet_To_v1alpha2_PluginSet(a.(*config.PluginSet), b.(*v1alpha2.PluginSet), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.Plugins)(nil), (*config.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_Plugins_To_config_Plugins(a.(*v1alpha2.Plugins), b.(*config.Plugins), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.Plugins)(nil), (*v1alpha2.Plugins)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_Plugins_To_v1alpha2_Plugins(a.(*config.Plugins), b.(*v1alpha2.Plugins), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.SchedulerAlgorithmSource)(nil), (*config.SchedulerAlgorithmSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource(a.(*v1alpha2.SchedulerAlgorithmSource), b.(*config.SchedulerAlgorithmSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.SchedulerAlgorithmSource)(nil), (*v1alpha2.SchedulerAlgorithmSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource(a.(*config.SchedulerAlgorithmSource), b.(*v1alpha2.SchedulerAlgorithmSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.SchedulerPolicyConfigMapSource)(nil), (*config.SchedulerPolicyConfigMapSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_SchedulerPolicyConfigMapSource_To_config_SchedulerPolicyConfigMapSource(a.(*v1alpha2.SchedulerPolicyConfigMapSource), b.(*config.SchedulerPolicyConfigMapSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.SchedulerPolicyConfigMapSource)(nil), (*v1alpha2.SchedulerPolicyConfigMapSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_SchedulerPolicyConfigMapSource_To_v1alpha2_SchedulerPolicyConfigMapSource(a.(*config.SchedulerPolicyConfigMapSource), b.(*v1alpha2.SchedulerPolicyConfigMapSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.SchedulerPolicyFileSource)(nil), (*config.SchedulerPolicyFileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_SchedulerPolicyFileSource_To_config_SchedulerPolicyFileSource(a.(*v1alpha2.SchedulerPolicyFileSource), b.(*config.SchedulerPolicyFileSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.SchedulerPolicyFileSource)(nil), (*v1alpha2.SchedulerPolicyFileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_SchedulerPolicyFileSource_To_v1alpha2_SchedulerPolicyFileSource(a.(*config.SchedulerPolicyFileSource), b.(*v1alpha2.SchedulerPolicyFileSource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*v1alpha2.SchedulerPolicySource)(nil), (*config.SchedulerPolicySource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_SchedulerPolicySource_To_config_SchedulerPolicySource(a.(*v1alpha2.SchedulerPolicySource), b.(*config.SchedulerPolicySource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddGeneratedConversionFunc((*config.SchedulerPolicySource)(nil), (*v1alpha2.SchedulerPolicySource)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_SchedulerPolicySource_To_v1alpha2_SchedulerPolicySource(a.(*config.SchedulerPolicySource), b.(*v1alpha2.SchedulerPolicySource), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddConversionFunc((*config.KubeSchedulerLeaderElectionConfiguration)(nil), (*v1alpha2.KubeSchedulerLeaderElectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(a.(*config.KubeSchedulerLeaderElectionConfiguration), b.(*v1alpha2.KubeSchedulerLeaderElectionConfiguration), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := s.AddConversionFunc((*v1alpha2.KubeSchedulerLeaderElectionConfiguration)(nil), (*config.KubeSchedulerLeaderElectionConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { | ||||
| 		return Convert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(a.(*v1alpha2.KubeSchedulerLeaderElectionConfiguration), b.(*config.KubeSchedulerLeaderElectionConfiguration), scope) | ||||
| 	}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in *v1alpha2.KubeSchedulerConfiguration, out *config.KubeSchedulerConfiguration, s conversion.Scope) error { | ||||
| 	if err := v1.Convert_Pointer_string_To_string(&in.SchedulerName, &out.SchedulerName, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := Convert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource(&in.AlgorithmSource, &out.AlgorithmSource, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := v1.Convert_Pointer_int32_To_int32(&in.HardPodAffinitySymmetricWeight, &out.HardPodAffinitySymmetricWeight, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := Convert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(&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_bool_To_bool(&in.DisablePreemption, &out.DisablePreemption, 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.BindTimeoutSeconds, &out.BindTimeoutSeconds, 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.Plugins != nil { | ||||
| 		in, out := &in.Plugins, &out.Plugins | ||||
| 		*out = new(config.Plugins) | ||||
| 		if err := Convert_v1alpha2_Plugins_To_config_Plugins(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Plugins = nil | ||||
| 	} | ||||
| 	out.PluginConfig = *(*[]config.PluginConfig)(unsafe.Pointer(&in.PluginConfig)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in *v1alpha2.KubeSchedulerConfiguration, out *config.KubeSchedulerConfiguration, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_KubeSchedulerConfiguration_To_config_KubeSchedulerConfiguration(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_KubeSchedulerConfiguration_To_v1alpha2_KubeSchedulerConfiguration(in *config.KubeSchedulerConfiguration, out *v1alpha2.KubeSchedulerConfiguration, s conversion.Scope) error { | ||||
| 	if err := v1.Convert_string_To_Pointer_string(&in.SchedulerName, &out.SchedulerName, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := Convert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource(&in.AlgorithmSource, &out.AlgorithmSource, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := v1.Convert_int32_To_Pointer_int32(&in.HardPodAffinitySymmetricWeight, &out.HardPodAffinitySymmetricWeight, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	if err := Convert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(&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_bool_To_Pointer_bool(&in.DisablePreemption, &out.DisablePreemption, 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.BindTimeoutSeconds, &out.BindTimeoutSeconds, 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.Plugins != nil { | ||||
| 		in, out := &in.Plugins, &out.Plugins | ||||
| 		*out = new(v1alpha2.Plugins) | ||||
| 		if err := Convert_config_Plugins_To_v1alpha2_Plugins(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Plugins = nil | ||||
| 	} | ||||
| 	out.PluginConfig = *(*[]v1alpha2.PluginConfig)(unsafe.Pointer(&in.PluginConfig)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_KubeSchedulerConfiguration_To_v1alpha2_KubeSchedulerConfiguration is an autogenerated conversion function. | ||||
| func Convert_config_KubeSchedulerConfiguration_To_v1alpha2_KubeSchedulerConfiguration(in *config.KubeSchedulerConfiguration, out *v1alpha2.KubeSchedulerConfiguration, s conversion.Scope) error { | ||||
| 	return autoConvert_config_KubeSchedulerConfiguration_To_v1alpha2_KubeSchedulerConfiguration(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_KubeSchedulerLeaderElectionConfiguration_To_config_KubeSchedulerLeaderElectionConfiguration(in *v1alpha2.KubeSchedulerLeaderElectionConfiguration, out *config.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { | ||||
| 	if err := v1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	// WARNING: in.LockObjectNamespace requires manual conversion: does not exist in peer-type | ||||
| 	// WARNING: in.LockObjectName requires manual conversion: does not exist in peer-type | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func autoConvert_config_KubeSchedulerLeaderElectionConfiguration_To_v1alpha2_KubeSchedulerLeaderElectionConfiguration(in *config.KubeSchedulerLeaderElectionConfiguration, out *v1alpha2.KubeSchedulerLeaderElectionConfiguration, s conversion.Scope) error { | ||||
| 	if err := v1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElectionConfiguration, &out.LeaderElectionConfiguration, s); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_Plugin_To_config_Plugin(in *v1alpha2.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_v1alpha2_Plugin_To_config_Plugin is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_Plugin_To_config_Plugin(in *v1alpha2.Plugin, out *config.Plugin, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_Plugin_To_config_Plugin(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_Plugin_To_v1alpha2_Plugin(in *config.Plugin, out *v1alpha2.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_v1alpha2_Plugin is an autogenerated conversion function. | ||||
| func Convert_config_Plugin_To_v1alpha2_Plugin(in *config.Plugin, out *v1alpha2.Plugin, s conversion.Scope) error { | ||||
| 	return autoConvert_config_Plugin_To_v1alpha2_Plugin(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_PluginConfig_To_config_PluginConfig(in *v1alpha2.PluginConfig, out *config.PluginConfig, s conversion.Scope) error { | ||||
| 	out.Name = in.Name | ||||
| 	out.Args = in.Args | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_PluginConfig_To_config_PluginConfig is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_PluginConfig_To_config_PluginConfig(in *v1alpha2.PluginConfig, out *config.PluginConfig, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_PluginConfig_To_config_PluginConfig(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_PluginConfig_To_v1alpha2_PluginConfig(in *config.PluginConfig, out *v1alpha2.PluginConfig, s conversion.Scope) error { | ||||
| 	out.Name = in.Name | ||||
| 	out.Args = in.Args | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_PluginConfig_To_v1alpha2_PluginConfig is an autogenerated conversion function. | ||||
| func Convert_config_PluginConfig_To_v1alpha2_PluginConfig(in *config.PluginConfig, out *v1alpha2.PluginConfig, s conversion.Scope) error { | ||||
| 	return autoConvert_config_PluginConfig_To_v1alpha2_PluginConfig(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_PluginSet_To_config_PluginSet(in *v1alpha2.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_v1alpha2_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_v1alpha2_Plugin_To_config_Plugin(&(*in)[i], &(*out)[i], s); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Disabled = nil | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_PluginSet_To_config_PluginSet is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_PluginSet_To_config_PluginSet(in *v1alpha2.PluginSet, out *config.PluginSet, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_PluginSet_To_config_PluginSet(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_PluginSet_To_v1alpha2_PluginSet(in *config.PluginSet, out *v1alpha2.PluginSet, s conversion.Scope) error { | ||||
| 	if in.Enabled != nil { | ||||
| 		in, out := &in.Enabled, &out.Enabled | ||||
| 		*out = make([]v1alpha2.Plugin, len(*in)) | ||||
| 		for i := range *in { | ||||
| 			if err := Convert_config_Plugin_To_v1alpha2_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([]v1alpha2.Plugin, len(*in)) | ||||
| 		for i := range *in { | ||||
| 			if err := Convert_config_Plugin_To_v1alpha2_Plugin(&(*in)[i], &(*out)[i], s); err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Disabled = nil | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_PluginSet_To_v1alpha2_PluginSet is an autogenerated conversion function. | ||||
| func Convert_config_PluginSet_To_v1alpha2_PluginSet(in *config.PluginSet, out *v1alpha2.PluginSet, s conversion.Scope) error { | ||||
| 	return autoConvert_config_PluginSet_To_v1alpha2_PluginSet(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_Plugins_To_config_Plugins(in *v1alpha2.Plugins, out *config.Plugins, s conversion.Scope) error { | ||||
| 	if in.QueueSort != nil { | ||||
| 		in, out := &in.QueueSort, &out.QueueSort | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.QueueSort = nil | ||||
| 	} | ||||
| 	if in.PreFilter != nil { | ||||
| 		in, out := &in.PreFilter, &out.PreFilter | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PreFilter = nil | ||||
| 	} | ||||
| 	if in.Filter != nil { | ||||
| 		in, out := &in.Filter, &out.Filter | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Filter = nil | ||||
| 	} | ||||
| 	if in.PostFilter != nil { | ||||
| 		in, out := &in.PostFilter, &out.PostFilter | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PostFilter = nil | ||||
| 	} | ||||
| 	if in.Score != nil { | ||||
| 		in, out := &in.Score, &out.Score | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Score = nil | ||||
| 	} | ||||
| 	if in.Reserve != nil { | ||||
| 		in, out := &in.Reserve, &out.Reserve | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Reserve = nil | ||||
| 	} | ||||
| 	if in.Permit != nil { | ||||
| 		in, out := &in.Permit, &out.Permit | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Permit = nil | ||||
| 	} | ||||
| 	if in.PreBind != nil { | ||||
| 		in, out := &in.PreBind, &out.PreBind | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PreBind = nil | ||||
| 	} | ||||
| 	if in.Bind != nil { | ||||
| 		in, out := &in.Bind, &out.Bind | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Bind = nil | ||||
| 	} | ||||
| 	if in.PostBind != nil { | ||||
| 		in, out := &in.PostBind, &out.PostBind | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PostBind = nil | ||||
| 	} | ||||
| 	if in.Unreserve != nil { | ||||
| 		in, out := &in.Unreserve, &out.Unreserve | ||||
| 		*out = new(config.PluginSet) | ||||
| 		if err := Convert_v1alpha2_PluginSet_To_config_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Unreserve = nil | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_Plugins_To_config_Plugins is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_Plugins_To_config_Plugins(in *v1alpha2.Plugins, out *config.Plugins, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_Plugins_To_config_Plugins(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_Plugins_To_v1alpha2_Plugins(in *config.Plugins, out *v1alpha2.Plugins, s conversion.Scope) error { | ||||
| 	if in.QueueSort != nil { | ||||
| 		in, out := &in.QueueSort, &out.QueueSort | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.QueueSort = nil | ||||
| 	} | ||||
| 	if in.PreFilter != nil { | ||||
| 		in, out := &in.PreFilter, &out.PreFilter | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PreFilter = nil | ||||
| 	} | ||||
| 	if in.Filter != nil { | ||||
| 		in, out := &in.Filter, &out.Filter | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Filter = nil | ||||
| 	} | ||||
| 	if in.PostFilter != nil { | ||||
| 		in, out := &in.PostFilter, &out.PostFilter | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PostFilter = nil | ||||
| 	} | ||||
| 	if in.Score != nil { | ||||
| 		in, out := &in.Score, &out.Score | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Score = nil | ||||
| 	} | ||||
| 	if in.Reserve != nil { | ||||
| 		in, out := &in.Reserve, &out.Reserve | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Reserve = nil | ||||
| 	} | ||||
| 	if in.Permit != nil { | ||||
| 		in, out := &in.Permit, &out.Permit | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Permit = nil | ||||
| 	} | ||||
| 	if in.PreBind != nil { | ||||
| 		in, out := &in.PreBind, &out.PreBind | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PreBind = nil | ||||
| 	} | ||||
| 	if in.Bind != nil { | ||||
| 		in, out := &in.Bind, &out.Bind | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Bind = nil | ||||
| 	} | ||||
| 	if in.PostBind != nil { | ||||
| 		in, out := &in.PostBind, &out.PostBind | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.PostBind = nil | ||||
| 	} | ||||
| 	if in.Unreserve != nil { | ||||
| 		in, out := &in.Unreserve, &out.Unreserve | ||||
| 		*out = new(v1alpha2.PluginSet) | ||||
| 		if err := Convert_config_PluginSet_To_v1alpha2_PluginSet(*in, *out, s); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} else { | ||||
| 		out.Unreserve = nil | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_Plugins_To_v1alpha2_Plugins is an autogenerated conversion function. | ||||
| func Convert_config_Plugins_To_v1alpha2_Plugins(in *config.Plugins, out *v1alpha2.Plugins, s conversion.Scope) error { | ||||
| 	return autoConvert_config_Plugins_To_v1alpha2_Plugins(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource(in *v1alpha2.SchedulerAlgorithmSource, out *config.SchedulerAlgorithmSource, s conversion.Scope) error { | ||||
| 	out.Policy = (*config.SchedulerPolicySource)(unsafe.Pointer(in.Policy)) | ||||
| 	out.Provider = (*string)(unsafe.Pointer(in.Provider)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource(in *v1alpha2.SchedulerAlgorithmSource, out *config.SchedulerAlgorithmSource, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_SchedulerAlgorithmSource_To_config_SchedulerAlgorithmSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource(in *config.SchedulerAlgorithmSource, out *v1alpha2.SchedulerAlgorithmSource, s conversion.Scope) error { | ||||
| 	out.Policy = (*v1alpha2.SchedulerPolicySource)(unsafe.Pointer(in.Policy)) | ||||
| 	out.Provider = (*string)(unsafe.Pointer(in.Provider)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource is an autogenerated conversion function. | ||||
| func Convert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource(in *config.SchedulerAlgorithmSource, out *v1alpha2.SchedulerAlgorithmSource, s conversion.Scope) error { | ||||
| 	return autoConvert_config_SchedulerAlgorithmSource_To_v1alpha2_SchedulerAlgorithmSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_SchedulerPolicyConfigMapSource_To_config_SchedulerPolicyConfigMapSource(in *v1alpha2.SchedulerPolicyConfigMapSource, out *config.SchedulerPolicyConfigMapSource, s conversion.Scope) error { | ||||
| 	out.Namespace = in.Namespace | ||||
| 	out.Name = in.Name | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_SchedulerPolicyConfigMapSource_To_config_SchedulerPolicyConfigMapSource is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_SchedulerPolicyConfigMapSource_To_config_SchedulerPolicyConfigMapSource(in *v1alpha2.SchedulerPolicyConfigMapSource, out *config.SchedulerPolicyConfigMapSource, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_SchedulerPolicyConfigMapSource_To_config_SchedulerPolicyConfigMapSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_SchedulerPolicyConfigMapSource_To_v1alpha2_SchedulerPolicyConfigMapSource(in *config.SchedulerPolicyConfigMapSource, out *v1alpha2.SchedulerPolicyConfigMapSource, s conversion.Scope) error { | ||||
| 	out.Namespace = in.Namespace | ||||
| 	out.Name = in.Name | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_SchedulerPolicyConfigMapSource_To_v1alpha2_SchedulerPolicyConfigMapSource is an autogenerated conversion function. | ||||
| func Convert_config_SchedulerPolicyConfigMapSource_To_v1alpha2_SchedulerPolicyConfigMapSource(in *config.SchedulerPolicyConfigMapSource, out *v1alpha2.SchedulerPolicyConfigMapSource, s conversion.Scope) error { | ||||
| 	return autoConvert_config_SchedulerPolicyConfigMapSource_To_v1alpha2_SchedulerPolicyConfigMapSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_SchedulerPolicyFileSource_To_config_SchedulerPolicyFileSource(in *v1alpha2.SchedulerPolicyFileSource, out *config.SchedulerPolicyFileSource, s conversion.Scope) error { | ||||
| 	out.Path = in.Path | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_SchedulerPolicyFileSource_To_config_SchedulerPolicyFileSource is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_SchedulerPolicyFileSource_To_config_SchedulerPolicyFileSource(in *v1alpha2.SchedulerPolicyFileSource, out *config.SchedulerPolicyFileSource, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_SchedulerPolicyFileSource_To_config_SchedulerPolicyFileSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_SchedulerPolicyFileSource_To_v1alpha2_SchedulerPolicyFileSource(in *config.SchedulerPolicyFileSource, out *v1alpha2.SchedulerPolicyFileSource, s conversion.Scope) error { | ||||
| 	out.Path = in.Path | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_SchedulerPolicyFileSource_To_v1alpha2_SchedulerPolicyFileSource is an autogenerated conversion function. | ||||
| func Convert_config_SchedulerPolicyFileSource_To_v1alpha2_SchedulerPolicyFileSource(in *config.SchedulerPolicyFileSource, out *v1alpha2.SchedulerPolicyFileSource, s conversion.Scope) error { | ||||
| 	return autoConvert_config_SchedulerPolicyFileSource_To_v1alpha2_SchedulerPolicyFileSource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_v1alpha2_SchedulerPolicySource_To_config_SchedulerPolicySource(in *v1alpha2.SchedulerPolicySource, out *config.SchedulerPolicySource, s conversion.Scope) error { | ||||
| 	out.File = (*config.SchedulerPolicyFileSource)(unsafe.Pointer(in.File)) | ||||
| 	out.ConfigMap = (*config.SchedulerPolicyConfigMapSource)(unsafe.Pointer(in.ConfigMap)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_v1alpha2_SchedulerPolicySource_To_config_SchedulerPolicySource is an autogenerated conversion function. | ||||
| func Convert_v1alpha2_SchedulerPolicySource_To_config_SchedulerPolicySource(in *v1alpha2.SchedulerPolicySource, out *config.SchedulerPolicySource, s conversion.Scope) error { | ||||
| 	return autoConvert_v1alpha2_SchedulerPolicySource_To_config_SchedulerPolicySource(in, out, s) | ||||
| } | ||||
|  | ||||
| func autoConvert_config_SchedulerPolicySource_To_v1alpha2_SchedulerPolicySource(in *config.SchedulerPolicySource, out *v1alpha2.SchedulerPolicySource, s conversion.Scope) error { | ||||
| 	out.File = (*v1alpha2.SchedulerPolicyFileSource)(unsafe.Pointer(in.File)) | ||||
| 	out.ConfigMap = (*v1alpha2.SchedulerPolicyConfigMapSource)(unsafe.Pointer(in.ConfigMap)) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // Convert_config_SchedulerPolicySource_To_v1alpha2_SchedulerPolicySource is an autogenerated conversion function. | ||||
| func Convert_config_SchedulerPolicySource_To_v1alpha2_SchedulerPolicySource(in *config.SchedulerPolicySource, out *v1alpha2.SchedulerPolicySource, s conversion.Scope) error { | ||||
| 	return autoConvert_config_SchedulerPolicySource_To_v1alpha2_SchedulerPolicySource(in, out, s) | ||||
| } | ||||
							
								
								
									
										21
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.deepcopy.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.deepcopy.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -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 v1alpha2 | ||||
							
								
								
									
										40
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.defaults.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								pkg/scheduler/apis/config/v1alpha2/zz_generated.defaults.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| // +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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	runtime "k8s.io/apimachinery/pkg/runtime" | ||||
| 	v1alpha2 "k8s.io/kube-scheduler/config/v1alpha2" | ||||
| ) | ||||
|  | ||||
| // 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(&v1alpha2.KubeSchedulerConfiguration{}, func(obj interface{}) { | ||||
| 		SetObjectDefaults_KubeSchedulerConfiguration(obj.(*v1alpha2.KubeSchedulerConfiguration)) | ||||
| 	}) | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func SetObjectDefaults_KubeSchedulerConfiguration(in *v1alpha2.KubeSchedulerConfiguration) { | ||||
| 	SetDefaults_KubeSchedulerConfiguration(in) | ||||
| } | ||||
| @@ -11,6 +11,7 @@ filegroup( | ||||
|         ":package-srcs", | ||||
|         "//staging/src/k8s.io/kube-scheduler/config/v1:all-srcs", | ||||
|         "//staging/src/k8s.io/kube-scheduler/config/v1alpha1:all-srcs", | ||||
|         "//staging/src/k8s.io/kube-scheduler/config/v1alpha2:all-srcs", | ||||
|     ], | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:public"], | ||||
|   | ||||
| @@ -103,6 +103,8 @@ type KubeSchedulerConfiguration struct { | ||||
|  | ||||
| 	// PluginConfig is an optional set of custom plugin arguments for each plugin. | ||||
| 	// Omitting config args for a plugin is equivalent to using the default config for that plugin. | ||||
| 	// +listType=map | ||||
| 	// +listMapKey=name | ||||
| 	PluginConfig []PluginConfig `json:"pluginConfig,omitempty"` | ||||
| } | ||||
|  | ||||
| @@ -198,9 +200,12 @@ type Plugins struct { | ||||
| type PluginSet struct { | ||||
| 	// Enabled specifies plugins that should be enabled in addition to default plugins. | ||||
| 	// These are called after default plugins and in the same order specified here. | ||||
| 	// +listType=atomic | ||||
| 	Enabled []Plugin `json:"enabled,omitempty"` | ||||
| 	// Disabled specifies default plugins that should be disabled. | ||||
| 	// When all default plugins need to be disabled, an array containing only one "*" should be provided. | ||||
| 	// +listType=map | ||||
| 	// +listMapKey=name | ||||
| 	Disabled []Plugin `json:"disabled,omitempty"` | ||||
| } | ||||
|  | ||||
|   | ||||
							
								
								
									
										34
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/BUILD
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/BUILD
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||||
|  | ||||
| go_library( | ||||
|     name = "go_default_library", | ||||
|     srcs = [ | ||||
|         "doc.go", | ||||
|         "register.go", | ||||
|         "types.go", | ||||
|         "zz_generated.deepcopy.go", | ||||
|     ], | ||||
|     importmap = "k8s.io/kubernetes/vendor/k8s.io/kube-scheduler/config/v1alpha2", | ||||
|     importpath = "k8s.io/kube-scheduler/config/v1alpha2", | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library", | ||||
|     ], | ||||
| ) | ||||
|  | ||||
| filegroup( | ||||
|     name = "package-srcs", | ||||
|     srcs = glob(["**"]), | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:private"], | ||||
| ) | ||||
|  | ||||
| filegroup( | ||||
|     name = "all-srcs", | ||||
|     srcs = [":package-srcs"], | ||||
|     tags = ["automanaged"], | ||||
|     visibility = ["//visibility:public"], | ||||
| ) | ||||
							
								
								
									
										21
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/doc.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/doc.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| /* | ||||
| Copyright 2020 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:openapi-gen=true | ||||
| // +groupName=kubescheduler.config.k8s.io | ||||
|  | ||||
| package v1alpha2 // import "k8s.io/kube-scheduler/config/v1alpha2" | ||||
| @@ -0,0 +1,43 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	"k8s.io/apimachinery/pkg/runtime" | ||||
| 	"k8s.io/apimachinery/pkg/runtime/schema" | ||||
| ) | ||||
|  | ||||
| // 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: "v1alpha2"} | ||||
|  | ||||
| var ( | ||||
| 	// SchemeBuilder is the scheme builder with scheme init functions to run for this API package | ||||
| 	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) | ||||
| 	// AddToScheme is a global function that registers this API group & version to a scheme | ||||
| 	AddToScheme = SchemeBuilder.AddToScheme | ||||
| ) | ||||
|  | ||||
| // addKnownTypes registers known types to the given scheme | ||||
| func addKnownTypes(scheme *runtime.Scheme) error { | ||||
| 	scheme.AddKnownTypes(SchemeGroupVersion, | ||||
| 		&KubeSchedulerConfiguration{}, | ||||
| 	) | ||||
| 	return nil | ||||
| } | ||||
							
								
								
									
										228
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/types.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										228
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/types.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,228 @@ | ||||
| /* | ||||
| Copyright 2020 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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| 	"k8s.io/apimachinery/pkg/runtime" | ||||
| 	componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	// SchedulerDefaultLockObjectNamespace defines default scheduler lock object namespace ("kube-system") | ||||
| 	SchedulerDefaultLockObjectNamespace string = metav1.NamespaceSystem | ||||
|  | ||||
| 	// SchedulerDefaultLockObjectName defines default scheduler lock object name ("kube-scheduler") | ||||
| 	SchedulerDefaultLockObjectName = "kube-scheduler" | ||||
|  | ||||
| 	// SchedulerDefaultProviderName defines the default provider names | ||||
| 	SchedulerDefaultProviderName = "DefaultProvider" | ||||
| ) | ||||
|  | ||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||
|  | ||||
| // KubeSchedulerConfiguration configures a scheduler | ||||
| type KubeSchedulerConfiguration struct { | ||||
| 	metav1.TypeMeta `json:",inline"` | ||||
|  | ||||
| 	// SchedulerName is name of the scheduler, used to select which pods | ||||
| 	// will be processed by this scheduler, based on pod's "spec.SchedulerName". | ||||
| 	SchedulerName *string `json:"schedulerName,omitempty"` | ||||
| 	// AlgorithmSource specifies the scheduler algorithm source. | ||||
| 	AlgorithmSource SchedulerAlgorithmSource `json:"algorithmSource"` | ||||
| 	// RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule | ||||
| 	// corresponding to every RequiredDuringScheduling affinity rule. | ||||
| 	// HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 0-100. | ||||
| 	HardPodAffinitySymmetricWeight *int32 `json:"hardPodAffinitySymmetricWeight,omitempty"` | ||||
|  | ||||
| 	// LeaderElection defines the configuration of leader election client. | ||||
| 	LeaderElection KubeSchedulerLeaderElectionConfiguration `json:"leaderElection"` | ||||
|  | ||||
| 	// ClientConnection specifies the kubeconfig file and client connection | ||||
| 	// settings for the proxy server to use when communicating with the apiserver. | ||||
| 	ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` | ||||
| 	// HealthzBindAddress is the IP address and port for the health check server to serve on, | ||||
| 	// defaulting to 0.0.0.0:10251 | ||||
| 	HealthzBindAddress *string `json:"healthzBindAddress,omitempty"` | ||||
| 	// MetricsBindAddress is the IP address and port for the metrics server to | ||||
| 	// serve on, defaulting to 0.0.0.0:10251. | ||||
| 	MetricsBindAddress *string `json:"metricsBindAddress,omitempty"` | ||||
|  | ||||
| 	// DebuggingConfiguration holds configuration for Debugging related features | ||||
| 	// TODO: We might wanna make this a substruct like Debugging componentbaseconfigv1alpha1.DebuggingConfiguration | ||||
| 	componentbaseconfigv1alpha1.DebuggingConfiguration `json:",inline"` | ||||
|  | ||||
| 	// DisablePreemption disables the pod preemption feature. | ||||
| 	DisablePreemption *bool `json:"disablePreemption,omitempty"` | ||||
|  | ||||
| 	// PercentageOfNodeToScore is the percentage of all nodes that once found feasible | ||||
| 	// for running a pod, the scheduler stops its search for more feasible nodes in | ||||
| 	// the cluster. This helps improve scheduler's performance. Scheduler always tries to find | ||||
| 	// at least "minFeasibleNodesToFind" feasible nodes no matter what the value of this flag is. | ||||
| 	// Example: if the cluster size is 500 nodes and the value of this flag is 30, | ||||
| 	// then scheduler stops finding further feasible nodes once it finds 150 feasible ones. | ||||
| 	// When the value is 0, default percentage (5%--50% based on the size of the cluster) of the | ||||
| 	// nodes will be scored. | ||||
| 	PercentageOfNodesToScore *int32 `json:"percentageOfNodesToScore,omitempty"` | ||||
|  | ||||
| 	// Duration to wait for a binding operation to complete before timing out | ||||
| 	// Value must be non-negative integer. The value zero indicates no waiting. | ||||
| 	// If this value is nil, the default value will be used. | ||||
| 	BindTimeoutSeconds *int64 `json:"bindTimeoutSeconds"` | ||||
|  | ||||
| 	// PodInitialBackoffSeconds is the initial backoff for unschedulable pods. | ||||
| 	// If specified, it must be greater than 0. If this value is null, the default value (1s) | ||||
| 	// will be used. | ||||
| 	PodInitialBackoffSeconds *int64 `json:"podInitialBackoffSeconds"` | ||||
|  | ||||
| 	// PodMaxBackoffSeconds is the max backoff for unschedulable pods. | ||||
| 	// If specified, it must be greater than podInitialBackoffSeconds. If this value is null, | ||||
| 	// the default value (10s) will be used. | ||||
| 	PodMaxBackoffSeconds *int64 `json:"podMaxBackoffSeconds"` | ||||
|  | ||||
| 	// Plugins specify the set of plugins that should be enabled or disabled. Enabled plugins are the | ||||
| 	// ones that should be enabled in addition to the default plugins. Disabled plugins are any of the | ||||
| 	// default plugins that should be disabled. | ||||
| 	// When no enabled or disabled plugin is specified for an extension point, default plugins for | ||||
| 	// that extension point will be used if there is any. | ||||
| 	Plugins *Plugins `json:"plugins,omitempty"` | ||||
|  | ||||
| 	// PluginConfig is an optional set of custom plugin arguments for each plugin. | ||||
| 	// Omitting config args for a plugin is equivalent to using the default config for that plugin. | ||||
| 	// +listType=map | ||||
| 	// +listMapKey=name | ||||
| 	PluginConfig []PluginConfig `json:"pluginConfig,omitempty"` | ||||
| } | ||||
|  | ||||
| // SchedulerAlgorithmSource is the source of a scheduler algorithm. One source | ||||
| // field must be specified, and source fields are mutually exclusive. | ||||
| type SchedulerAlgorithmSource struct { | ||||
| 	// Policy is a policy based algorithm source. | ||||
| 	Policy *SchedulerPolicySource `json:"policy,omitempty"` | ||||
| 	// Provider is the name of a scheduling algorithm provider to use. | ||||
| 	Provider *string `json:"provider,omitempty"` | ||||
| } | ||||
|  | ||||
| // SchedulerPolicySource configures a means to obtain a scheduler Policy. One | ||||
| // source field must be specified, and source fields are mutually exclusive. | ||||
| type SchedulerPolicySource struct { | ||||
| 	// File is a file policy source. | ||||
| 	File *SchedulerPolicyFileSource `json:"file,omitempty"` | ||||
| 	// ConfigMap is a config map policy source. | ||||
| 	ConfigMap *SchedulerPolicyConfigMapSource `json:"configMap,omitempty"` | ||||
| } | ||||
|  | ||||
| // SchedulerPolicyFileSource is a policy serialized to disk and accessed via | ||||
| // path. | ||||
| type SchedulerPolicyFileSource struct { | ||||
| 	// Path is the location of a serialized policy. | ||||
| 	Path string `json:"path"` | ||||
| } | ||||
|  | ||||
| // SchedulerPolicyConfigMapSource is a policy serialized into a config map value | ||||
| // under the SchedulerPolicyConfigMapKey key. | ||||
| type SchedulerPolicyConfigMapSource struct { | ||||
| 	// Namespace is the namespace of the policy config map. | ||||
| 	Namespace string `json:"namespace"` | ||||
| 	// Name is the name of hte policy config map. | ||||
| 	Name string `json:"name"` | ||||
| } | ||||
|  | ||||
| // KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration | ||||
| // to include scheduler specific configuration. | ||||
| type KubeSchedulerLeaderElectionConfiguration struct { | ||||
| 	componentbaseconfigv1alpha1.LeaderElectionConfiguration `json:",inline"` | ||||
| 	// LockObjectNamespace defines the namespace of the lock object | ||||
| 	// DEPRECATED: will be removed in favor of resourceNamespace | ||||
| 	LockObjectNamespace string `json:"lockObjectNamespace"` | ||||
| 	// LockObjectName defines the lock object name | ||||
| 	// DEPRECATED: will be removed in favor of resourceName | ||||
| 	LockObjectName string `json:"lockObjectName"` | ||||
| } | ||||
|  | ||||
| // Plugins include multiple extension points. When specified, the list of plugins for | ||||
| // a particular extension point are the only ones enabled. If an extension point is | ||||
| // omitted from the config, then the default set of plugins is used for that extension point. | ||||
| // Enabled plugins are called in the order specified here, after default plugins. If they need to | ||||
| // 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"` | ||||
|  | ||||
| 	// PreFilter is a list of plugins that should be invoked at "PreFilter" extension point of the scheduling framework. | ||||
| 	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"` | ||||
|  | ||||
| 	// PostFilter is a list of plugins that are invoked after filtering out infeasible nodes. | ||||
| 	PostFilter *PluginSet `json:"postFilter,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"` | ||||
|  | ||||
| 	// Reserve is a list of plugins invoked when reserving a node to run the pod. | ||||
| 	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"` | ||||
|  | ||||
| 	// PreBind is a list of plugins that should be invoked before a pod is bound. | ||||
| 	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"` | ||||
|  | ||||
| 	// PostBind is a list of plugins that should be invoked after a pod is successfully bound. | ||||
| 	PostBind *PluginSet `json:"postBind,omitempty"` | ||||
|  | ||||
| 	// Unreserve is a list of plugins invoked when a pod that was previously reserved is rejected in a later phase. | ||||
| 	Unreserve *PluginSet `json:"unreserve,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. | ||||
| 	// These are called after default plugins and in the same order specified here. | ||||
| 	// +listType=atomic | ||||
| 	Enabled []Plugin `json:"enabled,omitempty"` | ||||
| 	// Disabled specifies default plugins that should be disabled. | ||||
| 	// When all default plugins need to be disabled, an array containing only one "*" should be provided. | ||||
| 	// +listType=map | ||||
| 	// +listMapKey=name | ||||
| 	Disabled []Plugin `json:"disabled,omitempty"` | ||||
| } | ||||
|  | ||||
| // Plugin specifies a plugin name and its weight when applicable. Weight is used only for Score plugins. | ||||
| type Plugin struct { | ||||
| 	// Name defines the name of plugin | ||||
| 	Name string `json:"name"` | ||||
| 	// Weight defines the weight of plugin, only used for Score plugins. | ||||
| 	Weight *int32 `json:"weight,omitempty"` | ||||
| } | ||||
|  | ||||
| // PluginConfig specifies arguments that should be passed to a plugin at the time of initialization. | ||||
| // A plugin that is invoked at multiple extension points is initialized once. Args can have arbitrary structure. | ||||
| // It is up to the plugin to process these Args. | ||||
| type PluginConfig struct { | ||||
| 	// Name defines the name of plugin being configured | ||||
| 	Name string `json:"name"` | ||||
| 	// Args defines the arguments passed to the plugins at the time of initialization. Args can have arbitrary structure. | ||||
| 	Args runtime.Unknown `json:"args,omitempty"` | ||||
| } | ||||
							
								
								
									
										351
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/zz_generated.deepcopy.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										351
									
								
								staging/src/k8s.io/kube-scheduler/config/v1alpha2/zz_generated.deepcopy.go
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,351 @@ | ||||
| // +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 v1alpha2 | ||||
|  | ||||
| import ( | ||||
| 	runtime "k8s.io/apimachinery/pkg/runtime" | ||||
| ) | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *KubeSchedulerConfiguration) DeepCopyInto(out *KubeSchedulerConfiguration) { | ||||
| 	*out = *in | ||||
| 	out.TypeMeta = in.TypeMeta | ||||
| 	if in.SchedulerName != nil { | ||||
| 		in, out := &in.SchedulerName, &out.SchedulerName | ||||
| 		*out = new(string) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	in.AlgorithmSource.DeepCopyInto(&out.AlgorithmSource) | ||||
| 	if in.HardPodAffinitySymmetricWeight != nil { | ||||
| 		in, out := &in.HardPodAffinitySymmetricWeight, &out.HardPodAffinitySymmetricWeight | ||||
| 		*out = new(int32) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	in.LeaderElection.DeepCopyInto(&out.LeaderElection) | ||||
| 	out.ClientConnection = in.ClientConnection | ||||
| 	if in.HealthzBindAddress != nil { | ||||
| 		in, out := &in.HealthzBindAddress, &out.HealthzBindAddress | ||||
| 		*out = new(string) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.MetricsBindAddress != nil { | ||||
| 		in, out := &in.MetricsBindAddress, &out.MetricsBindAddress | ||||
| 		*out = new(string) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	in.DebuggingConfiguration.DeepCopyInto(&out.DebuggingConfiguration) | ||||
| 	if in.DisablePreemption != nil { | ||||
| 		in, out := &in.DisablePreemption, &out.DisablePreemption | ||||
| 		*out = new(bool) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.PercentageOfNodesToScore != nil { | ||||
| 		in, out := &in.PercentageOfNodesToScore, &out.PercentageOfNodesToScore | ||||
| 		*out = new(int32) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.BindTimeoutSeconds != nil { | ||||
| 		in, out := &in.BindTimeoutSeconds, &out.BindTimeoutSeconds | ||||
| 		*out = new(int64) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.PodInitialBackoffSeconds != nil { | ||||
| 		in, out := &in.PodInitialBackoffSeconds, &out.PodInitialBackoffSeconds | ||||
| 		*out = new(int64) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.PodMaxBackoffSeconds != nil { | ||||
| 		in, out := &in.PodMaxBackoffSeconds, &out.PodMaxBackoffSeconds | ||||
| 		*out = new(int64) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.Plugins != nil { | ||||
| 		in, out := &in.Plugins, &out.Plugins | ||||
| 		*out = new(Plugins) | ||||
| 		(*in).DeepCopyInto(*out) | ||||
| 	} | ||||
| 	if in.PluginConfig != nil { | ||||
| 		in, out := &in.PluginConfig, &out.PluginConfig | ||||
| 		*out = make([]PluginConfig, len(*in)) | ||||
| 		for i := range *in { | ||||
| 			(*in)[i].DeepCopyInto(&(*out)[i]) | ||||
| 		} | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeSchedulerConfiguration. | ||||
| func (in *KubeSchedulerConfiguration) DeepCopy() *KubeSchedulerConfiguration { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(KubeSchedulerConfiguration) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. | ||||
| func (in *KubeSchedulerConfiguration) 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 *KubeSchedulerLeaderElectionConfiguration) DeepCopyInto(out *KubeSchedulerLeaderElectionConfiguration) { | ||||
| 	*out = *in | ||||
| 	in.LeaderElectionConfiguration.DeepCopyInto(&out.LeaderElectionConfiguration) | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeSchedulerLeaderElectionConfiguration. | ||||
| func (in *KubeSchedulerLeaderElectionConfiguration) DeepCopy() *KubeSchedulerLeaderElectionConfiguration { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(KubeSchedulerLeaderElectionConfiguration) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // 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 | ||||
| 	if in.Weight != nil { | ||||
| 		in, out := &in.Weight, &out.Weight | ||||
| 		*out = new(int32) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin. | ||||
| func (in *Plugin) DeepCopy() *Plugin { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(Plugin) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *PluginConfig) DeepCopyInto(out *PluginConfig) { | ||||
| 	*out = *in | ||||
| 	in.Args.DeepCopyInto(&out.Args) | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginConfig. | ||||
| func (in *PluginConfig) DeepCopy() *PluginConfig { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(PluginConfig) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *PluginSet) DeepCopyInto(out *PluginSet) { | ||||
| 	*out = *in | ||||
| 	if in.Enabled != nil { | ||||
| 		in, out := &in.Enabled, &out.Enabled | ||||
| 		*out = make([]Plugin, len(*in)) | ||||
| 		for i := range *in { | ||||
| 			(*in)[i].DeepCopyInto(&(*out)[i]) | ||||
| 		} | ||||
| 	} | ||||
| 	if in.Disabled != nil { | ||||
| 		in, out := &in.Disabled, &out.Disabled | ||||
| 		*out = make([]Plugin, len(*in)) | ||||
| 		for i := range *in { | ||||
| 			(*in)[i].DeepCopyInto(&(*out)[i]) | ||||
| 		} | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginSet. | ||||
| func (in *PluginSet) DeepCopy() *PluginSet { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(PluginSet) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // 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.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) | ||||
| 	} | ||||
| 	if in.Unreserve != nil { | ||||
| 		in, out := &in.Unreserve, &out.Unreserve | ||||
| 		*out = new(PluginSet) | ||||
| 		(*in).DeepCopyInto(*out) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugins. | ||||
| func (in *Plugins) DeepCopy() *Plugins { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(Plugins) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *SchedulerAlgorithmSource) DeepCopyInto(out *SchedulerAlgorithmSource) { | ||||
| 	*out = *in | ||||
| 	if in.Policy != nil { | ||||
| 		in, out := &in.Policy, &out.Policy | ||||
| 		*out = new(SchedulerPolicySource) | ||||
| 		(*in).DeepCopyInto(*out) | ||||
| 	} | ||||
| 	if in.Provider != nil { | ||||
| 		in, out := &in.Provider, &out.Provider | ||||
| 		*out = new(string) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerAlgorithmSource. | ||||
| func (in *SchedulerAlgorithmSource) DeepCopy() *SchedulerAlgorithmSource { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(SchedulerAlgorithmSource) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *SchedulerPolicyConfigMapSource) DeepCopyInto(out *SchedulerPolicyConfigMapSource) { | ||||
| 	*out = *in | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerPolicyConfigMapSource. | ||||
| func (in *SchedulerPolicyConfigMapSource) DeepCopy() *SchedulerPolicyConfigMapSource { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(SchedulerPolicyConfigMapSource) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *SchedulerPolicyFileSource) DeepCopyInto(out *SchedulerPolicyFileSource) { | ||||
| 	*out = *in | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerPolicyFileSource. | ||||
| func (in *SchedulerPolicyFileSource) DeepCopy() *SchedulerPolicyFileSource { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(SchedulerPolicyFileSource) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
|  | ||||
| // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. | ||||
| func (in *SchedulerPolicySource) DeepCopyInto(out *SchedulerPolicySource) { | ||||
| 	*out = *in | ||||
| 	if in.File != nil { | ||||
| 		in, out := &in.File, &out.File | ||||
| 		*out = new(SchedulerPolicyFileSource) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	if in.ConfigMap != nil { | ||||
| 		in, out := &in.ConfigMap, &out.ConfigMap | ||||
| 		*out = new(SchedulerPolicyConfigMapSource) | ||||
| 		**out = **in | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerPolicySource. | ||||
| func (in *SchedulerPolicySource) DeepCopy() *SchedulerPolicySource { | ||||
| 	if in == nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	out := new(SchedulerPolicySource) | ||||
| 	in.DeepCopyInto(out) | ||||
| 	return out | ||||
| } | ||||
							
								
								
									
										1
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @@ -1765,6 +1765,7 @@ k8s.io/kube-proxy/config/v1alpha1 | ||||
| # k8s.io/kube-scheduler v0.0.0 => ./staging/src/k8s.io/kube-scheduler | ||||
| k8s.io/kube-scheduler/config/v1 | ||||
| k8s.io/kube-scheduler/config/v1alpha1 | ||||
| k8s.io/kube-scheduler/config/v1alpha2 | ||||
| # k8s.io/kubectl v0.0.0 => ./staging/src/k8s.io/kubectl | ||||
| k8s.io/kubectl/pkg/apps | ||||
| k8s.io/kubectl/pkg/cmd | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot