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
8d743715
Commit
8d743715
authored
Aug 30, 2016
by
Vishnu kannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make pods e2e retry getting logs from web-sockets
Signed-off-by:
Vishnu kannan
<
vishnuk@google.com
>
parent
f839c5ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
pods.go
test/e2e/common/pods.go
+21
-18
No files found.
test/e2e/common/pods.go
View file @
8d743715
...
...
@@ -491,28 +491,31 @@ var _ = framework.KubeDescribe("Pods", func() {
defer
ws
.
Close
()
buf
:=
&
bytes
.
Buffer
{}
for
{
var
msg
[]
byte
if
err
:=
websocket
.
Message
.
Receive
(
ws
,
&
msg
);
err
!=
nil
{
if
err
==
io
.
EOF
{
break
Eventually
(
func
()
error
{
for
{
var
msg
[]
byte
if
err
:=
websocket
.
Message
.
Receive
(
ws
,
&
msg
);
err
!=
nil
{
if
err
==
io
.
EOF
{
break
}
framework
.
Failf
(
"Failed to read completely from websocket %s: %v"
,
url
.
String
(),
err
)
}
framework
.
Failf
(
"Failed to read completely from websocket %s: %v"
,
url
.
String
(),
err
)
if
len
(
msg
)
==
0
{
continue
}
if
msg
[
0
]
!=
1
{
framework
.
Failf
(
"Got message from server that didn't start with channel 1 (STDOUT): %v"
,
msg
)
}
buf
.
Write
(
msg
[
1
:
])
}
if
len
(
msg
)
==
0
{
continue
if
buf
.
Len
(
)
==
0
{
return
fmt
.
Errorf
(
"Unexpected output from server"
)
}
if
msg
[
0
]
!=
1
{
framework
.
Failf
(
"Got message from server that didn't start with channel 1 (STDOUT): %v"
,
msg
)
if
!
strings
.
Contains
(
buf
.
String
(),
"nameserver"
)
{
return
fmt
.
Errorf
(
"Expected to find 'nameserver' in %q"
,
buf
.
String
()
)
}
buf
.
Write
(
msg
[
1
:
])
}
if
buf
.
Len
()
==
0
{
framework
.
Failf
(
"Unexpected output from server"
)
}
if
!
strings
.
Contains
(
buf
.
String
(),
"nameserver"
)
{
framework
.
Failf
(
"Expected to find 'nameserver' in %q"
,
buf
.
String
())
}
return
nil
},
time
.
Minute
,
10
*
time
.
Second
)
.
Should
(
BeNil
())
})
It
(
"should support retrieving logs from the container over websockets"
,
func
()
{
...
...
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