Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ require (
gopkg.in/ns1/ns1-go.v2 v2.16.0
istio.io/api v1.28.1
istio.io/client-go v1.28.1
k8s.io/api v0.34.3
k8s.io/apimachinery v0.34.3
k8s.io/client-go v0.34.3
k8s.io/api v0.35.0
k8s.io/apimachinery v0.35.0
k8s.io/client-go v0.35.0
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
sigs.k8s.io/controller-runtime v0.22.4
sigs.k8s.io/gateway-api v1.4.1
)
Expand Down Expand Up @@ -201,7 +201,7 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
moul.io/http2curl v1.0.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
Expand Down
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,8 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78=
k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4=
k8s.io/api v0.34.3 h1:D12sTP257/jSH2vHV2EDYrb16bS7ULlHpdNdNhEw2S4=
k8s.io/api v0.34.3/go.mod h1:PyVQBF886Q5RSQZOim7DybQjAbVs8g7gwJNhGtY5MBk=
k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY=
k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA=
k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo=
k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY=
k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio=
Expand All @@ -1464,6 +1466,8 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc
k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko=
k8s.io/apimachinery v0.34.3 h1:/TB+SFEiQvN9HPldtlWOTp0hWbJ+fjU+wkxysf/aQnE=
k8s.io/apimachinery v0.34.3/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8=
k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw=
k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw=
k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8=
Expand All @@ -1474,6 +1478,8 @@ k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU=
k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g=
k8s.io/client-go v0.34.3 h1:wtYtpzy/OPNYf7WyNBTj3iUA0XaBHVqhv4Iv3tbrF5A=
k8s.io/client-go v0.34.3/go.mod h1:OxxeYagaP9Kdf78UrKLa3YZixMCfP6bgPwPwNBQBzpM=
k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE=
k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o=
k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
Expand All @@ -1493,6 +1499,8 @@ k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 h1:liMHz39T5dJO1aOKHLvwaCjDbf07wVh6yaUlTpunnkE=
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
k8s.io/kubectl v0.18.0/go.mod h1:LOkWx9Z5DXMEg5KtOjHhRiC1fqJPLyCr3KtQgEolCkU=
k8s.io/kubectl v0.18.4/go.mod h1:EzB+nfeUWk6fm6giXQ8P4Fayw3dsN+M7Wjy23mTRtB0=
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
Expand All @@ -1502,6 +1510,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0=
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8=
moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE=
rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY=
Expand Down
4 changes: 2 additions & 2 deletions source/ambassador_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func NewAmbassadorHostSource(
ambassadorHostInformer := informerFactory.ForResource(ambHostGVR)

// Add default resource event handlers to properly initialize informer.
ambassadorHostInformer.Informer().AddEventHandler(
_, _ = ambassadorHostInformer.Informer().AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
},
Expand All @@ -93,7 +93,7 @@ func NewAmbassadorHostSource(
informerFactory.Start(ctx.Done())

// wait for the local cache to be populated.
if err := informers.WaitForDynamicCacheSync(context.Background(), informerFactory); err != nil {
if err := informers.WaitForDynamicCacheSync(ctx, informerFactory); err != nil {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions source/cloudfoundry.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ func NewCloudFoundrySource(cfClient *cfclient.Client) (Source, error) {
}, nil
}

func (rs *cloudfoundrySource) AddEventHandler(ctx context.Context, handler func()) {
func (rs *cloudfoundrySource) AddEventHandler(_ context.Context, handler func()) {
}

// Endpoints returns endpoint objects
func (rs *cloudfoundrySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {
func (rs *cloudfoundrySource) Endpoints(_ context.Context) ([]*endpoint.Endpoint, error) {
endpoints := []*endpoint.Endpoint{}

u, err := url.Parse(rs.client.Config.ApiAddress)
Expand Down
6 changes: 3 additions & 3 deletions source/contour_httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewContourHTTPProxySource(
httpProxyInformer := informerFactory.ForResource(projectcontour.HTTPProxyGVR)

// Add default resource event handlers to properly initialize informer.
httpProxyInformer.Informer().AddEventHandler(
_, _ = httpProxyInformer.Informer().AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
},
Expand All @@ -83,7 +83,7 @@ func NewContourHTTPProxySource(
informerFactory.Start(ctx.Done())

// wait for the local cache to be populated.
if err := informers.WaitForDynamicCacheSync(context.Background(), informerFactory); err != nil {
if err := informers.WaitForDynamicCacheSync(ctx, informerFactory); err != nil {
return nil, err
}

Expand All @@ -106,7 +106,7 @@ func NewContourHTTPProxySource(

// Endpoints returns endpoint objects for each host-target combination that should be processed.
// Retrieves all HTTPProxy resources in the source's namespace(s).
func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {
func (sc *httpProxySource) Endpoints(_ context.Context) ([]*endpoint.Endpoint, error) {
hps, err := sc.httpProxyInformer.Lister().ByNamespace(sc.namespace).List(labels.Everything())
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions source/empty.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
// emptySource is a Source that returns no endpoints.
type emptySource struct{}

func (e *emptySource) AddEventHandler(ctx context.Context, handler func()) {
func (e *emptySource) AddEventHandler(_ context.Context, handler func()) {
}

// Endpoints collects endpoints of all nested Sources and returns them in a single slice.
func (e *emptySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {
func (e *emptySource) Endpoints(_ context.Context) ([]*endpoint.Endpoint, error) {
return []*endpoint.Endpoint{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion source/f5_transportserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func NewF5TransportServerSource(
informerFactory.Start(ctx.Done())

// wait for the local cache to be populated.
if err := informers.WaitForDynamicCacheSync(context.Background(), informerFactory); err != nil {
if err := informers.WaitForDynamicCacheSync(ctx, informerFactory); err != nil {
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions source/f5_virtualserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewF5VirtualServerSource(
informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicKubeClient, 0, namespace, nil)
virtualServerInformer := informerFactory.ForResource(f5VirtualServerGVR)

virtualServerInformer.Informer().AddEventHandler(
_, _ = virtualServerInformer.Informer().AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
},
Expand All @@ -78,7 +78,7 @@ func NewF5VirtualServerSource(
informerFactory.Start(ctx.Done())

// wait for the local cache to be populated.
if err := informers.WaitForDynamicCacheSync(context.Background(), informerFactory); err != nil {
if err := informers.WaitForDynamicCacheSync(ctx, informerFactory); err != nil {
return nil, err
}

Expand Down
35 changes: 20 additions & 15 deletions source/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
kubeinformers "k8s.io/client-go/informers"
coreinformers "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/tools/cache"
Expand All @@ -39,10 +38,11 @@ import (
gwinformers "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions"
informers_v1beta1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1beta1"

"sigs.k8s.io/external-dns/source/informers"

"sigs.k8s.io/external-dns/endpoint"
"sigs.k8s.io/external-dns/source/annotations"
"sigs.k8s.io/external-dns/source/fqdn"
"sigs.k8s.io/external-dns/source/informers"
)

const (
Expand Down Expand Up @@ -78,9 +78,8 @@ func newGatewayInformerFactory(client gateway.Interface, namespace string, label
opts = append(opts, gwinformers.WithNamespace(namespace))
}
if labelSelector != nil && !labelSelector.Empty() {
lbls := labelSelector.String()
opts = append(opts, gwinformers.WithTweakListOptions(func(o *metav1.ListOptions) {
o.LabelSelector = lbls
o.LabelSelector = labelSelector.String()
}))
}
return gwinformers.NewSharedInformerFactoryWithOptions(client, 0, opts...)
Expand All @@ -105,9 +104,13 @@ type gatewayRouteSource struct {
ignoreHostnameAnnotation bool
}

func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string, newInformerFn newGatewayRouteInformerFunc) (Source, error) {
ctx := context.TODO()

func newGatewayRouteSource(
ctx context.Context,
clients ClientGenerator,
config *Config,
kind string,
newInformerFn newGatewayRouteInformerFunc,
) (Source, error) {
gwLabels, err := getLabelSelector(config.GatewayLabelFilter)
if err != nil {
return nil, err
Expand Down Expand Up @@ -150,18 +153,20 @@ func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string,
nsInformer := kubeInformerFactory.Core().V1().Namespaces() // TODO: Namespace informer should be shared across gateway sources.
nsInformer.Informer() // Register with factory before starting.

informerFactory.Start(wait.NeverStop)
kubeInformerFactory.Start(wait.NeverStop)
if rtInformerFactory != informerFactory {
rtInformerFactory.Start(wait.NeverStop)
informerFactory.Start(ctx.Done())
kubeInformerFactory.Start(ctx.Done())

if rtInformerFactory != informerFactory {
rtInformerFactory.Start(ctx.Done())
if err := informers.WaitForCacheSync(ctx, rtInformerFactory); err != nil {
return nil, err
}
}

if err := informers.WaitForCacheSync(ctx, informerFactory); err != nil {
return nil, err
}

if err := informers.WaitForCacheSync(ctx, kubeInformerFactory); err != nil {
return nil, err
}
Expand All @@ -187,12 +192,12 @@ func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string,
return src, nil
}

func (src *gatewayRouteSource) AddEventHandler(ctx context.Context, handler func()) {
func (src *gatewayRouteSource) AddEventHandler(_ context.Context, handler func()) {
log.Debugf("Adding event handlers for %s", src.rtKind)
eventHandler := eventHandlerFunc(handler)
src.gwInformer.Informer().AddEventHandler(eventHandler)
src.rtInformer.Informer().AddEventHandler(eventHandler)
src.nsInformer.Informer().AddEventHandler(eventHandler)
_, _ = src.gwInformer.Informer().AddEventHandler(eventHandler)
_, _ = src.rtInformer.Informer().AddEventHandler(eventHandler)
_, _ = src.nsInformer.Informer().AddEventHandler(eventHandler)
}

func (src *gatewayRouteSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {
Expand Down
10 changes: 8 additions & 2 deletions source/gateway_grpcroute.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package source

import (
"context"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
v1 "sigs.k8s.io/gateway-api/apis/v1"
Expand All @@ -25,8 +27,12 @@ import (
)

// NewGatewayGRPCRouteSource creates a new Gateway GRPCRoute source with the given config.
func NewGatewayGRPCRouteSource(clients ClientGenerator, config *Config) (Source, error) {
return newGatewayRouteSource(clients, config, "GRPCRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
func NewGatewayGRPCRouteSource(
ctx context.Context,
clients ClientGenerator,
config *Config,
) (Source, error) {
return newGatewayRouteSource(ctx, clients, config, "GRPCRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
return &gatewayGRPCRouteInformer{factory.Gateway().V1().GRPCRoutes()}
})
}
Expand Down
12 changes: 8 additions & 4 deletions source/gateway_grpcroute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@ package source
import (
"context"
"testing"
"time"

"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubefake "k8s.io/client-go/kubernetes/fake"
"sigs.k8s.io/external-dns/endpoint"

"sigs.k8s.io/external-dns/source/annotations"
v1 "sigs.k8s.io/gateway-api/apis/v1"
v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
"sigs.k8s.io/gateway-api/apis/v1beta1"
gatewayfake "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/fake"
)

func TestGatewayGRPCRouteSourceEndpoints(t *testing.T) {
t.Parallel()

ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
defer cancel()

gwClient := gatewayfake.NewSimpleClientset()
kubeClient := kubefake.NewSimpleClientset()
kubeClient := kubefake.NewClientset()
clients := new(MockClientGenerator)
clients.On("GatewayClient").Return(gwClient, nil)
clients.On("KubeClient").Return(kubeClient, nil)

ctx := context.Background()
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "default",
Expand Down Expand Up @@ -88,7 +92,7 @@ func TestGatewayGRPCRouteSourceEndpoints(t *testing.T) {
_, err = gwClient.GatewayV1().GRPCRoutes(rt.Namespace).Create(ctx, rt, metav1.CreateOptions{})
require.NoError(t, err, "failed to create GRPCRoute")

src, err := NewGatewayGRPCRouteSource(clients, &Config{
src, err := NewGatewayGRPCRouteSource(ctx, clients, &Config{
FQDNTemplate: "{{.Name}}-template.foobar.internal",
CombineFQDNAndAnnotation: true,
})
Expand Down
10 changes: 8 additions & 2 deletions source/gateway_httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package source

import (
"context"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
v1 "sigs.k8s.io/gateway-api/apis/v1"
Expand All @@ -26,8 +28,12 @@ import (
)

// NewGatewayHTTPRouteSource creates a new Gateway HTTPRoute source with the given config.
func NewGatewayHTTPRouteSource(clients ClientGenerator, config *Config) (Source, error) {
return newGatewayRouteSource(clients, config, "HTTPRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
func NewGatewayHTTPRouteSource(
ctx context.Context,
clients ClientGenerator,
config *Config,
) (Source, error) {
return newGatewayRouteSource(ctx, clients, config, "HTTPRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
return &gatewayHTTPRouteInformer{factory.Gateway().V1beta1().HTTPRoutes()}
})
}
Expand Down
11 changes: 7 additions & 4 deletions source/gateway_httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package source
import (
"context"
"testing"
"time"

log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -1547,18 +1548,20 @@ func TestGatewayHTTPRouteSourceEndpoints(t *testing.T) {
t.Parallel()
}

ctx := context.Background()
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Second)
defer cancel()

gwClient := gatewayfake.NewSimpleClientset()
kubeClient := kubefake.NewClientset()

for _, gw := range tt.gateways {
_, err := gwClient.GatewayV1beta1().Gateways(gw.Namespace).Create(ctx, gw, metav1.CreateOptions{})
require.NoError(t, err, "failed to create Gateway")

}
for _, rt := range tt.routes {
_, err := gwClient.GatewayV1beta1().HTTPRoutes(rt.Namespace).Create(ctx, rt, metav1.CreateOptions{})
require.NoError(t, err, "failed to create HTTPRoute")
}
kubeClient := kubefake.NewSimpleClientset()
for _, ns := range tt.namespaces {
_, err := kubeClient.CoreV1().Namespaces().Create(ctx, ns, metav1.CreateOptions{})
require.NoError(t, err, "failed to create Namespace")
Expand All @@ -1568,7 +1571,7 @@ func TestGatewayHTTPRouteSourceEndpoints(t *testing.T) {
clients.On("GatewayClient").Return(gwClient, nil)
clients.On("KubeClient").Return(kubeClient, nil)

src, err := NewGatewayHTTPRouteSource(clients, &tt.config)
src, err := NewGatewayHTTPRouteSource(t.Context(), clients, &tt.config)
require.NoError(t, err, "failed to create Gateway HTTPRoute Source")

hook := testutils.LogsUnderTestWithLogLevel(log.DebugLevel, t)
Expand Down
Loading
Loading