Skip to content

Commit

Permalink
Remove deprecated fields from kubescheduler.config.k8s.io/v1alpha2
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Culquicondor <[email protected]>
  • Loading branch information
alculquicondor committed Feb 6, 2020
1 parent 6858c25 commit 1071eb8
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 303 deletions.
9 changes: 1 addition & 8 deletions pkg/scheduler/apis/config/v1alpha2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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",
Expand All @@ -27,16 +26,10 @@ go_library(

go_test(
name = "go_default_test",
srcs = [
"conversion_test.go",
"defaults_test.go",
],
srcs = ["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",
Expand Down
68 changes: 0 additions & 68 deletions pkg/scheduler/apis/config/v1alpha2/conversion.go

This file was deleted.

193 changes: 0 additions & 193 deletions pkg/scheduler/apis/config/v1alpha2/conversion_test.go

This file was deleted.

8 changes: 4 additions & 4 deletions pkg/scheduler/apis/config/v1alpha2/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1alpha2.KubeSchedulerConfigura
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.ResourceNamespace) == 0 {
obj.LeaderElection.ResourceNamespace = v1alpha2.SchedulerDefaultLockObjectNamespace
}
if len(obj.LeaderElection.LockObjectName) == 0 && len(obj.LeaderElection.ResourceName) == 0 {
obj.LeaderElection.LockObjectName = v1alpha2.SchedulerDefaultLockObjectName
if len(obj.LeaderElection.ResourceName) == 0 {
obj.LeaderElection.ResourceName = v1alpha2.SchedulerDefaultLockObjectName
}

if len(obj.ClientConnection.ContentType) == 0 {
Expand Down
18 changes: 6 additions & 12 deletions pkg/scheduler/apis/config/v1alpha2/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ func TestSchedulerDefaults(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second},
ResourceLock: "endpointsleases",
ResourceNamespace: "",
ResourceName: "",
ResourceNamespace: "kube-system",
ResourceName: "kube-scheduler",
},
LockObjectName: "kube-scheduler",
LockObjectNamespace: "kube-system",
},
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 50,
Expand Down Expand Up @@ -96,11 +94,9 @@ func TestSchedulerDefaults(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second},
ResourceLock: "endpointsleases",
ResourceNamespace: "",
ResourceName: "",
ResourceNamespace: "kube-system",
ResourceName: "kube-scheduler",
},
LockObjectName: "kube-scheduler",
LockObjectNamespace: "kube-system",
},
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 50,
Expand Down Expand Up @@ -138,11 +134,9 @@ func TestSchedulerDefaults(t *testing.T) {
RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
RetryPeriod: metav1.Duration{Duration: 2 * time.Second},
ResourceLock: "endpointsleases",
ResourceNamespace: "",
ResourceName: "",
ResourceNamespace: "kube-system",
ResourceName: "kube-scheduler",
},
LockObjectName: "kube-scheduler",
LockObjectNamespace: "kube-system",
},
ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
QPS: 50,
Expand Down
Loading

0 comments on commit 1071eb8

Please sign in to comment.