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
26f90e85
Unverified
Commit
26f90e85
authored
Feb 26, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74540 from oomichi/golint-e2e-framework-ingress
Fix golint under test/e2e/framework/ingress
parents
0ecba229
215dee7d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
15 deletions
+19
-15
.golint_failures
hack/.golint_failures
+0
-1
ingress_utils.go
test/e2e/framework/ingress/ingress_utils.go
+0
-0
ingress.go
test/e2e/network/ingress.go
+17
-12
ingress.go
test/e2e/network/scale/ingress.go
+1
-1
ingress.go
test/e2e/upgrades/ingress.go
+1
-1
No files found.
hack/.golint_failures
View file @
26f90e85
...
...
@@ -653,7 +653,6 @@ test/e2e/chaosmonkey
test/e2e/cloud
test/e2e/common
test/e2e/framework
test/e2e/framework/ingress
test/e2e/framework/providers/gce
test/e2e/framework/providers/kubemark
test/e2e/instrumentation
...
...
test/e2e/framework/ingress/ingress_utils.go
View file @
26f90e85
This diff is collapsed.
Click to expand it.
test/e2e/network/ingress.go
View file @
26f90e85
...
...
@@ -44,12 +44,17 @@ import (
.
"github.com/onsi/gomega"
)
const
(
negUpdateTimeout
=
2
*
time
.
Minute
instanceGroupAnnotation
=
"ingress.gcp.kubernetes.io/instance-groups"
)
var
_
=
SIGDescribe
(
"Loadbalancing: L7"
,
func
()
{
defer
GinkgoRecover
()
var
(
ns
string
jig
*
ingress
.
Ingress
TestJig
conformanceTests
[]
ingress
.
Ingress
ConformanceTests
jig
*
ingress
.
TestJig
conformanceTests
[]
ingress
.
ConformanceTests
cloudConfig
framework
.
CloudConfig
)
f
:=
framework
.
NewDefaultFramework
(
"ingress"
)
...
...
@@ -362,14 +367,14 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
ing
,
err
:=
f
.
ClientSet
.
ExtensionsV1beta1
()
.
Ingresses
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
framework
.
ExpectNoError
(
err
)
annotations
:=
ing
.
Annotations
if
annotations
==
nil
||
annotations
[
in
gress
.
In
stanceGroupAnnotation
]
==
""
{
framework
.
Logf
(
"Waiting for ingress to get %s annotation. Found annotations: %v"
,
in
gress
.
In
stanceGroupAnnotation
,
annotations
)
if
annotations
==
nil
||
annotations
[
instanceGroupAnnotation
]
==
""
{
framework
.
Logf
(
"Waiting for ingress to get %s annotation. Found annotations: %v"
,
instanceGroupAnnotation
,
annotations
)
return
false
,
nil
}
return
true
,
nil
})
if
pollErr
!=
nil
{
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"Timed out waiting for ingress %s to get %s annotation"
,
name
,
in
gress
.
In
stanceGroupAnnotation
))
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"Timed out waiting for ingress %s to get %s annotation"
,
name
,
instanceGroupAnnotation
))
}
// Verify that the ingress does not get other annotations like url-map, target-proxy, backends, etc.
...
...
@@ -569,7 +574,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
_
,
err
=
f
.
ClientSet
.
AppsV1
()
.
Deployments
(
ns
)
.
UpdateScale
(
name
,
scale
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
wait
.
Poll
(
10
*
time
.
Second
,
ingress
.
NEG
UpdateTimeout
,
func
()
(
bool
,
error
)
{
wait
.
Poll
(
10
*
time
.
Second
,
neg
UpdateTimeout
,
func
()
(
bool
,
error
)
{
res
,
err
:=
jig
.
GetDistinctResponseFromIngress
()
if
err
!=
nil
{
return
false
,
nil
...
...
@@ -664,7 +669,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
_
,
err
=
f
.
ClientSet
.
AppsV1
()
.
Deployments
(
ns
)
.
UpdateScale
(
name
,
scale
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
}
wait
.
Poll
(
10
*
time
.
Second
,
ingress
.
NEG
UpdateTimeout
,
func
()
(
bool
,
error
)
{
wait
.
Poll
(
10
*
time
.
Second
,
neg
UpdateTimeout
,
func
()
(
bool
,
error
)
{
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
@@ -982,7 +987,7 @@ func verifyKubemciStatusHas(name, expectedSubStr string) {
}
}
func
executePresharedCertTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
Ingress
TestJig
,
staticIPName
string
)
{
func
executePresharedCertTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
TestJig
,
staticIPName
string
)
{
preSharedCertName
:=
"test-pre-shared-cert"
By
(
fmt
.
Sprintf
(
"Creating ssl certificate %q on GCE"
,
preSharedCertName
))
testHostname
:=
"test.ingress.com"
...
...
@@ -1033,7 +1038,7 @@ func executePresharedCertTest(f *framework.Framework, jig *ingress.IngressTestJi
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
fmt
.
Sprintf
(
"Unexpected error while waiting for ingress: %v"
,
err
))
}
func
executeStaticIPHttpsOnlyTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
Ingress
TestJig
,
ipName
,
ip
string
)
{
func
executeStaticIPHttpsOnlyTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
TestJig
,
ipName
,
ip
string
)
{
jig
.
CreateIngress
(
filepath
.
Join
(
ingress
.
IngressManifestPath
,
"static-ip"
),
f
.
Namespace
.
Name
,
map
[
string
]
string
{
ingress
.
IngressStaticIPKey
:
ipName
,
ingress
.
IngressAllowHTTPKey
:
"false"
,
...
...
@@ -1047,7 +1052,7 @@ func executeStaticIPHttpsOnlyTest(f *framework.Framework, jig *ingress.IngressTe
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"http://%s/"
,
ip
),
""
,
framework
.
LoadBalancerPollTimeout
,
jig
.
PollInterval
,
httpClient
,
true
))
}
func
executeBacksideBacksideHTTPSTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
Ingress
TestJig
,
staticIPName
string
)
{
func
executeBacksideBacksideHTTPSTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
TestJig
,
staticIPName
string
)
{
By
(
"Creating a set of ingress, service and deployment that have backside re-encryption configured"
)
deployCreated
,
svcCreated
,
ingCreated
,
err
:=
jig
.
SetUpBacksideHTTPSIngress
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
staticIPName
)
defer
func
()
{
...
...
@@ -1079,7 +1084,7 @@ func executeBacksideBacksideHTTPSTest(f *framework.Framework, jig *ingress.Ingre
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to verify backside re-encryption ingress"
)
}
func
detectHttpVersionAndSchemeTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
Ingress
TestJig
,
address
,
version
,
scheme
string
)
{
func
detectHttpVersionAndSchemeTest
(
f
*
framework
.
Framework
,
jig
*
ingress
.
TestJig
,
address
,
version
,
scheme
string
)
{
timeoutClient
:=
&
http
.
Client
{
Timeout
:
ingress
.
IngressReqTimeout
}
resp
:=
""
err
:=
wait
.
PollImmediate
(
framework
.
LoadBalancerPollInterval
,
framework
.
LoadBalancerPollTimeout
,
func
()
(
bool
,
error
)
{
...
...
@@ -1102,7 +1107,7 @@ func detectHttpVersionAndSchemeTest(f *framework.Framework, jig *ingress.Ingress
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
fmt
.
Sprintf
(
"Failed to get %s or %s, response body: %s"
,
version
,
scheme
,
resp
))
}
func
detectNegAnnotation
(
f
*
framework
.
Framework
,
jig
*
ingress
.
Ingress
TestJig
,
gceController
*
gce
.
GCEIngressController
,
ns
,
name
string
,
negs
int
)
{
func
detectNegAnnotation
(
f
*
framework
.
Framework
,
jig
*
ingress
.
TestJig
,
gceController
*
gce
.
GCEIngressController
,
ns
,
name
string
,
negs
int
)
{
wait
.
Poll
(
5
*
time
.
Second
,
framework
.
LoadBalancerPollTimeout
,
func
()
(
bool
,
error
)
{
svc
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Services
(
ns
)
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
...
...
test/e2e/network/scale/ingress.go
View file @
26f90e85
...
...
@@ -62,7 +62,7 @@ var (
// IngressScaleFramework defines the framework for ingress scale testing.
type
IngressScaleFramework
struct
{
Clientset
clientset
.
Interface
Jig
*
ingress
.
Ingress
TestJig
Jig
*
ingress
.
TestJig
GCEController
*
gce
.
GCEIngressController
CloudConfig
framework
.
CloudConfig
Logger
ingress
.
TestLogger
...
...
test/e2e/upgrades/ingress.go
View file @
26f90e85
...
...
@@ -44,7 +44,7 @@ type IngressUpgradeTest struct {
gceController
*
gce
.
GCEIngressController
// holds GCP resources pre-upgrade
resourceStore
*
GCPResourceStore
jig
*
ingress
.
Ingress
TestJig
jig
*
ingress
.
TestJig
httpClient
*
http
.
Client
ip
string
ipName
string
...
...
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