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
90c905b4
Commit
90c905b4
authored
Jun 22, 2018
by
Ashley Gau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address comments
parent
34928d21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
ingress_utils.go
test/e2e/framework/ingress_utils.go
+2
-1
ingress.go
test/e2e/network/ingress.go
+19
-7
No files found.
test/e2e/framework/ingress_utils.go
View file @
90c905b4
...
@@ -166,7 +166,8 @@ type IngressConformanceTests struct {
...
@@ -166,7 +166,8 @@ type IngressConformanceTests struct {
}
}
// NegStatus contains name and zone of the Network Endpoint Group
// NegStatus contains name and zone of the Network Endpoint Group
// resources associated with this service
// resources associated with this service.
// Needs to be consistent with the NEG internal structs in ingress-gce.
type
NegStatus
struct
{
type
NegStatus
struct
{
// NetworkEndpointGroups returns the mapping between service port and NEG
// NetworkEndpointGroups returns the mapping between service port and NEG
// resource. key is service port, value is the name of the NEG resource.
// resource. key is service port, value is the name of the NEG resource.
...
...
test/e2e/network/ingress.go
View file @
90c905b4
...
@@ -652,6 +652,8 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
...
@@ -652,6 +652,8 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
It
(
"should sync endpoints for both Ingress-referenced NEG and standalone NEG [Unreleased]"
,
func
()
{
It
(
"should sync endpoints for both Ingress-referenced NEG and standalone NEG [Unreleased]"
,
func
()
{
name
:=
"hostname"
name
:=
"hostname"
expectedKeys
:=
[]
int32
{
80
,
443
}
scaleAndValidateExposedNEG
:=
func
(
num
int
)
{
scaleAndValidateExposedNEG
:=
func
(
num
int
)
{
scale
,
err
:=
f
.
ClientSet
.
ExtensionsV1beta1
()
.
Deployments
(
ns
)
.
GetScale
(
name
,
metav1
.
GetOptions
{})
scale
,
err
:=
f
.
ClientSet
.
ExtensionsV1beta1
()
.
Deployments
(
ns
)
.
GetScale
(
name
,
metav1
.
GetOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
@@ -666,10 +668,10 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
...
@@ -666,10 +668,10 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
negs
:=
sets
.
NewString
()
negs
:=
sets
.
NewString
()
var
status
framework
.
NegStatus
var
status
framework
.
NegStatus
// Wait for NEG sync loop to find NEGs
framework
.
Logf
(
"Waiting for %v, got: %+v"
,
framework
.
NEGStatusAnnotation
,
svc
.
Annotations
)
v
,
ok
:=
svc
.
Annotations
[
framework
.
NEGStatusAnnotation
]
v
,
ok
:=
svc
.
Annotations
[
framework
.
NEGStatusAnnotation
]
if
!
ok
{
if
!
ok
{
// Wait for NEG sync loop to find NEGs
framework
.
Logf
(
"Waiting for %v, got: %+v"
,
framework
.
NEGStatusAnnotation
,
svc
.
Annotations
)
return
false
,
nil
return
false
,
nil
}
}
err
=
json
.
Unmarshal
([]
byte
(
v
),
&
status
)
err
=
json
.
Unmarshal
([]
byte
(
v
),
&
status
)
...
@@ -678,24 +680,34 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
...
@@ -678,24 +680,34 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
return
false
,
nil
return
false
,
nil
}
}
framework
.
Logf
(
"Got %v: %v"
,
framework
.
NEGStatusAnnotation
,
v
)
framework
.
Logf
(
"Got %v: %v"
,
framework
.
NEGStatusAnnotation
,
v
)
if
len
(
status
.
NetworkEndpointGroups
)
==
0
{
// Expect 2 NEGs to be created based on the test setup (neg-exposed)
if
len
(
status
.
NetworkEndpointGroups
)
!=
2
{
framework
.
Logf
(
"Expected 2 NEGs, got %d"
,
len
(
negs
.
List
()))
return
false
,
nil
return
false
,
nil
}
}
for
_
,
port
:=
range
expectedKeys
{
if
_
,
ok
:=
status
.
NetworkEndpointGroups
[
port
];
!
ok
{
framework
.
Logf
(
"Expected ServicePort key %v, but does not exist"
,
port
)
}
}
for
_
,
neg
:=
range
status
.
NetworkEndpointGroups
{
for
_
,
neg
:=
range
status
.
NetworkEndpointGroups
{
negs
.
Insert
(
neg
)
negs
.
Insert
(
neg
)
}
}
gceCloud
:=
gceController
.
Cloud
.
Provider
.
(
*
gcecloud
.
GCECloud
)
gceCloud
:=
gceController
.
Cloud
.
Provider
.
(
*
gcecloud
.
GCECloud
)
for
_
,
neg
:=
range
negs
.
List
()
{
for
_
,
neg
:=
range
negs
.
List
()
{
exposedNegs
,
err
:=
gceCloud
.
ListNetworkEndpoints
(
neg
,
gceController
.
Cloud
.
Zone
,
false
)
networkEndpoints
,
err
:=
gceCloud
.
ListNetworkEndpoints
(
neg
,
gceController
.
Cloud
.
Zone
,
false
)
framework
.
Logf
(
"ExposedNegs: %v, err: %v"
,
exposedNegs
,
err
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
len
(
exposedNegs
)
!=
num
{
if
len
(
networkEndpoints
)
!=
num
{
framework
.
Logf
(
"Expect number of endpoints to be %d, but got %d"
,
num
,
len
(
networkEndpoints
))
return
false
,
nil
return
false
,
nil
}
}
}
}
return
len
(
negs
.
List
())
>
0
,
nil
return
true
,
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