fix: avoid panic on resource backends
This commit is contained in:
parent
e29da5ad65
commit
bed6069e82
1 changed files with 9 additions and 0 deletions
|
@ -519,6 +519,15 @@ func getTLSConfig(tlsConfigs map[string]*tls.CertAndStores) []*tls.CertAndStores
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Provider) loadService(client Client, namespace string, backend netv1.IngressBackend) (*dynamic.Service, error) {
|
func (p *Provider) loadService(client Client, namespace string, backend netv1.IngressBackend) (*dynamic.Service, error) {
|
||||||
|
if backend.Resource != nil {
|
||||||
|
// https://kubernetes.io/docs/concepts/services-networking/ingress/#resource-backend
|
||||||
|
return nil, errors.New("resource backends are not supported")
|
||||||
|
}
|
||||||
|
|
||||||
|
if backend.Service == nil {
|
||||||
|
return nil, errors.New("missing service definition")
|
||||||
|
}
|
||||||
|
|
||||||
service, exists, err := client.GetService(namespace, backend.Service.Name)
|
service, exists, err := client.GetService(namespace, backend.Service.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue