diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index 708e20f..580f476 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -1,6 +1,6 @@ /* Copyright 2015 The Kubernetes Authors. -Copyright 2022 The Alibaba Authors. +Copyright 2022-2023 The Alibaba Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -159,11 +159,13 @@ func (n *NGINXController) syncIngress(interface{}) error { klog.Infof("Configuration changes detected.") n.metricCollector.SetHosts(hosts) + hash, _ := hashstructure.Hash(pcfg, &hashstructure.HashOptions{ TagName: "json", }) pcfg.ConfigurationChecksum = fmt.Sprintf("%v", hash) + err := n.OnUpdate(*pcfg) if err != nil { n.metricCollector.IncReloadErrorCount() @@ -477,7 +479,7 @@ func (n *NGINXController) getDefaultUpstream() *ingress.Backend { } // getConfiguration returns the configuration matching the standard kubernetes ingress -func (n *NGINXController) getConfiguration(ingresses []*ingress.Ingress) (sets.String, []*ingress.Server, *ingress.Configuration) { +func (n *NGINXController) getConfiguration(ingresses []*ingress.Ingress) (sets.Set[string], []*ingress.Server, *ingress.Configuration) { upstreams, servers := n.getBackendServers(ingresses) var passUpstreams []*ingress.SSLPassthroughBackend