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
100f4d19
Commit
100f4d19
authored
Oct 20, 2021
by
Brad Davidson
Committed by
Brad Davidson
Mar 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass context in to embedded etcd so that it can be stopped
Partial cherry-pick from
29c8b238
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
4fa89524
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
etcd.go
pkg/daemons/executor/etcd.go
+5
-1
executor.go
pkg/daemons/executor/executor.go
+3
-3
etcd.go
pkg/etcd/etcd.go
+1
-1
No files found.
pkg/daemons/executor/etcd.go
View file @
100f4d19
...
...
@@ -4,6 +4,7 @@
package
executor
import
(
"context"
"io/ioutil"
"path/filepath"
"strings"
...
...
@@ -18,7 +19,7 @@ func (e Embedded) CurrentETCDOptions() (InitialOptions, error) {
return
InitialOptions
{},
nil
}
func
(
e
Embedded
)
ETCD
(
args
ETCDConfig
,
extraArgs
[]
string
)
error
{
func
(
e
Embedded
)
ETCD
(
ctx
context
.
Context
,
args
ETCDConfig
,
extraArgs
[]
string
)
error
{
configFile
,
err
:=
args
.
ToConfigFile
(
extraArgs
)
if
err
!=
nil
{
return
err
...
...
@@ -45,6 +46,9 @@ func (e Embedded) ETCD(args ETCDConfig, extraArgs []string) error {
return
}
case
<-
ctx
.
Done
()
:
logrus
.
Infof
(
"stopping etcd"
)
etcd
.
Close
()
case
<-
etcd
.
Server
.
StopNotify
()
:
logrus
.
Fatalf
(
"etcd stopped"
)
case
err
:=
<-
etcd
.
Err
()
:
...
...
pkg/daemons/executor/executor.go
View file @
100f4d19
...
...
@@ -30,7 +30,7 @@ type Executor interface {
Scheduler
(
apiReady
<-
chan
struct
{},
args
[]
string
)
error
ControllerManager
(
apiReady
<-
chan
struct
{},
args
[]
string
)
error
CurrentETCDOptions
()
(
InitialOptions
,
error
)
ETCD
(
args
ETCDConfig
,
extraArgs
[]
string
)
error
ETCD
(
ctx
context
.
Context
,
args
ETCDConfig
,
extraArgs
[]
string
)
error
CloudControllerManager
(
ccmRBACReady
<-
chan
struct
{},
args
[]
string
)
error
}
...
...
@@ -161,8 +161,8 @@ func CurrentETCDOptions() (InitialOptions, error) {
return
executor
.
CurrentETCDOptions
()
}
func
ETCD
(
args
ETCDConfig
,
extraArgs
[]
string
)
error
{
return
executor
.
ETCD
(
args
,
extraArgs
)
func
ETCD
(
ctx
context
.
Context
,
args
ETCDConfig
,
extraArgs
[]
string
)
error
{
return
executor
.
ETCD
(
ctx
,
args
,
extraArgs
)
}
func
CloudControllerManager
(
ccmRBACReady
<-
chan
struct
{},
args
[]
string
)
error
{
...
...
pkg/etcd/etcd.go
View file @
100f4d19
...
...
@@ -616,7 +616,7 @@ func (e *ETCD) metricsURL(expose bool) string {
// cluster returns ETCDConfig for a cluster
func
(
e
*
ETCD
)
cluster
(
ctx
context
.
Context
,
forceNew
bool
,
options
executor
.
InitialOptions
)
error
{
return
executor
.
ETCD
(
executor
.
ETCDConfig
{
return
executor
.
ETCD
(
ctx
,
executor
.
ETCDConfig
{
Name
:
e
.
name
,
InitialOptions
:
options
,
ForceNewCluster
:
forceNew
,
...
...
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