Skip to content

Commit

Permalink
Add nil check for FrontendConfig in checkProxy()
Browse files Browse the repository at this point in the history
If you delete the FrontendConfig before the redirectUm is cleaned up,
the FrontendConfig will be nil and l7.rediretUm will not be, leading to an "unrecoverable" crash loop.
The only fix is to manually update the target proxy's link to the original urlmap.
  • Loading branch information
spencerhance authored and sawsa307 committed Dec 19, 2023
1 parent 3ca1416 commit d33c1af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/loadbalancers/target_proxies.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func (l7 *L7) checkProxy() (err error) {
// TODO(shance): move to translator
var umName string
if flags.F.EnableFrontendConfig {
if l7.redirectUm != nil && l7.runtimeInfo.FrontendConfig.Spec.RedirectToHttps != nil && l7.runtimeInfo.FrontendConfig.Spec.RedirectToHttps.Enabled {
if l7.redirectUm != nil &&
l7.runtimeInfo.FrontendConfig != nil &&
l7.runtimeInfo.FrontendConfig.Spec.RedirectToHttps != nil &&
l7.runtimeInfo.FrontendConfig.Spec.RedirectToHttps.Enabled {
umName = l7.redirectUm.Name
} else {
umName = l7.um.Name
Expand Down

0 comments on commit d33c1af

Please sign in to comment.