@@ -29,6 +29,7 @@ import (
2929 "github.com/AliyunContainerService/terway/pkg/backoff"
3030 register "github.com/AliyunContainerService/terway/pkg/controller"
3131 "github.com/AliyunContainerService/terway/pkg/controller/common"
32+ "github.com/AliyunContainerService/terway/pkg/utils"
3233 "github.com/AliyunContainerService/terway/types"
3334 "github.com/AliyunContainerService/terway/types/controlplane"
3435)
@@ -45,14 +46,14 @@ type ReconcileNetworkInterface struct {
4546 resourceBackoff * BackoffManager
4647}
4748
48- const controllerName = "eni"
49+ const ControllerName = "eni"
4950
5051func init () {
51- register .Add (controllerName , func (mgr manager.Manager , ctrlCtx * register.ControllerCtx ) error {
52+ register .Add (ControllerName , func (mgr manager.Manager , ctrlCtx * register.ControllerCtx ) error {
5253 ctrlCtx .RegisterResource = append (ctrlCtx .RegisterResource , & v1beta1.NetworkInterface {})
5354
5455 err := builder .ControllerManagedBy (mgr ).
55- Named (controllerName ).
56+ Named (ControllerName ).
5657 WithOptions (controller.Options {
5758 MaxConcurrentReconciles : controlplane .GetConfig ().ENIMaxConcurrent ,
5859 LogConstructor : func (request * reconcile.Request ) logr.Logger {
@@ -69,7 +70,7 @@ func init() {
6970 client : mgr .GetClient (),
7071 scheme : mgr .GetScheme (),
7172 aliyun : ctrlCtx .AliyunClient , // use direct client
72- record : mgr .GetEventRecorderFor ("TerwayENetworkInterfaceontroller" ),
73+ record : mgr .GetEventRecorderFor (utils . EventName ( ControllerName ) ),
7374 resourceBackoff : NewBackoffManager (),
7475 })
7576
0 commit comments