Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Shoaeb Jindani <[email protected]>
  • Loading branch information
Shoaeb Jindani committed Apr 5, 2024
1 parent 67f545f commit 6983d24
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion controllers/ibpconsole/ibpconsole_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ type ReconcileIBPConsole struct {
func (r *ReconcileIBPConsole) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
var err error

//reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name)
reqLogger := r.Config.Logger
reqLogger.Info(fmt.Sprintf("Reconciling IBPConsole with update values of [ %+v ]", r.update.GetUpdateStackWithTrues()))

Expand Down
1 change: 0 additions & 1 deletion controllers/ibporderer/ibporderer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ type ReconcileIBPOrderer struct {
func (r *ReconcileIBPOrderer) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
var err error

//reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name)
reqLogger := r.Config.Logger
// If orderer-restart-config configmap is the object being reconciled, reconcile the
// restart configmap.
Expand Down
1 change: 0 additions & 1 deletion controllers/ibppeer/ibppeer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ type ReconcileIBPPeer struct {
func (r *ReconcileIBPPeer) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
var err error

//reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name)
reqLogger := r.Config.Logger
// If peer-restart-config configmap is the object being reconciled, reconcile the
// restart configmap.
Expand Down
6 changes: 0 additions & 6 deletions integration/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ import (
// GetOperatorConfig returns the operator configuration with the default templating files population
// and with default versions set for components.
func GetOperatorConfig(configs, caFiles, peerFiles, ordererFiles, consoleFiles string) *config.Config {
// ulevel := uzap.NewAtomicLevelAt(2)
// if os.Getenv("LOG_LEVEL") == "debug" {
// ulevel = uzap.NewAtomicLevelAt(-1)
// }
// level := zap.Level(&ulevel)
// logger := zap.New(zap.Opts(level))
zaplogger, err := util.SetupLogging("DEBUG")
if err != nil {
fmt.Print("error initiating the logger", err)
Expand Down
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func main() {
time.Sleep(15 * time.Second)
}

// // TODO
// TODO
// if err = (&ibpca.IBPCAReconciler{
// Client: mgr.GetClient(),
// Log: ctrl.Log.WithName("controllers").WithName("IBPCA"),
Expand Down Expand Up @@ -123,7 +123,6 @@ func main() {
}

func setDefaultCADefinitions(cfg *config.Config) {

cfg.CAInitConfig = &cainit.Config{
CADefaultConfigPath: filepath.Join(defaultConfigs, "ca/ca.yaml"),
TLSCADefaultConfigPath: filepath.Join(defaultConfigs, "ca/tlsca.yaml"),
Expand Down
4 changes: 1 addition & 3 deletions pkg/command/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ func OperatorWithSignal(operatorCfg *oconfig.Config, signalHandler context.Conte
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
logger, err := config.Build()
if err != nil {
panic(fmt.Sprintf("failed to initialize logger: %v", err))
fmt.Sprintf("failed to initialize logger: %v", err)
}

// Wrap the zap.Logger with go-logr/zapr to satisfy the logr.Logger interface
log := zapr.NewLogger(logger)

logf.SetLogger(log)
ctrl.SetLogger(log)
} else {
Expand Down

0 comments on commit 6983d24

Please sign in to comment.