Skip to content

Commit c15d4a6

Browse files
fix(deps): fix dependency update for kube 0.34/0.35
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 031b6e4 commit c15d4a6

26 files changed

+135
-72
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ require (
6969
gopkg.in/ns1/ns1-go.v2 v2.16.0
7070
istio.io/api v1.28.1
7171
istio.io/client-go v1.28.1
72-
k8s.io/api v0.34.3
73-
k8s.io/apimachinery v0.34.3
74-
k8s.io/client-go v0.34.3
72+
k8s.io/api v0.35.0
73+
k8s.io/apimachinery v0.35.0
74+
k8s.io/client-go v0.35.0
7575
k8s.io/klog/v2 v2.130.1
76-
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
76+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
7777
sigs.k8s.io/controller-runtime v0.22.4
7878
sigs.k8s.io/gateway-api v1.4.1
7979
)
@@ -201,7 +201,7 @@ require (
201201
gopkg.in/ini.v1 v1.67.0 // indirect
202202
gopkg.in/yaml.v2 v2.4.0 // indirect
203203
gopkg.in/yaml.v3 v3.0.1 // indirect
204-
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 // indirect
204+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
205205
moul.io/http2curl v1.0.0 // indirect
206206
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
207207
sigs.k8s.io/randfill v1.0.0 // indirect

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,8 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78=
14541454
k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4=
14551455
k8s.io/api v0.34.3 h1:D12sTP257/jSH2vHV2EDYrb16bS7ULlHpdNdNhEw2S4=
14561456
k8s.io/api v0.34.3/go.mod h1:PyVQBF886Q5RSQZOim7DybQjAbVs8g7gwJNhGtY5MBk=
1457+
k8s.io/api v0.35.0 h1:iBAU5LTyBI9vw3L5glmat1njFK34srdLmktWwLTprlY=
1458+
k8s.io/api v0.35.0/go.mod h1:AQ0SNTzm4ZAczM03QH42c7l3bih1TbAXYo0DkF8ktnA=
14571459
k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo=
14581460
k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY=
14591461
k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio=
@@ -1464,6 +1466,8 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc
14641466
k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko=
14651467
k8s.io/apimachinery v0.34.3 h1:/TB+SFEiQvN9HPldtlWOTp0hWbJ+fjU+wkxysf/aQnE=
14661468
k8s.io/apimachinery v0.34.3/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
1469+
k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8=
1470+
k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
14671471
k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw=
14681472
k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw=
14691473
k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8=
@@ -1474,6 +1478,8 @@ k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU=
14741478
k8s.io/client-go v0.18.4/go.mod h1:f5sXwL4yAZRkAtzOxRWUhA/N8XzGCb+nPZI8PfobZ9g=
14751479
k8s.io/client-go v0.34.3 h1:wtYtpzy/OPNYf7WyNBTj3iUA0XaBHVqhv4Iv3tbrF5A=
14761480
k8s.io/client-go v0.34.3/go.mod h1:OxxeYagaP9Kdf78UrKLa3YZixMCfP6bgPwPwNBQBzpM=
1481+
k8s.io/client-go v0.35.0 h1:IAW0ifFbfQQwQmga0UdoH0yvdqrbwMdq9vIFEhRpxBE=
1482+
k8s.io/client-go v0.35.0/go.mod h1:q2E5AAyqcbeLGPdoRB+Nxe3KYTfPce1Dnu1myQdqz9o=
14771483
k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
14781484
k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc=
14791485
k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
@@ -1493,6 +1499,8 @@ k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C
14931499
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
14941500
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3 h1:liMHz39T5dJO1aOKHLvwaCjDbf07wVh6yaUlTpunnkE=
14951501
k8s.io/kube-openapi v0.0.0-20250814151709-d7b6acb124c3/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
1502+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
1503+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
14961504
k8s.io/kubectl v0.18.0/go.mod h1:LOkWx9Z5DXMEg5KtOjHhRiC1fqJPLyCr3KtQgEolCkU=
14971505
k8s.io/kubectl v0.18.4/go.mod h1:EzB+nfeUWk6fm6giXQ8P4Fayw3dsN+M7Wjy23mTRtB0=
14981506
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
@@ -1502,6 +1510,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
15021510
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
15031511
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0=
15041512
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
1513+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
1514+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
15051515
moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8=
15061516
moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE=
15071517
rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY=

source/ambassador_host.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func NewAmbassadorHostSource(
8383
ambassadorHostInformer := informerFactory.ForResource(ambHostGVR)
8484

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

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

source/cloudfoundry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ func NewCloudFoundrySource(cfClient *cfclient.Client) (Source, error) {
3636
}, nil
3737
}
3838

39-
func (rs *cloudfoundrySource) AddEventHandler(ctx context.Context, handler func()) {
39+
func (rs *cloudfoundrySource) AddEventHandler(_ context.Context, handler func()) {
4040
}
4141

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

4646
u, err := url.Parse(rs.client.Config.ApiAddress)

source/contour_httpproxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func NewContourHTTPProxySource(
7373
httpProxyInformer := informerFactory.ForResource(projectcontour.HTTPProxyGVR)
7474

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

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

@@ -106,7 +106,7 @@ func NewContourHTTPProxySource(
106106

107107
// Endpoints returns endpoint objects for each host-target combination that should be processed.
108108
// Retrieves all HTTPProxy resources in the source's namespace(s).
109-
func (sc *httpProxySource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {
109+
func (sc *httpProxySource) Endpoints(_ context.Context) ([]*endpoint.Endpoint, error) {
110110
hps, err := sc.httpProxyInformer.Lister().ByNamespace(sc.namespace).List(labels.Everything())
111111
if err != nil {
112112
return nil, err

source/empty.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
// emptySource is a Source that returns no endpoints.
2626
type emptySource struct{}
2727

28-
func (e *emptySource) AddEventHandler(ctx context.Context, handler func()) {
28+
func (e *emptySource) AddEventHandler(_ context.Context, handler func()) {
2929
}
3030

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

source/f5_transportserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func NewF5TransportServerSource(
7878
informerFactory.Start(ctx.Done())
7979

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

source/f5_virtualserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func NewF5VirtualServerSource(
6868
informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicKubeClient, 0, namespace, nil)
6969
virtualServerInformer := informerFactory.ForResource(f5VirtualServerGVR)
7070

71-
virtualServerInformer.Informer().AddEventHandler(
71+
_, _ = virtualServerInformer.Informer().AddEventHandler(
7272
cache.ResourceEventHandlerFuncs{
7373
AddFunc: func(obj interface{}) {
7474
},
@@ -78,7 +78,7 @@ func NewF5VirtualServerSource(
7878
informerFactory.Start(ctx.Done())
7979

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

source/gateway.go

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
"k8s.io/apimachinery/pkg/labels"
3131
"k8s.io/apimachinery/pkg/types"
32-
"k8s.io/apimachinery/pkg/util/wait"
3332
kubeinformers "k8s.io/client-go/informers"
3433
coreinformers "k8s.io/client-go/informers/core/v1"
3534
"k8s.io/client-go/tools/cache"
@@ -39,10 +38,11 @@ import (
3938
gwinformers "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions"
4039
informers_v1beta1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis/v1beta1"
4140

41+
"sigs.k8s.io/external-dns/source/informers"
42+
4243
"sigs.k8s.io/external-dns/endpoint"
4344
"sigs.k8s.io/external-dns/source/annotations"
4445
"sigs.k8s.io/external-dns/source/fqdn"
45-
"sigs.k8s.io/external-dns/source/informers"
4646
)
4747

4848
const (
@@ -78,9 +78,8 @@ func newGatewayInformerFactory(client gateway.Interface, namespace string, label
7878
opts = append(opts, gwinformers.WithNamespace(namespace))
7979
}
8080
if labelSelector != nil && !labelSelector.Empty() {
81-
lbls := labelSelector.String()
8281
opts = append(opts, gwinformers.WithTweakListOptions(func(o *metav1.ListOptions) {
83-
o.LabelSelector = lbls
82+
o.LabelSelector = labelSelector.String()
8483
}))
8584
}
8685
return gwinformers.NewSharedInformerFactoryWithOptions(client, 0, opts...)
@@ -105,9 +104,13 @@ type gatewayRouteSource struct {
105104
ignoreHostnameAnnotation bool
106105
}
107106

108-
func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string, newInformerFn newGatewayRouteInformerFunc) (Source, error) {
109-
ctx := context.TODO()
110-
107+
func newGatewayRouteSource(
108+
ctx context.Context,
109+
clients ClientGenerator,
110+
config *Config,
111+
kind string,
112+
newInformerFn newGatewayRouteInformerFunc,
113+
) (Source, error) {
111114
gwLabels, err := getLabelSelector(config.GatewayLabelFilter)
112115
if err != nil {
113116
return nil, err
@@ -150,18 +153,20 @@ func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string,
150153
nsInformer := kubeInformerFactory.Core().V1().Namespaces() // TODO: Namespace informer should be shared across gateway sources.
151154
nsInformer.Informer() // Register with factory before starting.
152155

153-
informerFactory.Start(wait.NeverStop)
154-
kubeInformerFactory.Start(wait.NeverStop)
155-
if rtInformerFactory != informerFactory {
156-
rtInformerFactory.Start(wait.NeverStop)
156+
informerFactory.Start(ctx.Done())
157+
kubeInformerFactory.Start(ctx.Done())
157158

159+
if rtInformerFactory != informerFactory {
160+
rtInformerFactory.Start(ctx.Done())
158161
if err := informers.WaitForCacheSync(ctx, rtInformerFactory); err != nil {
159162
return nil, err
160163
}
161164
}
165+
162166
if err := informers.WaitForCacheSync(ctx, informerFactory); err != nil {
163167
return nil, err
164168
}
169+
165170
if err := informers.WaitForCacheSync(ctx, kubeInformerFactory); err != nil {
166171
return nil, err
167172
}
@@ -187,12 +192,12 @@ func newGatewayRouteSource(clients ClientGenerator, config *Config, kind string,
187192
return src, nil
188193
}
189194

190-
func (src *gatewayRouteSource) AddEventHandler(ctx context.Context, handler func()) {
195+
func (src *gatewayRouteSource) AddEventHandler(_ context.Context, handler func()) {
191196
log.Debugf("Adding event handlers for %s", src.rtKind)
192197
eventHandler := eventHandlerFunc(handler)
193-
src.gwInformer.Informer().AddEventHandler(eventHandler)
194-
src.rtInformer.Informer().AddEventHandler(eventHandler)
195-
src.nsInformer.Informer().AddEventHandler(eventHandler)
198+
_, _ = src.gwInformer.Informer().AddEventHandler(eventHandler)
199+
_, _ = src.rtInformer.Informer().AddEventHandler(eventHandler)
200+
_, _ = src.nsInformer.Informer().AddEventHandler(eventHandler)
196201
}
197202

198203
func (src *gatewayRouteSource) Endpoints(ctx context.Context) ([]*endpoint.Endpoint, error) {

source/gateway_grpcroute.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
package source
1818

1919
import (
20+
"context"
21+
2022
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2123
"k8s.io/apimachinery/pkg/labels"
2224
v1 "sigs.k8s.io/gateway-api/apis/v1"
@@ -25,8 +27,12 @@ import (
2527
)
2628

2729
// NewGatewayGRPCRouteSource creates a new Gateway GRPCRoute source with the given config.
28-
func NewGatewayGRPCRouteSource(clients ClientGenerator, config *Config) (Source, error) {
29-
return newGatewayRouteSource(clients, config, "GRPCRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
30+
func NewGatewayGRPCRouteSource(
31+
ctx context.Context,
32+
clients ClientGenerator,
33+
config *Config,
34+
) (Source, error) {
35+
return newGatewayRouteSource(ctx, clients, config, "GRPCRoute", func(factory informers.SharedInformerFactory) gatewayRouteInformer {
3036
return &gatewayGRPCRouteInformer{factory.Gateway().V1().GRPCRoutes()}
3137
})
3238
}

0 commit comments

Comments
 (0)