From 4680869f1515f98c75fd15c78cb77fb2cee68710 Mon Sep 17 00:00:00 2001 From: Heba Elayoty <31887807+helayoty@users.noreply.github.com> Date: Tue, 24 Jan 2023 16:42:58 -0800 Subject: [PATCH] chore: Remove redundant logs (#425) Signed-off-by: Heba Elayoty --- pkg/client/client_apis.go | 1 - pkg/provider/aci.go | 6 ------ pkg/provider/containergroup_to_pod.go | 4 ---- 3 files changed, 11 deletions(-) diff --git a/pkg/client/client_apis.go b/pkg/client/client_apis.go index 69c78d01..d48f3499 100644 --- a/pkg/client/client_apis.go +++ b/pkg/client/client_apis.go @@ -159,7 +159,6 @@ func (a *AzClientsAPIs) GetContainerGroupInfo(ctx context.Context, resourceGroup } err = validation.ValidateContainerGroup(ctx, &response.ContainerGroup) - logger.Debugf("container group %s has missing fields. retrying the validation...", cgName) if err != nil { return nil, err } diff --git a/pkg/provider/aci.go b/pkg/provider/aci.go index 39577618..0a9a8a08 100644 --- a/pkg/provider/aci.go +++ b/pkg/provider/aci.go @@ -483,7 +483,6 @@ func (p *ACIProvider) deleteContainerGroup(ctx context.Context, podNS, podName s // GetPod returns a pod by name that is running inside ACI // returns nil if a pod by that name is not found. func (p *ACIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error) { - logger := log.G(ctx).WithField("method", "GetPod") ctx, span := trace.StartSpan(ctx, "aci.GetPod") defer span.End() ctx = addAzureAttributes(ctx, span, p) @@ -494,7 +493,6 @@ func (p *ACIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.P } err = validation.ValidateContainerGroup(ctx, cg) - logger.Debugf("container group %s has missing fields. retrying the validation...", *cg.Name) if err != nil { return nil, err } @@ -637,7 +635,6 @@ func (p *ACIProvider) RunInContainer(ctx context.Context, namespace, name, conta // GetPodStatus returns the status of a pod by name that is running inside ACI // returns nil if a pod by that name is not found. func (p *ACIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error) { - logger := log.G(ctx).WithField("method", "GetPodStatus") ctx, span := trace.StartSpan(ctx, "aci.GetPodStatus") defer span.End() ctx = addAzureAttributes(ctx, span, p) @@ -648,7 +645,6 @@ func (p *ACIProvider) GetPodStatus(ctx context.Context, namespace, name string) } err = validation.ValidateContainerGroup(ctx, cg) - logger.Debugf("container group %s has missing fields. retrying the validation...", *(*cg).Name) if err != nil { return nil, err } @@ -658,7 +654,6 @@ func (p *ACIProvider) GetPodStatus(ctx context.Context, namespace, name string) // GetPods returns a list of all pods known to be running within ACI. func (p *ACIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error) { - logger := log.G(ctx).WithField("method", "GetPods") ctx, span := trace.StartSpan(ctx, "aci.GetPods") defer span.End() ctx = addAzureAttributes(ctx, span, p) @@ -675,7 +670,6 @@ func (p *ACIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error) { for cgIndex := range cgs { err = validation.ValidateContainerGroup(ctx, cgs[cgIndex]) - logger.Debugf("container group %s has missing fields. retrying the validation...", *cgs[cgIndex].Name) if err != nil { return nil, err } diff --git a/pkg/provider/containergroup_to_pod.go b/pkg/provider/containergroup_to_pod.go index 58ad46a2..fa8313c0 100644 --- a/pkg/provider/containergroup_to_pod.go +++ b/pkg/provider/containergroup_to_pod.go @@ -13,7 +13,6 @@ import ( "github.com/virtual-kubelet/azure-aci/pkg/tests" "github.com/virtual-kubelet/azure-aci/pkg/util" "github.com/virtual-kubelet/azure-aci/pkg/validation" - "github.com/virtual-kubelet/virtual-kubelet/log" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -38,8 +37,6 @@ func (p *ACIProvider) containerGroupToPod(ctx context.Context, cg *azaciv2.Conta } func (p *ACIProvider) getPodStatusFromContainerGroup(ctx context.Context, cg *azaciv2.ContainerGroup) (*v1.PodStatus, error) { - logger := log.G(ctx).WithField("method", "getPodStatusFromContainerGroup") - // cg is validated allReady := true var firstContainerStartTime, lastUpdateTime time.Time @@ -49,7 +46,6 @@ func (p *ACIProvider) getPodStatusFromContainerGroup(ctx context.Context, cg *az for i := range containersList { err := validation.ValidateContainer(ctx, containersList[i]) - logger.Debugf("container %s has missing fields. retrying the validation...", *containersList[i].Name) if err != nil { return nil, err }