mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #110567 from xiaomudk/patch-2
Remove redundant variable definitions in scheduler apis defaults.go
This commit is contained in:
commit
a57c140a12
@ -121,8 +121,7 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1beta2.KubeSchedulerConfigurat
|
||||
}
|
||||
|
||||
if obj.PercentageOfNodesToScore == nil {
|
||||
percentageOfNodesToScore := int32(config.DefaultPercentageOfNodesToScore)
|
||||
obj.PercentageOfNodesToScore = &percentageOfNodesToScore
|
||||
obj.PercentageOfNodesToScore = pointer.Int32Ptr(config.DefaultPercentageOfNodesToScore)
|
||||
}
|
||||
|
||||
if len(obj.LeaderElection.ResourceLock) == 0 {
|
||||
@ -153,25 +152,21 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1beta2.KubeSchedulerConfigurat
|
||||
componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
|
||||
|
||||
if obj.PodInitialBackoffSeconds == nil {
|
||||
val := int64(1)
|
||||
obj.PodInitialBackoffSeconds = &val
|
||||
obj.PodInitialBackoffSeconds = pointer.Int64(1)
|
||||
}
|
||||
|
||||
if obj.PodMaxBackoffSeconds == nil {
|
||||
val := int64(10)
|
||||
obj.PodMaxBackoffSeconds = &val
|
||||
obj.PodMaxBackoffSeconds = pointer.Int64(10)
|
||||
}
|
||||
|
||||
// Enable profiling by default in the scheduler
|
||||
if obj.EnableProfiling == nil {
|
||||
enableProfiling := true
|
||||
obj.EnableProfiling = &enableProfiling
|
||||
obj.EnableProfiling = pointer.BoolPtr(true)
|
||||
}
|
||||
|
||||
// Enable contention profiling by default if profiling is enabled
|
||||
if *obj.EnableProfiling && obj.EnableContentionProfiling == nil {
|
||||
enableContentionProfiling := true
|
||||
obj.EnableContentionProfiling = &enableContentionProfiling
|
||||
obj.EnableContentionProfiling = pointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,25 +153,21 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1beta3.KubeSchedulerConfigurat
|
||||
componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
|
||||
|
||||
if obj.PodInitialBackoffSeconds == nil {
|
||||
val := int64(1)
|
||||
obj.PodInitialBackoffSeconds = &val
|
||||
obj.PodInitialBackoffSeconds = pointer.Int64(1)
|
||||
}
|
||||
|
||||
if obj.PodMaxBackoffSeconds == nil {
|
||||
val := int64(10)
|
||||
obj.PodMaxBackoffSeconds = &val
|
||||
obj.PodMaxBackoffSeconds = pointer.Int64(10)
|
||||
}
|
||||
|
||||
// Enable profiling by default in the scheduler
|
||||
if obj.EnableProfiling == nil {
|
||||
enableProfiling := true
|
||||
obj.EnableProfiling = &enableProfiling
|
||||
obj.EnableProfiling = pointer.BoolPtr(true)
|
||||
}
|
||||
|
||||
// Enable contention profiling by default if profiling is enabled
|
||||
if *obj.EnableProfiling && obj.EnableContentionProfiling == nil {
|
||||
enableContentionProfiling := true
|
||||
obj.EnableContentionProfiling = &enableContentionProfiling
|
||||
obj.EnableContentionProfiling = pointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user