Skip to content

Commit

Permalink
Fix crash on kube manager's service-lb-controller after v1.31.0. (#12…
Browse files Browse the repository at this point in the history
…8182)

* Fix crash on kube manager's service-lb-controller after v1.31.0.

* Update cmd/kube-controller-manager/app/controllermanager_test.go

Co-authored-by: Antonio Ojea <[email protected]>

---------

Co-authored-by: Antonio Ojea <[email protected]>

Kubernetes-commit: 442183a9298e37cb655b4a3f48462ee30e475069
  • Loading branch information
carlory authored and k8s-publishing-bot committed Oct 21, 2024
1 parent 818ab20 commit af3c44b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions controllers/service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func New(
featureGate featuregate.FeatureGate,
) (*Controller, error) {
registerMetrics()

s := &Controller{
cloud: cloud,
kubeClient: kubeClient,
Expand All @@ -126,6 +127,10 @@ func New(
lastSyncedNodes: make(map[string][]*v1.Node),
}

if err := s.init(); err != nil {
return nil, err
}

serviceInformer.Informer().AddEventHandlerWithResyncPeriod(
cache.ResourceEventHandlerFuncs{
AddFunc: func(cur interface{}) {
Expand Down Expand Up @@ -180,10 +185,6 @@ func New(
nodeSyncPeriod,
)

if err := s.init(); err != nil {
return nil, err
}

return s, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/stretchr/testify v1.9.0
k8s.io/api v0.0.0-20241018042523-2be23f6c5a71
k8s.io/apimachinery v0.0.0-20241018042225-cfee47580787
k8s.io/apiserver v0.0.0-20241018044901-1ea7befac323
k8s.io/apiserver v0.0.0-20241018204147-d0f54d59938a
k8s.io/client-go v0.0.0-20241018042940-23900f492969
k8s.io/component-base v0.0.0-20241018044032-28853230c294
k8s.io/component-helpers v0.0.0-20241018044207-e8293c2260fa
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ k8s.io/api v0.0.0-20241018042523-2be23f6c5a71 h1:ZVdZbGFz01Q02RULNKxVGB4n+GPVleT
k8s.io/api v0.0.0-20241018042523-2be23f6c5a71/go.mod h1:OIAurRK8KzzpBNXtbVYeGeeoww3j5JLZFLfrV8ZAy0Y=
k8s.io/apimachinery v0.0.0-20241018042225-cfee47580787 h1:cxDsuM/daoEa1+BWlatVGAHIkKOHpZ+2BCdP25Qmw+E=
k8s.io/apimachinery v0.0.0-20241018042225-cfee47580787/go.mod h1:y/FzDt/GaPgPceo5rJcCtD4qW5l8SwtbzESSMGEY6P8=
k8s.io/apiserver v0.0.0-20241018044901-1ea7befac323 h1:33HLhcY+kmquU8Ag7GqS+GAoSLckuQ/CJR3SxltUF8o=
k8s.io/apiserver v0.0.0-20241018044901-1ea7befac323/go.mod h1:GoKnJGpBY4iAXU/xE12hcnslu2ytcun9yr8KyMl2Yks=
k8s.io/apiserver v0.0.0-20241018204147-d0f54d59938a h1:3Is+Kl7DWggsxZpOkQnQdvyDSM7tM/tYyttLRQZ1bKQ=
k8s.io/apiserver v0.0.0-20241018204147-d0f54d59938a/go.mod h1:GoKnJGpBY4iAXU/xE12hcnslu2ytcun9yr8KyMl2Yks=
k8s.io/client-go v0.0.0-20241018042940-23900f492969 h1:LX6S0gWLFc5daPONEYO6K7NfKONG9CyoR0y8bu//F1s=
k8s.io/client-go v0.0.0-20241018042940-23900f492969/go.mod h1:ZkI5vaEAs2EGc5PRN+TNkJPU5cB4R4e+yNQxr9D/aLM=
k8s.io/component-base v0.0.0-20241018044032-28853230c294 h1:9a21ABPuF2/gSTR9cnhAsHaj6Jtap4SJ4F6EhYE89jU=
Expand Down

0 comments on commit af3c44b

Please sign in to comment.