File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -226,8 +226,21 @@ func (s *statusSync) runningAddresses() ([]apiv1.LoadBalancerIngress, error) {
226226}
227227
228228func (s * statusSync ) isRunningMultiplePods () bool {
229+
230+ // As a standard, app.kubernetes.io are "reserved well-known" labels.
231+ // In our case, we add those labels as identifiers of the Ingress
232+ // deployment in this namespace, so we can select it as a set of Ingress instances.
233+ // As those labels are also generated as part of a HELM deployment, we can be "safe" they
234+ // cover 95% of the cases
235+ podLabel := make (map [string ]string )
236+ for k , v := range k8s .IngressPodDetails .Labels {
237+ if k != "pod-template-hash" && k != "controller-revision-hash" && k != "pod-template-generation" {
238+ podLabel [k ] = v
239+ }
240+ }
241+
229242 pods , err := s .Client .CoreV1 ().Pods (k8s .IngressPodDetails .Namespace ).List (context .TODO (), metav1.ListOptions {
230- LabelSelector : labels .SelectorFromSet (k8s . IngressPodDetails . Labels ).String (),
243+ LabelSelector : labels .SelectorFromSet (podLabel ).String (),
231244 })
232245 if err != nil {
233246 return false
You can’t perform that action at this time.
0 commit comments