Adjusting logging level on various logs

This commit is contained in:
jillianwilson
2023-08-02 16:44:01 -03:00
parent 372a5f4aa9
commit 10cfb55350
6 changed files with 35 additions and 7 deletions

View File

@@ -28,6 +28,7 @@ import (
"context"
"fmt"
"regexp"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"github.com/1Password/connect-sdk-go/connect"
@@ -72,7 +73,7 @@ type DeploymentReconciler struct {
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile
func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
reqLogger := logDeployment.WithValues("Request.Namespace", req.Namespace, "Request.Name", req.Name)
reqLogger.Info("Reconciling Deployment")
reqLogger.V(1).Info("Reconciling Deployment")
deployment := &appsv1.Deployment{}
err := r.Get(context.Background(), req.NamespacedName, deployment)
@@ -85,7 +86,7 @@ func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request)
annotations, annotationsFound := op.GetAnnotationsForDeployment(deployment, r.OpAnnotationRegExp)
if !annotationsFound {
reqLogger.Info("No 1Password Annotations found")
reqLogger.V(1).Info("No 1Password Annotations found")
return ctrl.Result{}, nil
}