diff --git a/helm/ingress-controller/Chart.lock b/helm/ingress-controller/Chart.lock index d7c4160d9..fe513e08e 100644 --- a/helm/ingress-controller/Chart.lock +++ b/helm/ingress-controller/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: https://charts.bitnami.com/bitnami - version: 2.14.1 -digest: sha256:878897ea31cf8046483dda555119f1120b6280dd5ed88d5496eef987e04b29f0 -generated: "2024-01-12T12:49:10.501156544-06:00" + version: 2.15.1 +digest: sha256:10c0c43763ec8b38161eb1e31f4d686f973bd5fed864371084b0e675f326e95f +generated: "2024-02-15T17:01:55.139356684-05:00" diff --git a/internal/controller/ingress/ingress_controller.go b/internal/controller/ingress/ingress_controller.go index 0832afb95..5815e09b2 100644 --- a/internal/controller/ingress/ingress_controller.go +++ b/internal/controller/ingress/ingress_controller.go @@ -42,7 +42,7 @@ func (r *IngressReconciler) SetupWithManager(mgr ctrl.Manager) error { for _, obj := range storedResources { builder = builder.Watches( obj, - store.NewUpdateStoreHandler(obj.GetObjectKind().GroupVersionKind().Kind, r.Driver)) + store.NewUpdateStoreHandler(obj.GetObjectKind().GroupVersionKind().Kind, r.Driver, r.Client)) } return builder.Complete(r) diff --git a/internal/store/updatestorehandler.go b/internal/store/updatestorehandler.go index ca6147db3..23adb50ba 100644 --- a/internal/store/updatestorehandler.go +++ b/internal/store/updatestorehandler.go @@ -5,6 +5,7 @@ import ( "github.com/go-logr/logr" "k8s.io/client-go/util/workqueue" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" ) @@ -18,15 +19,19 @@ var _ handler.EventHandler = &UpdateStoreHandler{} // It is used to simply watch some resources and keep their values updated in the store. // It is used to keep various crds like edges/tunnels/domains, and core resources like ingress classes, updated. type UpdateStoreHandler struct { - store Storer - log logr.Logger + client client.Client + driver *Driver + store Storer + log logr.Logger } // NewUpdateStoreHandler creates a new UpdateStoreHandler -func NewUpdateStoreHandler(resourceName string, d *Driver) *UpdateStoreHandler { +func NewUpdateStoreHandler(resourceName string, d *Driver, client client.Client) *UpdateStoreHandler { return &UpdateStoreHandler{ - store: d.store, - log: d.log.WithValues("UpdateStoreHandlerFor", resourceName), + driver: d, + client: client, + store: d.store, + log: d.log.WithValues("UpdateStoreHandlerFor", resourceName), } } @@ -44,6 +49,10 @@ func (e *UpdateStoreHandler) Update(ctx context.Context, evt event.UpdateEvent, e.log.Error(err, "error updating object in update", "object", evt.ObjectNew) return } + if err := e.driver.updateIngressStatuses(ctx, e.client); err != nil { + e.log.Error(err, "error syncing after object update", "object", evt.ObjectNew) + return + } } // Delete is called in response to a delete event - e.g. Edge Deleted.