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
0ee586c2
Unverified
Commit
0ee586c2
authored
Oct 16, 2019
by
Erik Wilson
Committed by
GitHub
Oct 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #894 from galal-hussein/fix_master_label_ha
Fix Master label in HA setups
parents
26518171
7c602854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
server.go
pkg/server/server.go
+11
-4
No files found.
pkg/server/server.go
View file @
0ee586c2
...
...
@@ -109,7 +109,7 @@ func startWrangler(ctx context.Context, config *Config) (string, error) {
return
""
,
err
}
if
err
:=
s
c
.
Start
(
ctx
);
err
!=
nil
{
if
err
:=
s
tartNodeCache
(
ctx
,
sc
);
err
!=
nil
{
return
""
,
err
}
...
...
@@ -122,7 +122,7 @@ func startWrangler(ctx context.Context, config *Config) (string, error) {
}
}
if
!
config
.
DisableAgent
{
go
setMasterRoleLabel
(
ctx
,
sc
,
config
)
go
setMasterRoleLabel
(
ctx
,
sc
)
}
if
controlConfig
.
NoLeaderElect
{
go
func
()
{
...
...
@@ -364,11 +364,12 @@ func isSymlink(config string) bool {
return
false
}
func
setMasterRoleLabel
(
ctx
context
.
Context
,
sc
*
Context
,
config
*
Config
)
error
{
func
setMasterRoleLabel
(
ctx
context
.
Context
,
sc
*
Context
)
error
{
for
{
nodeName
:=
os
.
Getenv
(
"NODE_NAME"
)
nodeController
:=
sc
.
Core
.
Core
()
.
V1
()
.
Node
()
nodeCached
,
err
:=
nodeController
.
Cache
()
.
Get
(
nodeName
)
nodeCache
:=
nodeController
.
Cache
()
nodeCached
,
err
:=
nodeCache
.
Get
(
nodeName
)
if
err
!=
nil
{
logrus
.
Infof
(
"Waiting for master node %s startup: %v"
,
nodeName
,
err
)
time
.
Sleep
(
1
*
time
.
Second
)
...
...
@@ -395,3 +396,9 @@ func setMasterRoleLabel(ctx context.Context, sc *Context, config *Config) error
}
return
nil
}
func
startNodeCache
(
ctx
context
.
Context
,
sc
*
Context
)
error
{
sc
.
Core
.
Core
()
.
V1
()
.
Node
()
.
Cache
()
return
sc
.
Start
(
ctx
)
}
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