Skip to content

Commit

Permalink
fix: Remove extra info logs for the success scenarios (#444)
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Feb 7, 2023
1 parent 1612be7 commit 486ee00
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/init-container/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/aci.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,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)
}
Expand Down Expand Up @@ -439,7 +439,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)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/provider/aci_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{},
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/validation/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

0 comments on commit 486ee00

Please sign in to comment.