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
b2a057e8
Commit
b2a057e8
authored
May 17, 2018
by
Zihong Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Skip() for ingress upgrade test
parent
08ddda62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
ingress.go
test/e2e/upgrades/ingress.go
+27
-0
No files found.
test/e2e/upgrades/ingress.go
View file @
b2a057e8
...
...
@@ -29,6 +29,7 @@ import (
compute
"google.golang.org/api/compute/v1"
extensions
"k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/util/version"
"k8s.io/kubernetes/test/e2e/framework"
)
...
...
@@ -45,6 +46,7 @@ type IngressUpgradeTest struct {
httpClient
*
http
.
Client
ip
string
ipName
string
skipSSLCheck
bool
}
// GCPResourceStore keeps track of the GCP resources spun up by an ingress.
...
...
@@ -145,6 +147,26 @@ func (t *IngressUpgradeTest) Teardown(f *framework.Framework) {
framework
.
ExpectNoError
(
t
.
gceController
.
CleanupGCEIngressController
())
}
// Skip checks if the test or part of the test should be skipped.
func
(
t
*
IngressUpgradeTest
)
Skip
(
upgCtx
UpgradeContext
)
bool
{
sslNameChangeVersion
,
err
:=
version
.
ParseGeneric
(
"v1.10.0"
)
framework
.
ExpectNoError
(
err
)
var
hasVersionBelow
,
hasVersionAboveOrEqual
bool
for
_
,
v
:=
range
upgCtx
.
Versions
{
if
v
.
Version
.
LessThan
(
sslNameChangeVersion
)
{
hasVersionBelow
=
true
continue
}
hasVersionAboveOrEqual
=
true
}
// Skip SSL certificates check if k8s version changes between 1.10-
// and 1.10+ because the naming scheme has changed.
if
hasVersionBelow
&&
hasVersionAboveOrEqual
{
t
.
skipSSLCheck
=
true
}
return
false
}
func
(
t
*
IngressUpgradeTest
)
verify
(
f
*
framework
.
Framework
,
done
<-
chan
struct
{},
testDuringDisruption
bool
)
{
if
testDuringDisruption
{
By
(
"continuously hitting the Ingress IP"
)
...
...
@@ -184,6 +206,11 @@ func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}
t
.
resourceStore
.
Fw
.
SourceRanges
=
nil
postUpgradeResourceStore
.
Fw
.
Allowed
=
nil
postUpgradeResourceStore
.
Fw
.
SourceRanges
=
nil
// Stub out compute.SslCertificates in case we know it will change during an upgrade/downgrade.
if
t
.
skipSSLCheck
{
t
.
resourceStore
.
SslList
=
nil
postUpgradeResourceStore
.
SslList
=
nil
}
framework
.
ExpectNoError
(
compareGCPResourceStores
(
t
.
resourceStore
,
postUpgradeResourceStore
,
func
(
v1
reflect
.
Value
,
v2
reflect
.
Value
)
error
{
i1
:=
v1
.
Interface
()
...
...
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