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
034a8636
Commit
034a8636
authored
Jul 10, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup remotedialer tunnel logs
parent
c18e896a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
tunnel.go
pkg/agent/tunnel/tunnel.go
+9
-6
No files found.
pkg/agent/tunnel/tunnel.go
View file @
034a8636
...
...
@@ -91,7 +91,7 @@ func Setup(config *config.Node) error {
FieldSelector
:
fields
.
Set
{
"metadata.name"
:
"kubernetes"
}
.
String
(),
})
if
err
!=
nil
{
logrus
.
Errorf
(
"Unable to watch for endpoints: %v"
,
err
)
logrus
.
Errorf
(
"Unable to watch for
tunnel
endpoints: %v"
,
err
)
time
.
Sleep
(
5
*
time
.
Second
)
continue
connect
}
...
...
@@ -100,21 +100,24 @@ func Setup(config *config.Node) error {
select
{
case
ev
,
ok
:=
<-
watch
.
ResultChan
()
:
if
!
ok
{
logrus
.
Error
(
"endpoint watch channel closed"
)
logrus
.
Error
(
"
Tunnel
endpoint watch channel closed"
)
continue
connect
}
endpoint
,
ok
:=
ev
.
Object
.
(
*
v1
.
Endpoints
)
if
!
ok
{
logrus
.
Error
(
"could not case event object to endpoint"
)
logrus
.
Error
(
"
Tunnel
could not case event object to endpoint"
)
continue
watching
}
validEndpoint
:=
map
[
string
]
bool
{}
var
addresses
=
getAddresses
(
endpoint
)
logrus
.
Infof
(
"Tunnel endpoint watch event: %v"
,
addresses
)
validEndpoint
:=
map
[
string
]
bool
{}
for
_
,
address
:=
range
addresses
{
validEndpoint
[
address
]
=
true
if
_
,
ok
:=
disconnect
[
address
];
!
ok
{
disconnect
[
address
]
=
connect
(
wg
,
address
,
config
,
transportConfig
)
disconnect
[
address
]
=
connect
(
nil
,
address
,
config
,
transportConfig
)
}
}
...
...
@@ -173,7 +176,7 @@ func connect(waitGroup *sync.WaitGroup, address string, config *config.Node, tra
})
if
ctx
.
Err
()
!=
nil
{
logrus
.
Infof
(
"Stopp
ing
tunnel to %s"
,
wsURL
)
logrus
.
Infof
(
"Stopp
ed
tunnel to %s"
,
wsURL
)
return
}
}
...
...
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