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
7e6664b6
Commit
7e6664b6
authored
Jul 12, 2019
by
Erik Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add resource version to tunnel endpoint watch
parent
034a8636
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tunnel.go
pkg/agent/tunnel/tunnel.go
+5
-1
No files found.
pkg/agent/tunnel/tunnel.go
View file @
7e6664b6
...
...
@@ -68,10 +68,12 @@ func Setup(config *config.Node) error {
}
addresses
:=
[]
string
{
config
.
ServerAddress
}
endpointResourceVersion
:=
""
endpoint
,
_
:=
client
.
CoreV1
()
.
Endpoints
(
"default"
)
.
Get
(
"kubernetes"
,
metav1
.
GetOptions
{})
if
endpoint
!=
nil
{
addresses
=
getAddresses
(
endpoint
)
endpointResourceVersion
=
endpoint
.
ResourceVersion
}
disconnect
:=
map
[
string
]
context
.
CancelFunc
{}
...
...
@@ -88,7 +90,8 @@ func Setup(config *config.Node) error {
connect
:
for
{
watch
,
err
:=
client
.
CoreV1
()
.
Endpoints
(
"default"
)
.
Watch
(
metav1
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
"metadata.name"
:
"kubernetes"
}
.
String
(),
FieldSelector
:
fields
.
Set
{
"metadata.name"
:
"kubernetes"
}
.
String
(),
ResourceVersion
:
endpointResourceVersion
,
})
if
err
!=
nil
{
logrus
.
Errorf
(
"Unable to watch for tunnel endpoints: %v"
,
err
)
...
...
@@ -108,6 +111,7 @@ func Setup(config *config.Node) error {
logrus
.
Error
(
"Tunnel could not case event object to endpoint"
)
continue
watching
}
endpointResourceVersion
=
endpoint
.
ResourceVersion
var
addresses
=
getAddresses
(
endpoint
)
logrus
.
Infof
(
"Tunnel endpoint watch event: %v"
,
addresses
)
...
...
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