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
4ecd54f4
Commit
4ecd54f4
authored
Nov 10, 2017
by
mrahbar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extracted elasticsearch-logging service name as environment variable…
extracted elasticsearch-logging service name as environment variable ELASTICSEARCH_SERVICE_NAME with fallback on default
parent
2794f0f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
elasticsearch_logging_discovery.go
...elasticsearch/es-image/elasticsearch_logging_discovery.go
+7
-2
No files found.
cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go
View file @
4ecd54f4
...
@@ -81,10 +81,15 @@ func main() {
...
@@ -81,10 +81,15 @@ func main() {
}
}
var
elasticsearch
*
api
.
Service
var
elasticsearch
*
api
.
Service
serviceName
:=
os
.
Getenv
(
"ELASTICSEARCH_SERVICE_NAME"
)
if
serviceName
==
""
{
serviceName
=
"elasticsearch-logging"
}
// Look for endpoints associated with the Elasticsearch loggging service.
// Look for endpoints associated with the Elasticsearch loggging service.
// First wait for the service to become available.
// First wait for the service to become available.
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
elasticsearch
,
err
=
client
.
Core
()
.
Services
(
namespace
)
.
Get
(
"elasticsearch-logging"
,
metav1
.
GetOptions
{})
elasticsearch
,
err
=
client
.
Core
()
.
Services
(
namespace
)
.
Get
(
serviceName
,
metav1
.
GetOptions
{})
if
err
==
nil
{
if
err
==
nil
{
break
break
}
}
...
@@ -101,7 +106,7 @@ func main() {
...
@@ -101,7 +106,7 @@ func main() {
// Wait for some endpoints.
// Wait for some endpoints.
count
:=
0
count
:=
0
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
endpoints
,
err
=
client
.
Core
()
.
Endpoints
(
namespace
)
.
Get
(
"elasticsearch-logging"
,
metav1
.
GetOptions
{})
endpoints
,
err
=
client
.
Core
()
.
Endpoints
(
namespace
)
.
Get
(
serviceName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
continue
continue
}
}
...
...
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