func (pdev podDevices) toCheckpointData() []checkpoint.PodDevicesEntry {
	var data []checkpoint.PodDevicesEntry
	for podUID, containerDevices := range pdev {
		for conName, resources := range containerDevices {
			for resource, devices := range resources {
				devIds := devices.deviceIds.UnsortedList()
				if devices.allocResp == nil {
					klog.Errorf("Can't marshal allocResp for %v %v %v: allocation response is missing", podUID, conName, resource)
					continue
				}

				allocResp, err := devices.allocResp.Marshal()
				if err != nil {
					klog.Errorf("Can't marshal allocResp for %v %v %v: %v", podUID, conName, resource, err)
					continue
				}
				data = append(data, checkpoint.PodDevicesEntry{
					PodUID:        podUID,
					ContainerName: conName,
					ResourceName:  resource,
					DeviceIDs:     devIds,
					AllocResp:     allocResp})
			}
		}
	}
	return data
}
// Turns podDevices to checkpointData.
Turns podDevices to checkpointData.
// Turns podDevices to checkpointData .
func (pdev podDevices) toCheckpointData() []checkpoint.PodDevicesEntry {
	var data []checkpoint.PodDevicesEntry
	for podUID, containerDevices := range pdev {
		for conName, resources := range containerDevices {
			for resource, devices := range resources {
				devIds := devices.deviceIds.UnsortedList()
				if devices.allocResp == nil {
					klog.Errorf("Can't marshal allocResp for %v %v %v: allocation response is missing", podUID, conName, resource)
					continue
				}
				allocResp, err := devices.allocResp.Marshal()
				if err != nil {
					klog.Errorf("Can't marshal allocResp for %v %v %v: %v", podUID, conName, resource, err)
					continue
				}
				data = append(data, checkpoint.PodDevicesEntry{
					PodUID:        podUID,
					ContainerName: conName,
					ResourceName:  resource,
					DeviceIDs:     devIds,
					AllocResp:     allocResp})
			}
		}
	}
	return data
}
func ( pdev podDevices ) toCheckpointData ( ) [ ] checkpoint . PodDevicesEntry { var data [ ] checkpoint . PodDevicesEntry for podUID , containerDevices := range pdev { for conName , resources := range containerDevices { for resource , devices := range resources { devIds := devices . deviceIds . UnsortedList ( ) if devices . allocResp == nil { klog . Errorf ( " " , podUID , conName , resource ) continue } allocResp , err := devices . allocResp . Marshal ( ) if err != nil { klog . Errorf ( " " , podUID , conName , resource , err ) continue } data = append ( data , checkpoint . PodDevicesEntry { PodUID : podUID , ContainerName : conName , ResourceName : resource , DeviceIDs : devIds , AllocResp : allocResp } ) } } } return data }
Turns podDevices to checkpointData.
Turns podDevices to checkpointData .