Skip to content

Commit

Permalink
fix: key collision in structured logs (cloudnative-pg#6324)
Browse files Browse the repository at this point in the history
Inside the logs we found the name `name` as a key for a couple of values, now we
assign the proper keys like `jobName` and `podName`

Closes cloudnative-pg#6321

Signed-off-by: Jaime Silvela <[email protected]>
  • Loading branch information
jsilvela authored Dec 18, 2024
1 parent e4913b2 commit e22e7e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/controller/cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ func (r *ClusterReconciler) createPrimaryInstance(
}

contextLogger.Info("Creating new Job",
"name", job.Name,
"jobName", job.Name,
"primary", true)

utils.SetOperatorVersion(&job.ObjectMeta, versions.Version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (r *instanceClientImpl) GetStatusFromInstances(
for idx := range status.Items {
if status.Items[idx].Error != nil {
log.FromContext(ctx).Info("Cannot extract Pod status",
"name", status.Items[idx].Pod.Name,
"podName", status.Items[idx].Pod.Name,
"error", status.Items[idx].Error.Error())
}
}
Expand Down

0 comments on commit e22e7e9

Please sign in to comment.