Skip to content

Commit

Permalink
Merge pull request kubernetes#126688 from wedaly/automated-cherry-pic…
Browse files Browse the repository at this point in the history
…k-of-#126532-upstream-release-1.30

Automated cherry pick of kubernetes#126532: kube-proxy: initialization wait for service and endpoint
  • Loading branch information
k8s-ci-robot authored Aug 28, 2024
2 parents 70d5fff + c72ac98 commit 8bd6c10
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/proxy/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ type EndpointSliceConfig struct {

// NewEndpointSliceConfig creates a new EndpointSliceConfig.
func NewEndpointSliceConfig(endpointSliceInformer discoveryv1informers.EndpointSliceInformer, resyncPeriod time.Duration) *EndpointSliceConfig {
result := &EndpointSliceConfig{
listerSynced: endpointSliceInformer.Informer().HasSynced,
}
result := &EndpointSliceConfig{}

_, _ = endpointSliceInformer.Informer().AddEventHandlerWithResyncPeriod(
handlerRegistration, _ := endpointSliceInformer.Informer().AddEventHandlerWithResyncPeriod(
cache.ResourceEventHandlerFuncs{
AddFunc: result.handleAddEndpointSlice,
UpdateFunc: result.handleUpdateEndpointSlice,
Expand All @@ -88,6 +86,8 @@ func NewEndpointSliceConfig(endpointSliceInformer discoveryv1informers.EndpointS
resyncPeriod,
)

result.listerSynced = handlerRegistration.HasSynced

return result
}

Expand Down Expand Up @@ -166,11 +166,9 @@ type ServiceConfig struct {

// NewServiceConfig creates a new ServiceConfig.
func NewServiceConfig(serviceInformer v1informers.ServiceInformer, resyncPeriod time.Duration) *ServiceConfig {
result := &ServiceConfig{
listerSynced: serviceInformer.Informer().HasSynced,
}
result := &ServiceConfig{}

_, _ = serviceInformer.Informer().AddEventHandlerWithResyncPeriod(
handlerRegistration, _ := serviceInformer.Informer().AddEventHandlerWithResyncPeriod(
cache.ResourceEventHandlerFuncs{
AddFunc: result.handleAddService,
UpdateFunc: result.handleUpdateService,
Expand All @@ -179,6 +177,8 @@ func NewServiceConfig(serviceInformer v1informers.ServiceInformer, resyncPeriod
resyncPeriod,
)

result.listerSynced = handlerRegistration.HasSynced

return result
}

Expand Down

0 comments on commit 8bd6c10

Please sign in to comment.