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
de6d2da9
Commit
de6d2da9
authored
Aug 26, 2019
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add back stopCh to cmd apis
parent
819d99b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
main.go
cmd/hyperkube/main.go
+5
-2
server.go
cmd/kube-apiserver/app/server.go
+2
-2
server.go
cmd/kubelet/app/server.go
+1
-5
No files found.
cmd/hyperkube/main.go
View file @
de6d2da9
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"errors"
"errors"
goflag
"flag"
goflag
"flag"
"fmt"
"fmt"
"k8s.io/apiserver/pkg/server"
"math/rand"
"math/rand"
"os"
"os"
"path"
"path"
...
@@ -85,12 +86,14 @@ func commandFor(basename string, defaultCommand *cobra.Command, commands []func(
...
@@ -85,12 +86,14 @@ func commandFor(basename string, defaultCommand *cobra.Command, commands []func(
func
NewHyperKubeCommand
()
(
*
cobra
.
Command
,
[]
func
()
*
cobra
.
Command
)
{
func
NewHyperKubeCommand
()
(
*
cobra
.
Command
,
[]
func
()
*
cobra
.
Command
)
{
// these have to be functions since the command is polymorphic. Cobra wants you to be top level
// these have to be functions since the command is polymorphic. Cobra wants you to be top level
// command to get executed
// command to get executed
apiserver
:=
func
()
*
cobra
.
Command
{
return
kubeapiserver
.
NewAPIServerCommand
()
}
stopCh
:=
server
.
SetupSignalHandler
()
apiserver
:=
func
()
*
cobra
.
Command
{
return
kubeapiserver
.
NewAPIServerCommand
(
stopCh
)
}
controller
:=
func
()
*
cobra
.
Command
{
return
kubecontrollermanager
.
NewControllerManagerCommand
()
}
controller
:=
func
()
*
cobra
.
Command
{
return
kubecontrollermanager
.
NewControllerManagerCommand
()
}
proxy
:=
func
()
*
cobra
.
Command
{
return
kubeproxy
.
NewProxyCommand
()
}
proxy
:=
func
()
*
cobra
.
Command
{
return
kubeproxy
.
NewProxyCommand
()
}
scheduler
:=
func
()
*
cobra
.
Command
{
return
kubescheduler
.
NewSchedulerCommand
()
}
scheduler
:=
func
()
*
cobra
.
Command
{
return
kubescheduler
.
NewSchedulerCommand
()
}
kubectlCmd
:=
func
()
*
cobra
.
Command
{
return
kubectl
.
NewDefaultKubectlCommand
()
}
kubectlCmd
:=
func
()
*
cobra
.
Command
{
return
kubectl
.
NewDefaultKubectlCommand
()
}
kubelet
:=
func
()
*
cobra
.
Command
{
return
kubelet
.
NewKubeletCommand
()
}
kubelet
:=
func
()
*
cobra
.
Command
{
return
kubelet
.
NewKubeletCommand
(
stopCh
)
}
commandFns
:=
[]
func
()
*
cobra
.
Command
{
commandFns
:=
[]
func
()
*
cobra
.
Command
{
apiserver
,
apiserver
,
...
...
cmd/kube-apiserver/app/server.go
View file @
de6d2da9
...
@@ -92,7 +92,7 @@ const (
...
@@ -92,7 +92,7 @@ const (
)
)
// NewAPIServerCommand creates a *cobra.Command object with default parameters
// NewAPIServerCommand creates a *cobra.Command object with default parameters
func
NewAPIServerCommand
()
*
cobra
.
Command
{
func
NewAPIServerCommand
(
stopCh
<-
chan
struct
{}
)
*
cobra
.
Command
{
s
:=
options
.
NewServerRunOptions
()
s
:=
options
.
NewServerRunOptions
()
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"kube-apiserver"
,
Use
:
"kube-apiserver"
,
...
@@ -115,7 +115,7 @@ cluster's shared state through which all other components interact.`,
...
@@ -115,7 +115,7 @@ cluster's shared state through which all other components interact.`,
return
utilerrors
.
NewAggregate
(
errs
)
return
utilerrors
.
NewAggregate
(
errs
)
}
}
return
Run
(
completedOptions
,
genericapiserver
.
SetupSignalHandler
()
)
return
Run
(
completedOptions
,
stopCh
)
},
},
}
}
...
...
cmd/kubelet/app/server.go
View file @
de6d2da9
...
@@ -46,7 +46,6 @@ import (
...
@@ -46,7 +46,6 @@ import (
utilruntime
"k8s.io/apimachinery/pkg/util/runtime"
utilruntime
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
genericapiserver
"k8s.io/apiserver/pkg/server"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/healthz"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
clientset
"k8s.io/client-go/kubernetes"
clientset
"k8s.io/client-go/kubernetes"
...
@@ -110,7 +109,7 @@ const (
...
@@ -110,7 +109,7 @@ const (
)
)
// NewKubeletCommand creates a *cobra.Command object with default parameters
// NewKubeletCommand creates a *cobra.Command object with default parameters
func
NewKubeletCommand
()
*
cobra
.
Command
{
func
NewKubeletCommand
(
stopCh
<-
chan
struct
{}
)
*
cobra
.
Command
{
cleanFlagSet
:=
pflag
.
NewFlagSet
(
componentKubelet
,
pflag
.
ContinueOnError
)
cleanFlagSet
:=
pflag
.
NewFlagSet
(
componentKubelet
,
pflag
.
ContinueOnError
)
cleanFlagSet
.
SetNormalizeFunc
(
cliflag
.
WordSepNormalizeFunc
)
cleanFlagSet
.
SetNormalizeFunc
(
cliflag
.
WordSepNormalizeFunc
)
kubeletFlags
:=
options
.
NewKubeletFlags
()
kubeletFlags
:=
options
.
NewKubeletFlags
()
...
@@ -256,9 +255,6 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
...
@@ -256,9 +255,6 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
// add the kubelet config controller to kubeletDeps
// add the kubelet config controller to kubeletDeps
kubeletDeps
.
KubeletConfigController
=
kubeletConfigController
kubeletDeps
.
KubeletConfigController
=
kubeletConfigController
// set up stopCh here in order to be reused by kubelet and docker shim
stopCh
:=
genericapiserver
.
SetupSignalHandler
()
// start the experimental docker shim, if enabled
// start the experimental docker shim, if enabled
if
kubeletServer
.
KubeletFlags
.
ExperimentalDockershim
{
if
kubeletServer
.
KubeletFlags
.
ExperimentalDockershim
{
if
err
:=
RunDockershim
(
&
kubeletServer
.
KubeletFlags
,
kubeletConfig
,
stopCh
);
err
!=
nil
{
if
err
:=
RunDockershim
(
&
kubeletServer
.
KubeletFlags
,
kubeletConfig
,
stopCh
);
err
!=
nil
{
...
...
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