Skip to content

Commit

Permalink
fix map concurrent read and write crash (#4302)
Browse files Browse the repository at this point in the history
Signed-off-by: oilbeater <[email protected]>
  • Loading branch information
oilbeater authored Jul 17, 2024
1 parent 26c04b1 commit 2159ff5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
v1 "k8s.io/api/authorization/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
Expand Down Expand Up @@ -52,6 +53,7 @@ func CmdMain() {
if err := checkPermission(config); err != nil {
util.LogFatalAndExit(err, "failed to check permission")
}
utilruntime.Must(kubeovnv1.AddToScheme(scheme.Scheme))

go func() {
mux := http.NewServeMux()
Expand Down
2 changes: 0 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
anpinformer "sigs.k8s.io/network-policy-api/pkg/client/informers/externalversions"
anplister "sigs.k8s.io/network-policy-api/pkg/client/listers/apis/v1alpha1"

kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1"
kubeovninformer "github.com/kubeovn/kube-ovn/pkg/client/informers/externalversions"
kubeovnlister "github.com/kubeovn/kube-ovn/pkg/client/listers/kubeovn/v1"
ovnipam "github.com/kubeovn/kube-ovn/pkg/ipam"
Expand Down Expand Up @@ -265,7 +264,6 @@ type Controller struct {

// Run creates and runs a new ovn controller
func Run(ctx context.Context, config *Configuration) {
utilruntime.Must(kubeovnv1.AddToScheme(scheme.Scheme))
klog.V(4).Info("Creating event broadcaster")
eventBroadcaster := record.NewBroadcasterWithCorrelatorOptions(record.CorrelatorOptions{BurstSize: 100})
eventBroadcaster.StartLogging(klog.Infof)
Expand Down

0 comments on commit 2159ff5

Please sign in to comment.