From b3118d670948c868bffde81f3d765c9ba77feb0c Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Thu, 5 Oct 2023 00:41:06 -0500 Subject: [PATCH] chore(log): Prepend resource type to pod name --- internal/actions/dump/dump.go | 2 +- internal/actions/exec/exec.go | 2 +- internal/actions/port_forward/port_forward.go | 2 +- internal/actions/restore/restore.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/actions/dump/dump.go b/internal/actions/dump/dump.go index 0fb3d688..3820a7a3 100644 --- a/internal/actions/dump/dump.go +++ b/internal/actions/dump/dump.go @@ -57,8 +57,8 @@ func (action Dump) Run(ctx context.Context) (err error) { } log.WithFields(log.Fields{ - "pod": action.Pod.Name, "namespace": action.Client.Namespace, + "name": "pod/" + action.Pod.Name, "file": action.Filename, }).Info("exporting database") diff --git a/internal/actions/exec/exec.go b/internal/actions/exec/exec.go index 74f11ee0..74f521cc 100644 --- a/internal/actions/exec/exec.go +++ b/internal/actions/exec/exec.go @@ -19,7 +19,7 @@ type Exec struct { func (action Exec) Run(ctx context.Context) error { log.WithFields(log.Fields{ "namespace": action.Client.Namespace, - "pod": action.Pod.Name, + "name": "pod/" + action.Pod.Name, }).Info("exec into pod") t := term.TTY{ diff --git a/internal/actions/port_forward/port_forward.go b/internal/actions/port_forward/port_forward.go index 3663aa9c..8992b35a 100644 --- a/internal/actions/port_forward/port_forward.go +++ b/internal/actions/port_forward/port_forward.go @@ -25,7 +25,7 @@ type PortForward struct { func (a PortForward) Run(ctx context.Context) error { log.WithFields(log.Fields{ "namespace": a.Client.Namespace, - "pod": a.Pod.Name, + "name": "pod/" + a.Pod.Name, }).Info("setting up port forward") path := fmt.Sprintf( diff --git a/internal/actions/restore/restore.go b/internal/actions/restore/restore.go index d6f187c6..4b1a900a 100644 --- a/internal/actions/restore/restore.go +++ b/internal/actions/restore/restore.go @@ -40,7 +40,7 @@ func (action Restore) Run(ctx context.Context) (err error) { log.WithFields(log.Fields{ "file": action.Filename, "namespace": action.Client.Namespace, - "pod": action.Pod.Name, + "name": "pod/" + action.Pod.Name, }).Info("ready to restore database") startTime := time.Now()