Skip to content

Commit

Permalink
chore(log): Add namespace to job create logs and prepend resource type
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 5, 2023
1 parent 3d5ef7a commit e76489e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/util/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit e76489e

Please sign in to comment.