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
97798c4f
Commit
97798c4f
authored
Apr 12, 2018
by
Nick Sardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ingress util handling of TLS
parent
b96a9cc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
ingress_utils.go
test/e2e/framework/ingress_utils.go
+15
-4
ingress.go
test/e2e/upgrades/ingress.go
+1
-1
No files found.
test/e2e/framework/ingress_utils.go
View file @
97798c4f
...
...
@@ -183,7 +183,7 @@ func CreateIngressComformanceTests(jig *IngressTestJig, ns string, annotations m
},
{
fmt
.
Sprintf
(
"should terminate TLS for host %v"
,
tlsHost
),
func
()
{
jig
.
Add
HTTPS
(
tlsSecretName
,
tlsHost
)
},
func
()
{
jig
.
Set
HTTPS
(
tlsSecretName
,
tlsHost
)
},
fmt
.
Sprintf
(
"waiting for HTTPS updates to reflect in ingress"
),
},
{
...
...
@@ -241,7 +241,7 @@ func CreateIngressComformanceTests(jig *IngressTestJig, ns string, annotations m
}
ing
.
Spec
.
Rules
=
newRules
})
jig
.
Add
HTTPS
(
tlsSecretName
,
updatedTLSHost
)
jig
.
Set
HTTPS
(
tlsSecretName
,
updatedTLSHost
)
},
fmt
.
Sprintf
(
"Waiting for updated certificates to accept requests for host %v"
,
updatedTLSHost
),
})
...
...
@@ -1211,19 +1211,30 @@ func (j *IngressTestJig) Update(update func(ing *extensions.Ingress)) {
Failf
(
"too many retries updating ingress %s/%s"
,
ns
,
name
)
}
// AddHTTPS updates the ingress to
use
this secret for these hosts.
// AddHTTPS updates the ingress to
add
this secret for these hosts.
func
(
j
*
IngressTestJig
)
AddHTTPS
(
secretName
string
,
hosts
...
string
)
{
// TODO: Just create the secret in GetRootCAs once we're watching secrets in
// the ingress controller.
_
,
cert
,
_
,
err
:=
createTLSSecret
(
j
.
Client
,
j
.
Ingress
.
Namespace
,
secretName
,
hosts
...
)
ExpectNoError
(
err
)
j
.
Logger
.
Infof
(
"Updating ingress %v to use secret %v for TLS termination"
,
j
.
Ingress
.
Name
,
secretName
)
j
.
Logger
.
Infof
(
"Updating ingress %v to
also
use secret %v for TLS termination"
,
j
.
Ingress
.
Name
,
secretName
)
j
.
Update
(
func
(
ing
*
extensions
.
Ingress
)
{
ing
.
Spec
.
TLS
=
append
(
ing
.
Spec
.
TLS
,
extensions
.
IngressTLS
{
Hosts
:
hosts
,
SecretName
:
secretName
})
})
j
.
RootCAs
[
secretName
]
=
cert
}
// SetHTTPS updates the ingress to use only this secret for these hosts.
func
(
j
*
IngressTestJig
)
SetHTTPS
(
secretName
string
,
hosts
...
string
)
{
_
,
cert
,
_
,
err
:=
createTLSSecret
(
j
.
Client
,
j
.
Ingress
.
Namespace
,
secretName
,
hosts
...
)
ExpectNoError
(
err
)
j
.
Logger
.
Infof
(
"Updating ingress %v to only use secret %v for TLS termination"
,
j
.
Ingress
.
Name
,
secretName
)
j
.
Update
(
func
(
ing
*
extensions
.
Ingress
)
{
ing
.
Spec
.
TLS
=
[]
extensions
.
IngressTLS
{{
Hosts
:
hosts
,
SecretName
:
secretName
}}
})
j
.
RootCAs
=
map
[
string
][]
byte
{
secretName
:
cert
}
}
// RemoveHTTPS updates the ingress to not use this secret for TLS.
// Note: Does not delete the secret.
func
(
j
*
IngressTestJig
)
RemoveHTTPS
(
secretName
string
)
{
...
...
test/e2e/upgrades/ingress.go
View file @
97798c4f
...
...
@@ -97,7 +97,7 @@ func (t *IngressUpgradeTest) Setup(f *framework.Framework) {
framework
.
IngressStaticIPKey
:
t
.
ipName
,
framework
.
IngressAllowHTTPKey
:
"false"
,
},
map
[
string
]
string
{})
t
.
jig
.
Add
HTTPS
(
"tls-secret"
,
"ingress.test.com"
)
t
.
jig
.
Set
HTTPS
(
"tls-secret"
,
"ingress.test.com"
)
By
(
"waiting for Ingress to come up with ip: "
+
t
.
ip
)
framework
.
ExpectNoError
(
framework
.
PollURL
(
fmt
.
Sprintf
(
"https://%v/%v"
,
t
.
ip
,
path
),
host
,
framework
.
LoadBalancerPollTimeout
,
t
.
jig
.
PollInterval
,
t
.
httpClient
,
false
))
...
...
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