From f0a7c452a09a801ab5cb05818065e97ffcb58919 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Mon, 3 Jun 2024 04:18:08 +0000 Subject: [PATCH] gracefully handle private IP only gateway in 1.5 --- cmd/appgw-ingress/main.go | 4 ---- pkg/controller/mutate_app_gateway.go | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/appgw-ingress/main.go b/cmd/appgw-ingress/main.go index 3e8805c06..95c219607 100644 --- a/cmd/appgw-ingress/main.go +++ b/cmd/appgw-ingress/main.go @@ -188,10 +188,6 @@ func main() { // fatal config validations appGw, _ := azClient.GetGateway() - if err := appgw.FatalValidateOnExistingConfig(recorder, appGw.ApplicationGatewayPropertiesFormat, env); err != nil { - klog.Fatal("Got a fatal validation error on existing Application Gateway config. Please update Application Gateway or the controller's helm config. Error:", err) - } - if _, exists := allowedSkus[appGw.Sku.Tier]; !exists { errorLine := fmt.Sprintf("App Gateway SKU Tier %s is not supported by AGIC version %s; (v0.10.0 supports App Gwy v1)", appGw.Sku.Tier, appgw.GetVersion()) if agicPod != nil { diff --git a/pkg/controller/mutate_app_gateway.go b/pkg/controller/mutate_app_gateway.go index 83fd25d5d..77955280e 100644 --- a/pkg/controller/mutate_app_gateway.go +++ b/pkg/controller/mutate_app_gateway.go @@ -116,6 +116,10 @@ func (c AppGwIngressController) MutateAppGateway(event events.Event, appGw *n.Ap if c.agicPod != nil { c.recorder.Event(c.agicPod, v1.EventTypeWarning, events.ReasonInvalidAppGwConfig, errorLine) } + + for _, ingress := range cbCtx.IngressList { + c.recorder.Event(ingress, v1.EventTypeWarning, events.ReasonInvalidAppGwConfig, errorLine) + } return err } // -------------------------- //