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
eb27e1c4
Commit
eb27e1c4
authored
Nov 04, 2017
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove version check for kubectl portfoward.
parent
0242de0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
17 deletions
+2
-17
portforward.go
test/e2e/kubectl/portforward.go
+2
-17
No files found.
test/e2e/kubectl/portforward.go
View file @
eb27e1c4
...
...
@@ -22,7 +22,6 @@ import (
"bytes"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"net"
"os/exec"
...
...
@@ -36,7 +35,6 @@ import (
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
utilversion
"k8s.io/kubernetes/pkg/util/version"
"k8s.io/kubernetes/test/e2e/framework"
testutils
"k8s.io/kubernetes/test/utils"
imageutils
"k8s.io/kubernetes/test/utils/image"
...
...
@@ -51,8 +49,7 @@ const (
// TODO support other ports besides 80
var
(
portForwardRegexp
=
regexp
.
MustCompile
(
"Forwarding from 127.0.0.1:([0-9]+) -> 80"
)
portForwardPortToStdOutV
=
utilversion
.
MustParseSemantic
(
"v1.3.0-alpha.4"
)
portForwardRegexp
=
regexp
.
MustCompile
(
"Forwarding from 127.0.0.1:([0-9]+) -> 80"
)
)
func
pfPod
(
expectedClientData
,
chunks
,
chunkSize
,
chunkIntervalMillis
string
,
bindAddress
string
)
*
v1
.
Pod
{
...
...
@@ -167,25 +164,13 @@ func runPortForward(ns, podName string, port int) *portForwardCommand {
// by the port-forward command. We don't want to hard code the port as we have no
// way of guaranteeing we can pick one that isn't in use, particularly on Jenkins.
framework
.
Logf
(
"starting port-forward command and streaming output"
)
stdout
,
stderr
,
err
:=
framework
.
StartCmdAndStreamOutput
(
cmd
)
portOutput
,
_
,
err
:=
framework
.
StartCmdAndStreamOutput
(
cmd
)
if
err
!=
nil
{
framework
.
Failf
(
"Failed to start port-forward command: %v"
,
err
)
}
buf
:=
make
([]
byte
,
128
)
// After v1.3.0-alpha.4 (#17030), kubectl port-forward outputs port
// info to stdout, not stderr, so for version-skewed tests, look there
// instead.
var
portOutput
io
.
ReadCloser
if
useStdOut
,
err
:=
framework
.
KubectlVersionGTE
(
portForwardPortToStdOutV
);
err
!=
nil
{
framework
.
Failf
(
"Failed to get kubectl version: %v"
,
err
)
}
else
if
useStdOut
{
portOutput
=
stdout
}
else
{
portOutput
=
stderr
}
var
n
int
framework
.
Logf
(
"reading from `kubectl port-forward` command's stdout"
)
if
n
,
err
=
portOutput
.
Read
(
buf
);
err
!=
nil
{
...
...
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