Skip to content

reduce logging when configuring kubectl #1383

Open
@lahabana

Description

@lahabana

Describe the bug
We use terratest extensively and we have a lot of similar logs:

   2024-01-09T16:33:09Z retry.go:91: install yaml resource
   2024-01-09T16:33:09Z logger.go:66: Running command kubectl with args [--kubeconfig /home/runner/.kube/kind-kuma-1-config apply -f /tmp/2761655101]
   2024-01-09T16:33:09Z logger.go:66: mesh.kuma.io/trafficlog-tcp-logging created
   2024-01-09T16:33:09Z retry.go:91: install yaml resource
   2024-01-09T16:33:09Z logger.go:66: Running command kubectl with args [--kubeconfig /home/runner/.kube/kind-kuma-1-config apply -f /tmp/3467148955]
   2024-01-09T16:33:09Z logger.go:66: trafficlog.kuma.io/all-traffic created
   2024-01-09T16:33:09Z retry.go:91: install yaml resource
   2024-01-09T16:33:09Z logger.go:66: Running command kubectl with args [--kubeconfig /home/runner/.kube/kind-kuma-1-config apply -f /tmp/2416380511]
   2024-01-09T16:33:09Z logger.go:66: namespace/trafficlog-tcp-logging created
   2024-01-09T16:33:09Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:09Z retry.go:91: install yaml resource
   2024-01-09T16:33:09Z logger.go:66: Running command kubectl with args [--kubeconfig /home/runner/.kube/kind-kuma-1-config apply -f /tmp/855550114]
   2024-01-09T16:33:09Z logger.go:66: deployment.apps/demo-client created
   2024-01-09T16:33:09Z retry.go:91: Wait for num pods created to match desired count 1.
   2024-01-09T16:33:09Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:09Z retry.go:103: Wait for num pods created to match desired count 1. returned an error: Desired number of pods (1) matching filter {{ } app=demo-client  false false   <nil> 0  <nil>} not yet created. Sleeping for 3s and will try again.
   2024-01-09T16:33:12Z retry.go:91: Wait for num pods created to match desired count 1.
   2024-01-09T16:33:12Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:12Z pod.go:101: Desired number of Pods created
   2024-01-09T16:33:12Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:12Z retry.go:91: Wait for pod demo-client-64788f84cd-m7j2h to be provisioned.
   2024-01-09T16:33:12Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:12Z retry.go:103: Wait for pod demo-client-64788f84cd-m7j2h to be provisioned. returned an error: Pod demo-client-64788f84cd-m7j2h is not available, reason: , message: . Sleeping for 3s and will try again.
   2024-01-09T16:33:15Z retry.go:91: Wait for pod demo-client-64788f84cd-m7j2h to be provisioned.
   2024-01-09T16:33:15Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:15Z retry.go:103: Wait for pod demo-client-64788f84cd-m7j2h to be provisioned. returned an error: Pod demo-client-64788f84cd-m7j2h is not available, reason: , message: . Sleeping for 3s and will try again.
   2024-01-09T16:33:18Z retry.go:91: Wait for pod demo-client-64788f84cd-m7j2h to be provisioned.
   2024-01-09T16:33:18Z client.go:45: Configuring Kubernetes client using config file /home/runner/.kube/kind-kuma-1-config with context 
   2024-01-09T16:33:18Z pod.go:135: Pod is now available

We'd like to make things more readable by removing occurrences of: Configuring Kubernetes client using config file

Versions

  • Terratest version: v0.46.9
  • Environment details (Ubuntu 20.04, Windows 10, etc.): any

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions