Update the logging to print correct affinity field

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
This commit is contained in:
Lubron Zhan
2025-12-22 22:59:17 -08:00
parent 04364ef2ca
commit 0d80995e62

View File

@@ -259,13 +259,7 @@ func (e *csiSnapshotExposer) Expose(ctx context.Context, ownerObject corev1api.O
return errors.Wrap(err, "error to create backup pod")
}
curLog = curLog.WithField("pod name", backupPod.Name)
if affinity != nil {
curLog = curLog.WithField("affinity", *affinity)
} else {
curLog = curLog.WithField("affinity", "nil")
}
curLog.Info("Backup pod is created")
curLog.WithField("pod name", backupPod.Name).WithField("affinity", affinity).Info("Backup pod is created")
defer func() {
if err != nil {