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 @@ -215,8 +215,21 @@ func (s *statusSync) runningAddresses() ([]string, error) {
215215}
216216
217217func (s * statusSync ) isRunningMultiplePods () bool {
218+
219+ // As a standard, app.kubernetes.io are "reserved well-known" labels.
220+ // In our case, we add those labels as identifiers of the Ingress
221+ // deployment in this namespace, so we can select it as a set of Ingress instances.
222+ // As those labels are also generated as part of a HELM deployment, we can be "safe" they
223+ // cover 95% of the cases
224+ podLabel := make (map [string ]string )
225+ for k , v := range k8s .IngressPodDetails .Labels {
226+ if k != "pod-template-hash" && k != "controller-revision-hash" && k != "pod-template-generation" {
227+ podLabel [k ] = v
228+ }
229+ }
230+
218231 pods , err := s .Client .CoreV1 ().Pods (k8s .IngressPodDetails .Namespace ).List (context .TODO (), metav1.ListOptions {
219- LabelSelector : labels .SelectorFromSet (k8s . IngressPodDetails . Labels ).String (),
232+ LabelSelector : labels .SelectorFromSet (podLabel ).String (),
220233 })
221234 if err != nil {
222235 return false
You can’t perform that action at this time.
0 commit comments