From e76489e000e9ce3238e6f665285b43da7abe76f9 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Thu, 5 Oct 2023 00:40:50 -0500 Subject: [PATCH] chore(log): Add namespace to job create logs and prepend resource type --- internal/util/cmd_setup.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/util/cmd_setup.go b/internal/util/cmd_setup.go index 72e13d57..ddf360da 100644 --- a/internal/util/cmd_setup.go +++ b/internal/util/cmd_setup.go @@ -260,7 +260,7 @@ func createJob(cmd *cobra.Command, conf *config.Global, actionName string) error }, } - log.Debug("creating job") + log.WithField("namespace", conf.Namespace).Debug("creating job") ctx, cancel := context.WithTimeout(cmd.Context(), time.Minute) defer cancel() @@ -276,7 +276,10 @@ func createJob(cmd *cobra.Command, conf *config.Global, actionName string) error } func waitForPod(cmd *cobra.Command, conf *config.Global) error { - log.WithField("name", conf.Job.ObjectMeta.Name).Info("waiting for job...") + log.WithFields(log.Fields{ + "namespace": conf.Namespace, + "name": "job.batch/" + conf.Job.ObjectMeta.Name, + }).Info("waiting for job...") ctx, cancel := context.WithTimeout(cmd.Context(), 5*time.Minute) defer cancel()