Skip to content

Commit

Permalink
BUG: avoid panic on Service processing if getBackendModel returns an …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
hdurand0710 authored and oktalz committed Jul 8, 2024
1 parent 54221e4 commit 77752b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ func (s *Service) HandleBackend(storeK8s store.K8s, client api.HAProxyClient, a
var backend *models.Backend
var newBackend *v1.BackendSpec
newBackend, err = s.getBackendModel(storeK8s, a)
s.backend = newBackend.Config
if err != nil {
s.backend = nil
return
}
s.backend = newBackend.Config
// Get/Create Backend
backend, err = client.BackendGet(newBackend.Config.Name)
if err == nil {
Expand Down

0 comments on commit 77752b4

Please sign in to comment.