Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e333ba06
Commit
e333ba06
authored
May 03, 2018
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scheduler: remove nested retry loops
parent
a3a52a8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
BUILD
cmd/kube-scheduler/app/BUILD
+0
-1
server.go
cmd/kube-scheduler/app/server.go
+7
-15
No files found.
cmd/kube-scheduler/app/BUILD
View file @
e333ba06
...
@@ -32,7 +32,6 @@ go_library(
...
@@ -32,7 +32,6 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library",
"//vendor/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library",
"//vendor/k8s.io/apiserver/pkg/endpoints/filters:go_default_library",
"//vendor/k8s.io/apiserver/pkg/endpoints/filters:go_default_library",
...
...
cmd/kube-scheduler/app/server.go
View file @
e333ba06
...
@@ -23,13 +23,11 @@ import (
...
@@ -23,13 +23,11 @@ import (
"net/http"
"net/http"
"os"
"os"
goruntime
"runtime"
goruntime
"runtime"
"time"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
utilruntime
"k8s.io/apimachinery/pkg/util/runtime"
utilruntime
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/authentication/authenticator"
"k8s.io/apiserver/pkg/authentication/authenticator"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/authorization/authorizer"
genericapifilters
"k8s.io/apiserver/pkg/endpoints/filters"
genericapifilters
"k8s.io/apiserver/pkg/endpoints/filters"
...
@@ -154,21 +152,15 @@ func Run(c schedulerserverconfig.CompletedConfig, stopCh <-chan struct{}) error
...
@@ -154,21 +152,15 @@ func Run(c schedulerserverconfig.CompletedConfig, stopCh <-chan struct{}) error
if
c
.
InsecureServing
!=
nil
{
if
c
.
InsecureServing
!=
nil
{
separateMetrics
:=
c
.
InsecureMetricsServing
!=
nil
separateMetrics
:=
c
.
InsecureMetricsServing
!=
nil
handler
:=
buildHandlerChain
(
newHealthzHandler
(
&
c
.
ComponentConfig
,
separateMetrics
),
nil
,
nil
)
handler
:=
buildHandlerChain
(
newHealthzHandler
(
&
c
.
ComponentConfig
,
separateMetrics
),
nil
,
nil
)
// TODO: fail early as all other Kubernetes binaries
if
err
:=
c
.
InsecureServing
.
Serve
(
handler
,
0
,
stopCh
);
err
!=
nil
{
go
wait
.
Until
(
func
()
{
return
fmt
.
Errorf
(
"failed to start healthz server: %v"
,
err
)
if
err
:=
c
.
InsecureServing
.
Serve
(
handler
,
0
,
stopCh
);
err
!=
nil
{
}
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"failed to start healthz server: %v"
,
err
))
}
},
5
*
time
.
Second
,
stopCh
)
}
}
if
c
.
InsecureServing
!=
nil
{
if
c
.
Insecure
Metrics
Serving
!=
nil
{
handler
:=
buildHandlerChain
(
newMetricsHandler
(
&
c
.
ComponentConfig
),
nil
,
nil
)
handler
:=
buildHandlerChain
(
newMetricsHandler
(
&
c
.
ComponentConfig
),
nil
,
nil
)
// TODO: fail early as all other Kubernetes binaries
if
err
:=
c
.
InsecureMetricsServing
.
Serve
(
handler
,
0
,
stopCh
);
err
!=
nil
{
go
wait
.
Until
(
func
()
{
return
fmt
.
Errorf
(
"failed to start metrics server: %v"
,
err
)
if
err
:=
c
.
InsecureServing
.
Serve
(
handler
,
0
,
stopCh
);
err
!=
nil
{
}
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"failed to start metrics server: %v"
,
err
))
}
},
5
*
time
.
Second
,
stopCh
)
}
}
if
c
.
SecureServing
!=
nil
{
if
c
.
SecureServing
!=
nil
{
handler
:=
buildHandlerChain
(
newHealthzHandler
(
&
c
.
ComponentConfig
,
false
),
c
.
Authentication
.
Authenticator
,
c
.
Authorization
.
Authorizer
)
handler
:=
buildHandlerChain
(
newHealthzHandler
(
&
c
.
ComponentConfig
,
false
),
c
.
Authentication
.
Authenticator
,
c
.
Authorization
.
Authorizer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment