Add a new protocol
Co-authored-by: Gérald Croës <gerald@containo.us>
This commit is contained in:
parent
0ca2149408
commit
4a68d29ce2
231 changed files with 6895 additions and 4395 deletions
|
@ -481,7 +481,7 @@ func tlsSection(opts ...func(*tls.Configuration)) func(*tls.Configuration) {
|
|||
|
||||
func tlsEntryPoints(entryPoints ...string) func(*tls.Configuration) {
|
||||
return func(c *tls.Configuration) {
|
||||
c.EntryPoints = entryPoints
|
||||
c.Stores = entryPoints
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -636,7 +636,7 @@ func sampleConfiguration() *types.Configuration {
|
|||
},
|
||||
TLS: []*tls.Configuration{
|
||||
{
|
||||
EntryPoints: []string{"https"},
|
||||
Stores: []string{"https"},
|
||||
Certificate: &tls.Certificate{
|
||||
CertFile: tls.FileOrContent("certificate"),
|
||||
KeyFile: tls.FileOrContent("key"),
|
||||
|
|
|
@ -652,7 +652,7 @@ func getTLS(ingress *extensionsv1beta1.Ingress, k8sClient Client, tlsConfigs map
|
|||
configKey := ingress.Namespace + "/" + t.SecretName
|
||||
if tlsConfig, tlsExists := tlsConfigs[configKey]; tlsExists {
|
||||
for _, entryPoint := range newEntryPoints {
|
||||
tlsConfig.EntryPoints = mergeEntryPoint(tlsConfig.EntryPoints, entryPoint)
|
||||
tlsConfig.Stores = mergeEntryPoint(tlsConfig.Stores, entryPoint)
|
||||
}
|
||||
} else {
|
||||
secret, exists, err := k8sClient.GetSecret(ingress.Namespace, t.SecretName)
|
||||
|
@ -671,7 +671,7 @@ func getTLS(ingress *extensionsv1beta1.Ingress, k8sClient Client, tlsConfigs map
|
|||
sort.Strings(newEntryPoints)
|
||||
|
||||
tlsConfig = &tls.Configuration{
|
||||
EntryPoints: newEntryPoints,
|
||||
Stores: newEntryPoints,
|
||||
Certificate: &tls.Certificate{
|
||||
CertFile: tls.FileOrContent(cert),
|
||||
KeyFile: tls.FileOrContent(key),
|
||||
|
|
|
@ -3025,7 +3025,7 @@ func TestGetTLS(t *testing.T) {
|
|||
},
|
||||
result: map[string]*tls.Configuration{
|
||||
"testing/test-secret": {
|
||||
EntryPoints: []string{"api-secure", "https"},
|
||||
Stores: []string{"api-secure", "https"},
|
||||
Certificate: &tls.Certificate{
|
||||
CertFile: tls.FileOrContent("tls-crt"),
|
||||
KeyFile: tls.FileOrContent("tls-key"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue