fix: TLS domains with IngressRoute.
This commit is contained in:
parent
232c113dae
commit
be90b20a5d
5 changed files with 23 additions and 2 deletions
|
@ -123,6 +123,7 @@ func (p *Provider) loadIngressRouteConfiguration(ctx context.Context, client Cli
|
||||||
if ingressRoute.Spec.TLS != nil {
|
if ingressRoute.Spec.TLS != nil {
|
||||||
tlsConf := &dynamic.RouterTLSConfig{
|
tlsConf := &dynamic.RouterTLSConfig{
|
||||||
CertResolver: ingressRoute.Spec.TLS.CertResolver,
|
CertResolver: ingressRoute.Spec.TLS.CertResolver,
|
||||||
|
Domains: ingressRoute.Spec.TLS.Domains,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ingressRoute.Spec.TLS.Options != nil && len(ingressRoute.Spec.TLS.Options.Name) > 0 {
|
if ingressRoute.Spec.TLS.Options != nil && len(ingressRoute.Spec.TLS.Options.Name) > 0 {
|
||||||
|
|
|
@ -80,6 +80,7 @@ func (p *Provider) loadIngressRouteTCPConfiguration(ctx context.Context, client
|
||||||
conf.Routers[serviceName].TLS = &dynamic.RouterTCPTLSConfig{
|
conf.Routers[serviceName].TLS = &dynamic.RouterTCPTLSConfig{
|
||||||
Passthrough: ingressRouteTCP.Spec.TLS.Passthrough,
|
Passthrough: ingressRouteTCP.Spec.TLS.Passthrough,
|
||||||
CertResolver: ingressRouteTCP.Spec.TLS.CertResolver,
|
CertResolver: ingressRouteTCP.Spec.TLS.CertResolver,
|
||||||
|
Domains: ingressRouteTCP.Spec.TLS.Domains,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ingressRouteTCP.Spec.TLS.Options != nil && len(ingressRouteTCP.Spec.TLS.Options.Name) > 0 {
|
if ingressRouteTCP.Spec.TLS.Options != nil && len(ingressRouteTCP.Spec.TLS.Options.Name) > 0 {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/containous/traefik/v2/pkg/types"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -32,8 +33,9 @@ type TLS struct {
|
||||||
// certificate details.
|
// certificate details.
|
||||||
SecretName string `json:"secretName"`
|
SecretName string `json:"secretName"`
|
||||||
// Options is a reference to a TLSOption, that specifies the parameters of the TLS connection.
|
// Options is a reference to a TLSOption, that specifies the parameters of the TLS connection.
|
||||||
Options *TLSOptionRef `json:"options"`
|
Options *TLSOptionRef `json:"options,omitempty"`
|
||||||
CertResolver string `json:"certResolver"`
|
CertResolver string `json:"certResolver,omitempty"`
|
||||||
|
Domains []types.Domain `json:"domains,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLSOptionRef is a ref to the TLSOption resources.
|
// TLSOptionRef is a ref to the TLSOption resources.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/containous/traefik/v2/pkg/types"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@ type TLSTCP struct {
|
||||||
// Options is a reference to a TLSOption, that specifies the parameters of the TLS connection.
|
// Options is a reference to a TLSOption, that specifies the parameters of the TLS connection.
|
||||||
Options *TLSOptionTCPRef `json:"options"`
|
Options *TLSOptionTCPRef `json:"options"`
|
||||||
CertResolver string `json:"certResolver"`
|
CertResolver string `json:"certResolver"`
|
||||||
|
Domains []types.Domain `json:"domains,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLSOptionTCPRef is a ref to the TLSOption resources.
|
// TLSOptionTCPRef is a ref to the TLSOption resources.
|
||||||
|
|
|
@ -30,6 +30,7 @@ package v1alpha1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
dynamic "github.com/containous/traefik/v2/pkg/config/dynamic"
|
dynamic "github.com/containous/traefik/v2/pkg/config/dynamic"
|
||||||
|
types "github.com/containous/traefik/v2/pkg/types"
|
||||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -654,6 +655,13 @@ func (in *TLS) DeepCopyInto(out *TLS) {
|
||||||
*out = new(TLSOptionRef)
|
*out = new(TLSOptionRef)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.Domains != nil {
|
||||||
|
in, out := &in.Domains, &out.Domains
|
||||||
|
*out = make([]types.Domain, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -789,6 +797,13 @@ func (in *TLSTCP) DeepCopyInto(out *TLSTCP) {
|
||||||
*out = new(TLSOptionTCPRef)
|
*out = new(TLSOptionTCPRef)
|
||||||
**out = **in
|
**out = **in
|
||||||
}
|
}
|
||||||
|
if in.Domains != nil {
|
||||||
|
in, out := &in.Domains, &out.Domains
|
||||||
|
*out = make([]types.Domain, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue