fix(host): pod volume usage panic (#21305)

This commit is contained in:
Zexi Li
2024-09-26 16:34:26 +08:00
committed by GitHub
parent ccd5caa6ae
commit d9b0331ec1
+5 -4
View File
@@ -117,11 +117,12 @@ func (s *sPodGuestInstance) GetVolumeMountUsages() (map[ContainerVolumeKey]*volu
vu, err := s.getVolumeMountUsage(drv, ctrId, vol)
if err != nil {
errs = append(errs, errors.Wrapf(err, "get container %s %s volume usage: %s", ctrId, drv.GetType(), jsonutils.Marshal(vol)))
} else {
result[ContainerVolumeKey{
Id: ctrId,
HostPath: vu.HostPath,
}] = vu
}
result[ContainerVolumeKey{
Id: ctrId,
HostPath: vu.HostPath,
}] = vu
}
}
return result, errors.NewAggregate(errs)