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
e2b980b3
Commit
e2b980b3
authored
May 22, 2016
by
Prashanth Balasubramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix e2es
parent
f4d23349
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
37 deletions
+7
-37
ingress.go
test/e2e/ingress.go
+7
-37
No files found.
test/e2e/ingress.go
View file @
e2b980b3
...
@@ -30,7 +30,6 @@ import (
...
@@ -30,7 +30,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/extensions"
client
"k8s.io/kubernetes/pkg/client/unversioned"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels"
utilexec
"k8s.io/kubernetes/pkg/util/exec"
utilexec
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/intstr"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/util/wait"
...
@@ -62,6 +61,10 @@ var (
...
@@ -62,6 +61,10 @@ var (
testImage
=
"gcr.io/google_containers/n-way-http:1.0"
testImage
=
"gcr.io/google_containers/n-way-http:1.0"
httpContainerPort
=
8080
httpContainerPort
=
8080
// Name of the config-map and key the ingress controller stores its uid in.
uidConfigMap
=
"ingress-uid"
uidKey
=
"uid"
expectedLBCreationTime
=
7
*
time
.
Minute
expectedLBCreationTime
=
7
*
time
.
Minute
expectedLBHealthCheckTime
=
7
*
time
.
Minute
expectedLBHealthCheckTime
=
7
*
time
.
Minute
...
@@ -232,26 +235,6 @@ func gcloudDelete(resource, name, project string) {
...
@@ -232,26 +235,6 @@ func gcloudDelete(resource, name, project string) {
}
}
}
}
// kubectlLogLBController logs kubectl debug output for the L7 controller pod.
func
kubectlLogLBController
(
c
*
client
.
Client
,
ns
string
)
{
selector
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
controllerLabels
))
options
:=
api
.
ListOptions
{
LabelSelector
:
selector
}
podList
,
err
:=
c
.
Pods
(
api
.
NamespaceAll
)
.
List
(
options
)
if
err
!=
nil
{
framework
.
Logf
(
"Cannot log L7 controller output, error listing pods %v"
,
err
)
return
}
if
len
(
podList
.
Items
)
==
0
{
framework
.
Logf
(
"Loadbalancer controller pod not found"
)
return
}
for
_
,
p
:=
range
podList
.
Items
{
framework
.
Logf
(
"
\n
Last 100 log lines of %v
\n
"
,
p
.
Name
)
l
,
_
:=
framework
.
RunKubectl
(
"logs"
,
p
.
Name
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
),
"-c"
,
lbContainerName
,
"--tail=100"
)
framework
.
Logf
(
l
)
}
}
type
IngressController
struct
{
type
IngressController
struct
{
ns
string
ns
string
rcPath
string
rcPath
string
...
@@ -263,24 +246,12 @@ type IngressController struct {
...
@@ -263,24 +246,12 @@ type IngressController struct {
}
}
func
(
cont
*
IngressController
)
getL7AddonUID
()
(
string
,
error
)
{
func
(
cont
*
IngressController
)
getL7AddonUID
()
(
string
,
error
)
{
listOpts
:=
api
.
ListOptions
{
LabelSelector
:
labels
.
SelectorFromSet
(
labels
.
Set
(
clusterAddonLBLabels
))}
cm
,
err
:=
cont
.
c
.
ConfigMaps
(
api
.
NamespaceSystem
)
.
Get
(
uidConfigMap
)
existingRCs
,
err
:=
cont
.
c
.
ReplicationControllers
(
api
.
NamespaceSystem
)
.
List
(
listOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
if
len
(
existingRCs
.
Items
)
!=
1
{
if
uid
,
ok
:=
cm
.
Data
[
uidKey
];
ok
{
return
""
,
fmt
.
Errorf
(
"Unexpected number of lb cluster addons %v with label %v in kube-system namespace"
,
len
(
existingRCs
.
Items
),
clusterAddonLBLabels
)
return
uid
,
nil
}
rc
:=
existingRCs
.
Items
[
0
]
commandPrefix
:=
"--cluster-uid="
for
i
,
c
:=
range
rc
.
Spec
.
Template
.
Spec
.
Containers
{
if
c
.
Name
==
lbContainerName
{
for
_
,
arg
:=
range
rc
.
Spec
.
Template
.
Spec
.
Containers
[
i
]
.
Args
{
if
strings
.
HasPrefix
(
arg
,
commandPrefix
)
{
return
strings
.
Replace
(
arg
,
commandPrefix
,
""
,
-
1
),
nil
}
}
}
}
}
return
""
,
fmt
.
Errorf
(
"Could not find cluster UID for L7 addon pod"
)
return
""
,
fmt
.
Errorf
(
"Could not find cluster UID for L7 addon pod"
)
}
}
...
@@ -448,7 +419,6 @@ var _ = framework.KubeDescribe("GCE L7 LoadBalancer Controller [Feature:Ingress]
...
@@ -448,7 +419,6 @@ var _ = framework.KubeDescribe("GCE L7 LoadBalancer Controller [Feature:Ingress]
AfterEach
(
func
()
{
AfterEach
(
func
()
{
framework
.
Logf
(
"Average creation time %+v, health check time %+v"
,
creationTimes
,
responseTimes
)
framework
.
Logf
(
"Average creation time %+v, health check time %+v"
,
creationTimes
,
responseTimes
)
if
CurrentGinkgoTestDescription
()
.
Failed
{
if
CurrentGinkgoTestDescription
()
.
Failed
{
kubectlLogLBController
(
client
,
ns
)
framework
.
Logf
(
"
\n
Output of kubectl describe ing:
\n
"
)
framework
.
Logf
(
"
\n
Output of kubectl describe ing:
\n
"
)
desc
,
_
:=
framework
.
RunKubectl
(
"describe"
,
"ing"
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
desc
,
_
:=
framework
.
RunKubectl
(
"describe"
,
"ing"
,
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
))
framework
.
Logf
(
desc
)
framework
.
Logf
(
desc
)
...
...
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