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
fdd0b521
Commit
fdd0b521
authored
Mar 02, 2015
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4924 from roberthbailey/kubectl-e2e
Use the kubectl binary rather than the wrapper shell script in the kubectl e2e test.
parents
db907b85
3ae85812
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
ginkgo-e2e.sh
hack/ginkgo-e2e.sh
+2
-0
kubectl.go
test/e2e/kubectl.go
+16
-9
No files found.
hack/ginkgo-e2e.sh
View file @
fdd0b521
...
...
@@ -103,6 +103,8 @@ else
auth_config
=()
fi
# Use the kubectl binary from the same directory as the e2e binary.
export
PATH
=
$(
dirname
"
${
e2e
}
"
)
:
"
${
PATH
}
"
"
${
e2e
}
"
"
${
auth_config
[@]
:+
${
auth_config
[@]
}}
"
\
--host
=
"https://
${
KUBE_MASTER_IP
-
}
"
\
--provider
=
"
${
KUBERNETES_PROVIDER
}
"
\
...
...
test/e2e/kubectl.go
View file @
fdd0b521
...
...
@@ -40,7 +40,7 @@ const (
var
_
=
Describe
(
"kubectl"
,
func
()
{
updateDemoRoot
:=
filepath
.
Join
(
r
oot
,
"examples/update-demo"
)
updateDemoRoot
:=
filepath
.
Join
(
testContext
.
repoR
oot
,
"examples/update-demo"
)
nautilusPath
:=
filepath
.
Join
(
updateDemoRoot
,
"nautilus-rc.yaml"
)
kittenPath
:=
filepath
.
Join
(
updateDemoRoot
,
"kitten-rc.yaml"
)
...
...
@@ -174,15 +174,22 @@ func getData(hostIP string) (*updateDemoData, error) {
}
func
runKubectl
(
args
...
string
)
string
{
// TODO: use kubectl binary directly instead of shell wrapper
path
:=
filepath
.
Join
(
root
,
"cluster/kubectl.sh"
)
cmdStr
:=
path
+
" "
+
strings
.
Join
(
args
,
" "
)
Logf
(
"Running '%v'"
,
cmdStr
)
cmd
:=
exec
.
Command
(
path
,
args
...
)
defaultArgs
:=
[]
string
{
"--auth-path="
+
testContext
.
authConfig
}
if
testContext
.
certDir
!=
""
{
defaultArgs
=
append
(
defaultArgs
,
fmt
.
Sprintf
(
"--certificate-authority=%s"
,
filepath
.
Join
(
testContext
.
certDir
,
"ca.crt"
)),
fmt
.
Sprintf
(
"--client-certificate=%s"
,
filepath
.
Join
(
testContext
.
certDir
,
"kubecfg.crt"
)),
fmt
.
Sprintf
(
"--client-key=%s"
,
filepath
.
Join
(
testContext
.
certDir
,
"kubecfg.key"
)))
}
kubectlArgs
:=
append
(
defaultArgs
,
args
...
)
// TODO: Remove this once gcloud writes a proper entry in the kubeconfig file.
if
testContext
.
provider
==
"gke"
{
kubectlArgs
=
append
(
kubectlArgs
,
"--server="
+
testContext
.
host
)
}
Logf
(
"Running 'kubectl %v'"
,
strings
.
Join
(
kubectlArgs
,
" "
))
cmd
:=
exec
.
Command
(
"kubectl"
,
kubectlArgs
...
)
var
stdout
,
stderr
bytes
.
Buffer
cmd
.
Stdout
=
&
stdout
cmd
.
Stderr
=
&
stderr
cmd
.
Stdout
,
cmd
.
Stderr
=
&
stdout
,
&
stderr
if
err
:=
cmd
.
Run
();
err
!=
nil
{
Failf
(
"Error running %v:
\n
Command stdout:
\n
%v
\n
stderr:
\n
%v
\n
"
,
cmd
,
cmd
.
Stdout
,
cmd
.
Stderr
)
...
...
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