Skip to content

Commit

Permalink
Added fix for istio gateway and vs heterogenous deployment (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahtr authored and azun committed Jan 30, 2024
1 parent eee36ee commit 90a359f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions charts/external-dns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ spec:
{{- if .Values.triggerLoopOnEvent }}
- --events
{{- end }}
{{- if .Values.awsPreferCname }}
- --aws-prefer-cname
{{- end }}
{{- if .Values.watchNamespaces }}
- --namespace={{ .Values.watchNamespaces | join "," }}
{{- end }}
Expand Down
5 changes: 3 additions & 2 deletions source/istio_virtualservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,14 @@ func (sc *virtualServiceSource) targetsFromGateway(ctx context.Context, gateway
return
}

services, err := sc.serviceInformer.Lister().Services(sc.namespace).List(labels.Everything())
// Use kubeclient instead of informers to fetch services from gateway namespace
services, err := sc.kubeClient.CoreV1().Services(gateway.Namespace).List(ctx, metav1.ListOptions{})
if err != nil {
log.Error(err)
return
}

for _, service := range services {
for _, service := range services.Items {
if !gatewaySelectorMatchesServiceSelector(gateway.Spec.Selector, service.Spec.Selector) {
continue
}
Expand Down

0 comments on commit 90a359f

Please sign in to comment.