| 1381 | } |
| 1382 | |
| 1383 | func (woc *wfOperationCtx) printPodSpecLog(ctx context.Context, pod *apiv1.Pod, wfName string) { |
| 1384 | podSpecByte, err := json.Marshal(pod) |
| 1385 | log := woc.log.WithField("workflow", wfName). |
| 1386 | WithField("podName", pod.Name). |
| 1387 | WithField("nodeID", pod.Annotations[common.AnnotationKeyNodeID]). |
| 1388 | WithField("namespace", pod.Namespace) |
| 1389 | if err != nil { |
| 1390 | log. |
| 1391 | WithError(err). |
| 1392 | Warn(ctx, "Unable to marshal pod spec.") |
| 1393 | } else { |
| 1394 | log. |
| 1395 | WithField("spec", string(podSpecByte)). |
| 1396 | Info(ctx, "Pod Spec") |
| 1397 | } |
| 1398 | } |
| 1399 | |
| 1400 | // assessNodeStatus compares the current state of a pod with its corresponding node |
| 1401 | // and returns the new node status if something changed |