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
4976cb92
Commit
4976cb92
authored
Jan 30, 2018
by
Rohit Ramkumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes ci-ingress-gce-upgrade-e2e
parent
9e2878d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
19 deletions
+18
-19
nodes_util.go
test/e2e/framework/nodes_util.go
+0
-1
util.go
test/e2e/framework/util.go
+1
-0
ing.yaml
test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml
+5
-0
ingress.go
test/e2e/upgrades/ingress.go
+12
-18
No files found.
test/e2e/framework/nodes_util.go
View file @
4976cb92
...
@@ -86,7 +86,6 @@ func ingressUpgradeGCE(isUpgrade bool) error {
...
@@ -86,7 +86,6 @@ func ingressUpgradeGCE(isUpgrade bool) error {
command
=
"sudo sed -i -re 's/(image:)(.*)/
\\
1 gcr.io
\\
/google_containers
\\
/glbc:0.9.7/' /etc/kubernetes/manifests/glbc.manifest"
command
=
"sudo sed -i -re 's/(image:)(.*)/
\\
1 gcr.io
\\
/google_containers
\\
/glbc:0.9.7/' /etc/kubernetes/manifests/glbc.manifest"
}
}
sshResult
,
err
:=
NodeExec
(
GetMasterHost
(),
command
)
sshResult
,
err
:=
NodeExec
(
GetMasterHost
(),
command
)
// TODO(rramkumar): Ensure glbc pod is in "Running" state before proceeding.
LogSSHResult
(
sshResult
)
LogSSHResult
(
sshResult
)
return
err
return
err
}
}
...
...
test/e2e/framework/util.go
View file @
4976cb92
...
@@ -4947,6 +4947,7 @@ func PollURL(route, host string, timeout time.Duration, interval time.Duration,
...
@@ -4947,6 +4947,7 @@ func PollURL(route, host string, timeout time.Duration, interval time.Duration,
Logf
(
"host %v path %v: %v unreachable"
,
host
,
route
,
err
)
Logf
(
"host %v path %v: %v unreachable"
,
host
,
route
,
err
)
return
expectUnreachable
,
nil
return
expectUnreachable
,
nil
}
}
Logf
(
"host %v path %v: reached"
,
host
,
route
)
return
!
expectUnreachable
,
nil
return
!
expectUnreachable
,
nil
})
})
if
pollErr
!=
nil
{
if
pollErr
!=
nil
{
...
...
test/e2e/testing-manifests/ingress/static-ip-2/ing.yaml
View file @
4976cb92
...
@@ -6,6 +6,11 @@ metadata:
...
@@ -6,6 +6,11 @@ metadata:
# annotations:
# annotations:
# kubernetes.io/ingress.global-static-ip-name: "staticip"
# kubernetes.io/ingress.global-static-ip-name: "staticip"
spec
:
spec
:
rules
:
-
host
:
ingress.test.com
http
:
paths
:
-
path
:
/foo
backend
:
backend
:
serviceName
:
echoheaders-https
serviceName
:
echoheaders-https
servicePort
:
80
servicePort
:
80
test/e2e/upgrades/ingress.go
View file @
4976cb92
...
@@ -32,6 +32,10 @@ import (
...
@@ -32,6 +32,10 @@ import (
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
)
)
// Dependent on "static-ip-2" manifests
const
path
=
"foo"
const
host
=
"ingress.test.com"
// IngressUpgradeTest adapts the Ingress e2e for upgrade testing
// IngressUpgradeTest adapts the Ingress e2e for upgrade testing
type
IngressUpgradeTest
struct
{
type
IngressUpgradeTest
struct
{
gceController
*
framework
.
GCEIngressController
gceController
*
framework
.
GCEIngressController
...
@@ -93,10 +97,10 @@ func (t *IngressUpgradeTest) Setup(f *framework.Framework) {
...
@@ -93,10 +97,10 @@ func (t *IngressUpgradeTest) Setup(f *framework.Framework) {
"kubernetes.io/ingress.global-static-ip-name"
:
t
.
ipName
,
"kubernetes.io/ingress.global-static-ip-name"
:
t
.
ipName
,
"kubernetes.io/ingress.allow-http"
:
"false"
,
"kubernetes.io/ingress.allow-http"
:
"false"
,
},
map
[
string
]
string
{})
},
map
[
string
]
string
{})
jig
.
AddHTTPS
(
"tls-secret"
,
"ingress.test.com"
)
t
.
jig
.
AddHTTPS
(
"tls-secret"
,
"ingress.test.com"
)
By
(
"waiting for Ingress to come up with ip: "
+
t
.
ip
)
By
(
"waiting for Ingress to come up with ip: "
+
t
.
ip
)
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
"
,
t
.
ip
),
""
,
framework
.
LoadBalancerPollTimeout
,
jig
.
PollInterval
,
t
.
httpClient
,
false
))
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
%v"
,
t
.
ip
,
path
),
host
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
By
(
"keeping track of GCP resources created by Ingress"
)
By
(
"keeping track of GCP resources created by Ingress"
)
t
.
resourceStore
=
&
GCPResourceStore
{}
t
.
resourceStore
=
&
GCPResourceStore
{}
...
@@ -145,35 +149,25 @@ func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}
...
@@ -145,35 +149,25 @@ func (t *IngressUpgradeTest) verify(f *framework.Framework, done <-chan struct{}
if
testDuringDisruption
{
if
testDuringDisruption
{
By
(
"continuously hitting the Ingress IP"
)
By
(
"continuously hitting the Ingress IP"
)
wait
.
Until
(
func
()
{
wait
.
Until
(
func
()
{
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
"
,
t
.
ip
),
""
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
%v"
,
t
.
ip
,
path
),
host
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
},
t
.
jig
.
PollInterval
,
done
)
},
t
.
jig
.
PollInterval
,
done
)
}
else
{
}
else
{
By
(
"waiting for upgrade to finish without checking if Ingress remains up"
)
By
(
"waiting for upgrade to finish without checking if Ingress remains up"
)
<-
done
<-
done
}
}
By
(
"hitting the Ingress IP "
+
t
.
ip
)
By
(
"hitting the Ingress IP "
+
t
.
ip
)
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
"
,
t
.
ip
),
""
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/
%v"
,
t
.
ip
,
path
),
host
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
// We want to manually trigger a sync because then we can easily verify
// We want to manually trigger a sync because then we can easily verify
// a correct sync completed after update.
// a correct sync completed after update.
By
(
"updating ingress spec to manually trigger a sync"
)
By
(
"updating ingress spec to manually trigger a sync"
)
t
.
jig
.
Update
(
func
(
ing
*
extensions
.
Ingress
)
{
t
.
jig
.
Update
(
func
(
ing
*
extensions
.
Ingress
)
{
ing
.
Spec
.
TLS
[
0
]
.
Hosts
=
append
(
ing
.
Spec
.
TLS
[
0
]
.
Hosts
,
"ingress.test.com"
)
ing
.
Spec
.
Rules
[
0
]
.
IngressRuleValue
.
HTTP
.
Paths
=
append
(
ing
.
Spec
.
Rules
=
append
(
ing
.
Spec
.
Rules
[
0
]
.
IngressRuleValue
.
HTTP
.
Paths
,
ing
.
Spec
.
Rules
,
extensions
.
HTTPIngressPath
{
extensions
.
IngressRule
{
Host
:
"ingress.test.com"
,
IngressRuleValue
:
extensions
.
IngressRuleValue
{
HTTP
:
&
extensions
.
HTTPIngressRuleValue
{
Paths
:
[]
extensions
.
HTTPIngressPath
{
{
Path
:
"/test"
,
Path
:
"/test"
,
// Note: Dependant on using "static-ip-2" manifest.
// Note: Dependant on using "static-ip-2" manifest.
Backend
:
*
(
ing
.
Spec
.
Backend
),
Backend
:
ing
.
Spec
.
Rules
[
0
]
.
IngressRuleValue
.
HTTP
.
Paths
[
0
]
.
Backend
,
},
},
},
},
})
})
})
})
// WaitForIngress() tests that all paths are pinged, which is how we know
// WaitForIngress() tests that all paths are pinged, which is how we know
...
...
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