From fb0d2ec7ba4abb42e21b84934adf1e568cbbc10a Mon Sep 17 00:00:00 2001 From: Heba Elayoty <31887807+helayoty@users.noreply.github.com> Date: Mon, 6 Feb 2023 23:43:41 -0800 Subject: [PATCH] fix: Remove extra info logs for the success scenarios (#444) Signed-off-by: Heba Elayoty --- cmd/init-container/main.go | 2 +- pkg/provider/aci.go | 4 ++-- pkg/provider/aci_volumes.go | 4 ++-- pkg/validation/validator.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/init-container/main.go b/cmd/init-container/main.go index 4324eda9..f41dd66f 100644 --- a/cmd/init-container/main.go +++ b/cmd/init-container/main.go @@ -31,7 +31,7 @@ func main() { logger := logrus.StandardLogger() log.L = logruslogger.FromLogrus(logrus.NewEntry(logger)) - _ = logruscli.Config{LogLevel: "debug"} + _ = logruscli.Config{LogLevel: "info"} log.G(ctx).Debug("Init container started") diff --git a/pkg/provider/aci.go b/pkg/provider/aci.go index 0a9a8a08..81e2577d 100644 --- a/pkg/provider/aci.go +++ b/pkg/provider/aci.go @@ -370,7 +370,7 @@ func (p *ACIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error { cg.Properties.Extensions = p.containerGroupExtensions } - log.G(ctx).Infof("start creating pod %v", pod.Name) + log.G(ctx).Debugf("start creating pod %v", pod.Name) // TODO: Run in a go routine to not block workers, and use tracker.UpdatePodStatus() based on result. return p.azClientsAPIs.CreateContainerGroup(ctx, p.resourceGroup, pod.Namespace, pod.Name, cg) } @@ -428,7 +428,7 @@ func (p *ACIProvider) DeletePod(ctx context.Context, pod *v1.Pod) error { defer span.End() ctx = addAzureAttributes(ctx, span, p) - log.G(ctx).Infof("start deleting pod %v", pod.Name) + log.G(ctx).Debugf("start deleting pod %v", pod.Name) // TODO: Run in a go routine to not block workers. return p.deleteContainerGroup(ctx, pod.Namespace, pod.Name) } diff --git a/pkg/provider/aci_volumes.go b/pkg/provider/aci_volumes.go index b947b9b1..40914669 100644 --- a/pkg/provider/aci_volumes.go +++ b/pkg/provider/aci_volumes.go @@ -102,7 +102,7 @@ func (p *ACIProvider) getVolumes(ctx context.Context, pod *v1.Pod) ([]*azaciv2.V // Handle the case for the EmptyDir. if podVolumes[i].EmptyDir != nil { - log.G(ctx).Info("empty volume name ", podVolumes[i].Name) + log.G(ctx).Debugf("empty volume name ", podVolumes[i].Name) volumes = append(volumes, &azaciv2.Volume{ Name: &podVolumes[i].Name, EmptyDir: map[string]interface{}{}, @@ -178,7 +178,7 @@ func (p *ACIProvider) getVolumes(ctx context.Context, pod *v1.Pod) ([]*azaciv2.V } if podVolumes[i].Projected != nil { - log.G(ctx).Info("Found projected volume") + log.G(ctx).Debug("Found projected volume") paths := make(map[string]*string) for _, source := range podVolumes[i].Projected.Sources { diff --git a/pkg/validation/validator.go b/pkg/validation/validator.go index 19329f99..68c06350 100644 --- a/pkg/validation/validator.go +++ b/pkg/validation/validator.go @@ -44,7 +44,7 @@ func ValidateContainer(ctx context.Context, container *azaciv2.Container) error if container.Properties.InstanceView.Events == nil { return errors.Errorf("container %s properties Events cannot be nil", *container.Name) } - log.G(ctx).Infof("container %s was validated successfully!", *container.Name) + log.G(ctx).Debugf("container %s was validated successfully!", *container.Name) return nil } @@ -89,6 +89,6 @@ func ValidateContainerGroup(ctx context.Context, cg *azaciv2.ContainerGroup) err } } } - log.G(ctx).Infof("container group %s was validated successfully!", *cg.Name) + log.G(ctx).Debugf("container group %s was validated successfully!", *cg.Name) return nil }