Skip to content

Commit

Permalink
fix var checkcontroller name in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
Uburro committed Jan 27, 2025
1 parent 37c62dd commit 51e486f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions cmd/checkcontroller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ import (
)

var (
controllerName = "checkcontroller"
scheme = runtime.NewScheme()
scheme = runtime.NewScheme()
)

func init() {
Expand Down Expand Up @@ -184,10 +183,10 @@ func main() {
if err = checkcontroller.NewCheckControllerReconciler(
mgr.GetClient(),
mgr.GetScheme(),
mgr.GetEventRecorderFor(controllerName),
mgr.GetEventRecorderFor(checkcontroller.ControllerName),
reconcileTimeout,
).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", controllerName)
setupLog.Error(err, "unable to create controller", checkcontroller.ControllerName)
os.Exit(1)
}
//+kubebuilder:scaffold:builder
Expand Down
4 changes: 2 additions & 2 deletions internal/checkcontroller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
//+kubebuilder:rbac:groups=core,resources=nodes/status,verbs=get;update

var (
controllerName = "checkcontroller"
ControllerName = "checkcontroller"
SlurmNodeCondition = corev1.NodeConditionType("SlurmDown")
)

Expand All @@ -47,7 +47,7 @@ func NewCheckControllerReconciler(client client.Client, scheme *runtime.Scheme,
}

func (r *CheckControllerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
logger := log.FromContext(ctx).WithName(controllerName)
logger := log.FromContext(ctx).WithName(ControllerName)
logger.Info(fmt.Sprintf("Reconciling %s/%s", req.Namespace, req.Name))

logger.V(1).Info("Running scontrol command")
Expand Down

0 comments on commit 51e486f

Please sign in to comment.