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
8036f4b3
Commit
8036f4b3
authored
Jun 19, 2015
by
Satnam Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the label selector for Elasticsearch logging pods
parent
505d3413
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
es_cluster_logging.go
test/e2e/es_cluster_logging.go
+7
-2
No files found.
test/e2e/es_cluster_logging.go
View file @
8036f4b3
...
@@ -39,6 +39,11 @@ var _ = Describe("Cluster level logging using Elasticsearch", func() {
...
@@ -39,6 +39,11 @@ var _ = Describe("Cluster level logging using Elasticsearch", func() {
})
})
})
})
const
(
esKey
=
"k8s-app"
esValue
=
"elasticsearch-logging"
)
func
bodyToJSON
(
body
[]
byte
)
(
map
[
string
]
interface
{},
error
)
{
func
bodyToJSON
(
body
[]
byte
)
(
map
[
string
]
interface
{},
error
)
{
var
r
map
[
string
]
interface
{}
var
r
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
(
body
,
&
r
);
err
!=
nil
{
if
err
:=
json
.
Unmarshal
(
body
,
&
r
);
err
!=
nil
{
...
@@ -75,7 +80,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -75,7 +80,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// Wait for the Elasticsearch pods to enter the running state.
// Wait for the Elasticsearch pods to enter the running state.
By
(
"Checking to make sure the Elasticsearch pods are running"
)
By
(
"Checking to make sure the Elasticsearch pods are running"
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"name"
:
"elasticsearch-logging"
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
esKey
:
esValue
}))
pods
,
err
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
.
List
(
label
,
fields
.
Everything
())
pods
,
err
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
.
List
(
label
,
fields
.
Everything
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
pod
:=
range
pods
.
Items
{
for
_
,
pod
:=
range
pods
.
Items
{
...
@@ -242,7 +247,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
...
@@ -242,7 +247,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
10
*
time
.
Second
)
{
// Debugging code to report the status of the elasticsearch logging endpoints.
// Debugging code to report the status of the elasticsearch logging endpoints.
esPods
,
err
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
.
List
(
labels
.
Set
{
"k8s-app"
:
"elasticsearch-logging"
}
.
AsSelector
(),
fields
.
Everything
())
esPods
,
err
:=
f
.
Client
.
Pods
(
api
.
NamespaceDefault
)
.
List
(
labels
.
Set
{
esKey
:
esValue
}
.
AsSelector
(),
fields
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
Logf
(
"Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v"
,
err
)
Logf
(
"Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v"
,
err
)
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