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
54c89937
Commit
54c89937
authored
Oct 17, 2015
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15821 from kubernetes/revert-15787-release-tar-fix-for-15713
Revert "e2e: kubectl HTTP fix for #15713"
parents
0338e0ef
38dc2bd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
35 deletions
+17
-35
kubectl.go
test/e2e/kubectl.go
+17
-35
No files found.
test/e2e/kubectl.go
View file @
54c89937
...
...
@@ -26,7 +26,6 @@ import (
"mime/multipart"
"net"
"net/http"
"net/url"
"os"
"os/exec"
"path"
...
...
@@ -198,7 +197,8 @@ var _ = Describe("Kubectl client", func() {
}
})
It
(
"should support exec through an HTTP proxy"
,
func
()
{
// FIXME(ncdc) remove Skipped once we sort out the kubectl build issues in GCE
It
(
"[Skipped] should support exec through an HTTP proxy"
,
func
()
{
// Note: We are skipping local since we want to verify an apiserver with HTTPS.
// At this time local only supports plain HTTP.
SkipIfProviderIs
(
"local"
)
...
...
@@ -206,51 +206,33 @@ var _ = Describe("Kubectl client", func() {
if
testContext
.
Host
==
""
{
Failf
(
"--host variable must be set to the full URI to the api server on e2e run."
)
}
// Make sure the apiServer is set to what kubectl requires
apiServer
:=
testContext
.
Host
apiServerUrl
,
err
:=
url
.
Parse
(
apiServer
)
if
err
!=
nil
{
Failf
(
"Unable to parse URL %s. Error=Ts"
,
apiServer
,
err
)
// If there is no api in URL try to add it
if
!
strings
.
Contains
(
apiServer
,
":443/api"
)
{
apiServer
=
apiServer
+
":443/api"
}
apiServerUrl
.
Scheme
=
"https"
apiServerUrl
.
Path
=
"/api"
if
!
strings
.
Contains
(
apiServer
,
":443"
)
{
apiServerUrl
.
Host
=
apiServerUrl
.
Host
+
":443"
}
apiServer
=
apiServerUrl
.
String
()
// Get the kube/config
// TODO: Can it be RepoRoot with jenkins e2e?
testWorkspace
:=
os
.
Getenv
(
"WORKSPACE"
)
if
testWorkspace
==
""
{
// Not running in jenkins, assume RepoRoot
testWorkspace
=
testContext
.
RepoRoot
testWorkspace
=
testContext
.
RepoRoot
// os.Getenv("HOME")
}
// Build the static kubectl
By
(
"Finding a static kubectl for upload"
)
testStaticKubectlPath
:=
path
.
Join
(
testWorkspace
,
"platforms/linux/386/kubectl"
)
_
,
err
=
os
.
Stat
(
testStaticKubectlPath
)
By
(
"Building a static kubectl for upload"
)
kubectlContainerPath
:=
path
.
Join
(
testWorkspace
,
"/examples/kubectl-container/"
)
staticKubectlBuild
:=
exec
.
Command
(
"make"
,
"-C"
,
kubectlContainerPath
)
if
out
,
err
:=
staticKubectlBuild
.
Output
();
err
!=
nil
{
Failf
(
"Unable to create static kubectl. Error=%s, Output=%s"
,
err
,
out
)
}
// Verify the static kubectl path
testStaticKubectlPath
:=
path
.
Join
(
kubectlContainerPath
,
"kubectl"
)
_
,
err
:=
os
.
Stat
(
testStaticKubectlPath
)
if
err
!=
nil
{
Logf
(
"No kubectl in %s. Attempting a local build..."
,
testStaticKubectlPath
)
// Fall back to trying to build a local static kubectl
kubectlContainerPath
:=
path
.
Join
(
testWorkspace
,
"/examples/kubectl-container/"
)
if
_
,
err
:=
os
.
Stat
(
path
.
Join
(
testWorkspace
,
"hack/build-go.sh"
));
err
!=
nil
{
Failf
(
"Can't build static kubectl due to missing hack/build-go.sh. Error=%s"
,
err
)
}
By
(
"Building a static kubectl for upload"
)
staticKubectlBuild
:=
exec
.
Command
(
"make"
,
"-C"
,
kubectlContainerPath
)
if
out
,
err
:=
staticKubectlBuild
.
Output
();
err
!=
nil
{
Failf
(
"Unable to create static kubectl. Error=%s, Output=%q"
,
err
,
out
)
}
// Verify the static kubectl path
testStaticKubectlPath
=
path
.
Join
(
kubectlContainerPath
,
"kubectl"
)
_
,
err
:=
os
.
Stat
(
testStaticKubectlPath
)
if
err
!=
nil
{
Failf
(
"static kubectl path could not be found in %s. Error=%s"
,
testStaticKubectlPath
,
err
)
}
Failf
(
"static kubectl path could not be accessed. Error=%s"
,
err
)
}
By
(
fmt
.
Sprintf
(
"Using the kubectl in %s"
,
testStaticKubectlPath
))
// Verify the kubeconfig path
kubeConfigFilePath
:=
testContext
.
KubeConfig
...
...
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