@@ -20,6 +20,7 @@ import (
2020 "context"
2121 "time"
2222
23+ "github.com/AliyunContainerService/terway/pkg/utils"
2324 "sigs.k8s.io/controller-runtime/pkg/builder"
2425
2526 aliyunClient "github.com/AliyunContainerService/terway/pkg/aliyun/client"
@@ -41,14 +42,14 @@ import (
4142 "sigs.k8s.io/controller-runtime/pkg/reconcile"
4243)
4344
44- const controllerName = "pod-networking"
45+ const ControllerName = "pod-networking"
4546
4647func init () {
47- register .Add (controllerName , func (mgr manager.Manager , ctrlCtx * register.ControllerCtx ) error {
48+ register .Add (ControllerName , func (mgr manager.Manager , ctrlCtx * register.ControllerCtx ) error {
4849 ctrlCtx .RegisterResource = append (ctrlCtx .RegisterResource , & v1beta1.PodNetworking {})
4950
5051 err := builder .ControllerManagedBy (mgr ).
51- Named (controllerName ).
52+ Named (ControllerName ).
5253 WithOptions (controller.Options {
5354 MaxConcurrentReconciles : 1 ,
5455 }).
@@ -76,7 +77,7 @@ type ReconcilePodNetworking struct {
7677func NewReconcilePodNetworking (mgr manager.Manager , aliyunClient aliyunClient.OpenAPI , swPool * vswitch.SwitchPool ) * ReconcilePodNetworking {
7778 r := & ReconcilePodNetworking {
7879 client : mgr .GetClient (),
79- record : mgr .GetEventRecorderFor ("PodNetworking" ),
80+ record : mgr .GetEventRecorderFor (utils . EventName ( ControllerName ) ),
8081 aliyunClient : aliyunClient ,
8182 swPool : swPool ,
8283 }
0 commit comments