Skip to content

Commit

Permalink
Do not use informer for startupTranslator (#1109)
Browse files Browse the repository at this point in the history
Co-authored-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
  • Loading branch information
knative-prow-robot and nak3 authored Sep 13, 2023
1 parent a48c118 commit 9ccbee7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/reconciler/ingress/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,17 @@ func NewController(ctx context.Context, cmw configmap.Watcher) *controller.Impl
}
logger.Infof("Priming the config with %d ingresses", len(ingressesToSync))

// The startup translator uses clients instead of listeners to correctly list all
// resources at startup.
startupTranslator := generator.NewIngressTranslator(
func(ns, name string) (*corev1.Secret, error) {
return secretInformer.Lister().Secrets(ns).Get(name)
return kubernetesClient.CoreV1().Secrets(ns).Get(ctx, name, metav1.GetOptions{})
},
func(ns, name string) (*corev1.Endpoints, error) {
return endpointsInformer.Lister().Endpoints(ns).Get(name)
return kubernetesClient.CoreV1().Endpoints(ns).Get(ctx, name, metav1.GetOptions{})
},
func(ns, name string) (*corev1.Service, error) {
return serviceInformer.Lister().Services(ns).Get(name)
return kubernetesClient.CoreV1().Services(ns).Get(ctx, name, metav1.GetOptions{})
},
func(name string) (*corev1.Namespace, error) {
return namespaceInformer.Lister().Get(name)
Expand Down

0 comments on commit 9ccbee7

Please sign in to comment.