From 2cf845ac0ea639aed0457cd828fee721e3e0fe5e Mon Sep 17 00:00:00 2001 From: timmeyerLeanIX Date: Mon, 12 Jun 2023 10:36:28 +0200 Subject: [PATCH] Update logging to exclude secrets --- pkg/kubernetes/deployments.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kubernetes/deployments.go b/pkg/kubernetes/deployments.go index 03d5876..820db02 100644 --- a/pkg/kubernetes/deployments.go +++ b/pkg/kubernetes/deployments.go @@ -11,9 +11,11 @@ import ( // Deployments gets the list of deployments in a namespace func (k *API) Deployments(namespace string) (*v1.DeploymentList, error) { deployments, err := k.Client.AppsV1().Deployments(namespace).List(context.Background(), metav1.ListOptions{}) - logger.Infof("list of workload deployments: %v", deployments) if err != nil { return nil, err } + for _, deployment := range deployments.Items { + logger.Infof("Deployment: name=%s, namespace=%s, labels=%v", deployment.Name, deployment.Namespace, deployment.Labels) + } return deployments, nil }