From 0654b3bde1ef8caf7fef5bbf80f948e3eb420ba1 Mon Sep 17 00:00:00 2001 From: Shoaeb Jindani Date: Fri, 5 Apr 2024 20:03:47 +0530 Subject: [PATCH] Made changes based on peer review --- controllers/ibpca/ibpca_controller.go | 2 ++ controllers/ibpconsole/ibpconsole_controller.go | 2 ++ controllers/ibporderer/ibporderer_controller.go | 2 ++ controllers/ibppeer/ibppeer_controller.go | 1 + main.go | 5 +---- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/controllers/ibpca/ibpca_controller.go b/controllers/ibpca/ibpca_controller.go index 1395867f..315c6d54 100644 --- a/controllers/ibpca/ibpca_controller.go +++ b/controllers/ibpca/ibpca_controller.go @@ -193,6 +193,8 @@ func (r *ReconcileIBPCA) Reconcile(ctx context.Context, request reconcile.Reques var err error reqLogger := r.Config.Logger + reqLogger.Info(fmt.Sprintf("Request.Namespace '%s' Request.Name '%s'", request.Namespace, request.Name)) + // If ca-restart-config configmap is the object being reconciled, reconcile the // restart configmap. if request.Name == "ca-restart-config" { diff --git a/controllers/ibpconsole/ibpconsole_controller.go b/controllers/ibpconsole/ibpconsole_controller.go index df656940..373a3443 100644 --- a/controllers/ibpconsole/ibpconsole_controller.go +++ b/controllers/ibpconsole/ibpconsole_controller.go @@ -154,6 +154,8 @@ func (r *ReconcileIBPConsole) Reconcile(ctx context.Context, request reconcile.R var err error reqLogger := r.Config.Logger + reqLogger.Info(fmt.Sprintf("Request.Namespace '%s' Request.Name '%s'", request.Namespace, request.Name)) + reqLogger.Info(fmt.Sprintf("Reconciling IBPConsole with update values of [ %+v ]", r.update.GetUpdateStackWithTrues())) // Fetch the IBPConsole instance diff --git a/controllers/ibporderer/ibporderer_controller.go b/controllers/ibporderer/ibporderer_controller.go index 19f06bb6..7478178d 100644 --- a/controllers/ibporderer/ibporderer_controller.go +++ b/controllers/ibporderer/ibporderer_controller.go @@ -184,6 +184,8 @@ func (r *ReconcileIBPOrderer) Reconcile(ctx context.Context, request reconcile.R var err error reqLogger := r.Config.Logger + reqLogger.Info(fmt.Sprintf("Request.Namespace '%s' Request.Name '%s'", request.Namespace, request.Name)) + // If orderer-restart-config configmap is the object being reconciled, reconcile the // restart configmap. if request.Name == "orderer-restart-config" { diff --git a/controllers/ibppeer/ibppeer_controller.go b/controllers/ibppeer/ibppeer_controller.go index c5d96883..01b9aa0d 100644 --- a/controllers/ibppeer/ibppeer_controller.go +++ b/controllers/ibppeer/ibppeer_controller.go @@ -204,6 +204,7 @@ func (r *ReconcileIBPPeer) Reconcile(ctx context.Context, request reconcile.Requ var err error reqLogger := r.Config.Logger + reqLogger.Info(fmt.Sprintf("Request.Namespace '%s' Request.Name '%s'", request.Namespace, request.Name)) // If peer-restart-config configmap is the object being reconciled, reconcile the // restart configmap. if request.Name == "peer-restart-config" { diff --git a/main.go b/main.go index 4aa1acf1..a73b6f28 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,6 @@ package main import ( "fmt" - "os" "path/filepath" "time" @@ -75,12 +74,10 @@ func main() { operatorCfg.Operator.SetDefaults() zaplogger, err := util.SetupLogging("DEBUG") - operatorCfg.Logger = zaplogger if err != nil { fmt.Print("error initiating the logger", err) - fmt.Print("Will exit Operator", err) - os.Exit(1) } + operatorCfg.Logger = zaplogger if err := command.Operator(operatorCfg); err != nil { log.Error(err, "failed to start operator") time.Sleep(15 * time.Second)