fix log format string mismatches that produce wrong or mangled output (#10370)

* fix log format string mismatches that produce wrong or mangled output

Signed-off-by: samay43 <samayrbhat43@gmail.com>

* add changelog entry

Signed-off-by: samay43 <samayrbhat43@gmail.com>

---------

Signed-off-by: samay43 <samayrbhat43@gmail.com>
(cherry picked from commit d374854b0e)
This commit is contained in:
R4mbo
2026-08-24 19:43:19 +00:00
committed by github-actions[bot]
parent ec1a1d7d18
commit 8142ab5df4
7 changed files with 10 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
fix log format string mismatches that produce wrong or mangled output
+1 -1
View File
@@ -419,7 +419,7 @@ func getInitContainerFromAnnotation(podName string, annotations map[string]strin
return nil
}
if command == "" {
log.Infof("RestoreHook init container for pod %s is using container's default entrypoint", podName, containerImage)
log.Infof("RestoreHook init container for pod %s is using the default entrypoint of image %s", podName, containerImage)
}
if containerName == "" {
uid, err := uuid.NewRandom()
+3 -1
View File
@@ -36,6 +36,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/features"
"github.com/vmware-tanzu/velero/pkg/itemoperation"
"github.com/vmware-tanzu/velero/pkg/kuberesource"
"github.com/vmware-tanzu/velero/pkg/util/stringptr"
)
type Method string
@@ -494,7 +495,8 @@ func (v *BackupVolumesInformation) generateVolumeInfoForCSIVolumeSnapshot() {
tmpVolumeInfos = append(tmpVolumeInfos, volumeInfo)
} else {
v.logger.Warnf("cannot find info for PVC %s/%s", volumeSnapshot.Namespace, volumeSnapshot.Spec.Source.PersistentVolumeClaimName)
v.logger.Warnf("cannot find info for PVC %s/%s", volumeSnapshot.Namespace,
stringptr.GetString(volumeSnapshot.Spec.Source.PersistentVolumeClaimName))
continue
}
}
+1 -1
View File
@@ -1183,7 +1183,7 @@ func setPVCRequestSizeToVSRestoreSize(
logger logrus.FieldLogger,
) {
if vsc.Status.RestoreSize != nil {
logger.Debugf("Patching PVC request size to fit the volumesnapshot restore size %d", vsc.Status.RestoreSize)
logger.Debugf("Patching PVC request size to fit the volumesnapshot restore size %d", *vsc.Status.RestoreSize)
restoreSize := *resource.NewQuantity(*vsc.Status.RestoreSize, resource.BinarySI)
// It is possible that the volume provider allocated a larger
@@ -269,8 +269,8 @@ func (p *volumeSnapshotBackupItemAction) Progress(
}
var err error
if progress.Started, err = time.Parse(time.RFC3339, operationIDParts[2]); err != nil {
p.log.Errorf("error parsing operation ID's StartedTime",
"part into time %s: %s", operationID, err.Error())
p.log.Errorf("error parsing operation ID's StartedTime part into time %s: %s",
operationID, err.Error())
return progress, errors.WithStack(err)
}
@@ -107,8 +107,7 @@ func (p *volumeSnapshotContentBackupItemAction) Execute(
}
p.log.Infof(
"Returning from VolumeSnapshotContentBackupItemAction",
"with %d additionalItems to backup",
"Returning from VolumeSnapshotContentBackupItemAction with %d additionalItems to backup",
len(additionalItems),
)
return &unstructured.Unstructured{Object: snapContMap}, additionalItems, "", nil, nil
+1 -1
View File
@@ -2804,7 +2804,7 @@ func (ctx *restoreContext) getSelectedRestoreableItems(resource string, original
}
if skipItem {
ctx.log.Infof("restore orSelector labels did not match, skipping restore of item: %s", skipItem, item)
ctx.log.Infof("restore orSelector labels did not match, skipping restore of item: %s", item)
continue
}
}