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
631b9653
Commit
631b9653
authored
Jan 22, 2016
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19968 from lavalamp/e2e-kubectl-proxy
e2e kubectl proxy test: Make future flake diagnosis possible
parents
7fea0ada
23fd5e9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
kubectl.go
test/e2e/kubectl.go
+9
-2
No files found.
test/e2e/kubectl.go
View file @
631b9653
...
@@ -352,7 +352,9 @@ var _ = Describe("Kubectl client", func() {
...
@@ -352,7 +352,9 @@ var _ = Describe("Kubectl client", func() {
}
}
proxyAddr
:=
fmt
.
Sprintf
(
"http://%s:8080"
,
goproxyPod
.
Status
.
PodIP
)
proxyAddr
:=
fmt
.
Sprintf
(
"http://%s:8080"
,
goproxyPod
.
Status
.
PodIP
)
shellCommand
:=
fmt
.
Sprintf
(
"%s=%s .%s --kubeconfig=%s --server=%s --namespace=%s exec nginx echo running in container"
,
proxyVar
,
proxyAddr
,
uploadBinaryName
,
kubecConfigRemotePath
,
apiServer
,
ns
)
shellCommand
:=
fmt
.
Sprintf
(
"%s=%s .%s --kubeconfig=%s --server=%s --namespace=%s exec nginx echo running in container"
,
proxyVar
,
proxyAddr
,
uploadBinaryName
,
kubecConfigRemotePath
,
apiServer
,
ns
)
Logf
(
"About to remote exec: %v"
,
shellCommand
)
// Execute kubectl on remote exec server.
// Execute kubectl on remote exec server.
var
netexecShellOutput
[]
byte
var
netexecShellOutput
[]
byte
if
subResourceProxyAvailable
{
if
subResourceProxyAvailable
{
...
@@ -383,6 +385,12 @@ var _ = Describe("Kubectl client", func() {
...
@@ -383,6 +385,12 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Unable to read the result from the netexec server. Error: %s"
,
err
)
Failf
(
"Unable to read the result from the netexec server. Error: %s"
,
err
)
}
}
// Get (and print!) the proxy logs here, so
// they'll be present in case the below check
// fails the test, to help diagnose #19500 if
// it recurs.
proxyLog
:=
runKubectlOrDie
(
"log"
,
"goproxy"
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
// Verify we got the normal output captured by the exec server
// Verify we got the normal output captured by the exec server
expectedExecOutput
:=
"running in container
\n
"
expectedExecOutput
:=
"running in container
\n
"
if
netexecOuput
.
Output
!=
expectedExecOutput
{
if
netexecOuput
.
Output
!=
expectedExecOutput
{
...
@@ -391,7 +399,6 @@ var _ = Describe("Kubectl client", func() {
...
@@ -391,7 +399,6 @@ var _ = Describe("Kubectl client", func() {
// Verify the proxy server logs saw the connection
// Verify the proxy server logs saw the connection
expectedProxyLog
:=
fmt
.
Sprintf
(
"Accepting CONNECT to %s"
,
strings
.
TrimRight
(
strings
.
TrimLeft
(
testContext
.
Host
,
"https://"
),
"/api"
))
expectedProxyLog
:=
fmt
.
Sprintf
(
"Accepting CONNECT to %s"
,
strings
.
TrimRight
(
strings
.
TrimLeft
(
testContext
.
Host
,
"https://"
),
"/api"
))
proxyLog
:=
runKubectlOrDie
(
"log"
,
"goproxy"
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
if
!
strings
.
Contains
(
proxyLog
,
expectedProxyLog
)
{
if
!
strings
.
Contains
(
proxyLog
,
expectedProxyLog
)
{
Failf
(
"Missing expected log result on proxy server for %s. Expected: %q, got %q"
,
proxyVar
,
expectedProxyLog
,
proxyLog
)
Failf
(
"Missing expected log result on proxy server for %s. Expected: %q, got %q"
,
proxyVar
,
expectedProxyLog
,
proxyLog
)
...
...
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