Fix panic for empty defaultBackend and defaultBackend without resources
This commit is contained in:
parent
be27044099
commit
5d00096f82
4 changed files with 51 additions and 0 deletions
|
|
@ -269,6 +269,17 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
|
|||
continue
|
||||
}
|
||||
|
||||
if ingress.Spec.DefaultBackend.Resource != nil {
|
||||
// https://kubernetes.io/docs/concepts/services-networking/ingress/#resource-backend
|
||||
logger.Error().Msg("Resource is not supported for default backend")
|
||||
continue
|
||||
}
|
||||
|
||||
if ingress.Spec.DefaultBackend.Service == nil {
|
||||
logger.Error().Msg("Default backend is missing service definition")
|
||||
continue
|
||||
}
|
||||
|
||||
service, err := p.loadService(client, ingress.Namespace, *ingress.Spec.DefaultBackend)
|
||||
if err != nil {
|
||||
logger.Error().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue