Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Kube OVN
Commits
10fd3330
Unverified
Commit
10fd3330
authored
2 years ago
by
张祖建
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix duplicate logs for leader election (#1886)
parent
13ebb855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/controller/election.go
+6
-2
pkg/controller/election.go
with
6 additions
and
2 deletions
+6
-2
pkg/controller/election.go
+
6
-
2
View file @
10fd3330
...
...
@@ -44,13 +44,17 @@ func (c *Controller) leaderElection() {
PodName
:
c
.
config
.
PodName
,
PodNamespace
:
c
.
config
.
PodNamespace
,
}
c
.
elector
=
setupLeaderElection
(
config
)
var
flag
bool
for
{
if
c
.
isLeader
()
{
return
}
klog
.
Info
(
"waiting for becoming a leader"
)
if
!
flag
{
klog
.
Info
(
"waiting for becoming a leader"
)
flag
=
true
}
time
.
Sleep
(
5
*
time
.
Second
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help