mirror of
https://github.com/containers/podman.git
synced 2025-07-03 09:17:15 +08:00
Include lock number in pod/container/volume inspect
Being able to easily identify what lock has been allocated to a given Libpod object is only somewhat useful for debugging lock issues, but it's trivial to expose and I don't see any harm in doing so. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -166,6 +166,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver
|
|||||||
IsInfra: c.IsInfra(),
|
IsInfra: c.IsInfra(),
|
||||||
IsService: c.IsService(),
|
IsService: c.IsService(),
|
||||||
KubeExitCodePropagation: config.KubeExitCodePropagation.String(),
|
KubeExitCodePropagation: config.KubeExitCodePropagation.String(),
|
||||||
|
LockNumber: c.lock.ID(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.RootfsImageID != "" { // May not be set if the container was created with --rootfs
|
if config.RootfsImageID != "" { // May not be set if the container was created with --rootfs
|
||||||
|
@ -691,6 +691,7 @@ type InspectContainerData struct {
|
|||||||
IsInfra bool `json:"IsInfra"`
|
IsInfra bool `json:"IsInfra"`
|
||||||
IsService bool `json:"IsService"`
|
IsService bool `json:"IsService"`
|
||||||
KubeExitCodePropagation string `json:"KubeExitCodePropagation"`
|
KubeExitCodePropagation string `json:"KubeExitCodePropagation"`
|
||||||
|
LockNumber uint32 `json:"lockNumber"`
|
||||||
Config *InspectContainerConfig `json:"Config"`
|
Config *InspectContainerConfig `json:"Config"`
|
||||||
HostConfig *InspectContainerHostConfig `json:"HostConfig"`
|
HostConfig *InspectContainerHostConfig `json:"HostConfig"`
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,8 @@ type InspectPodData struct {
|
|||||||
BlkioWeightDevice []InspectBlkioWeightDevice `json:"blkio_weight_device,omitempty"`
|
BlkioWeightDevice []InspectBlkioWeightDevice `json:"blkio_weight_device,omitempty"`
|
||||||
// RestartPolicy of the pod.
|
// RestartPolicy of the pod.
|
||||||
RestartPolicy string `json:"RestartPolicy,omitempty"`
|
RestartPolicy string `json:"RestartPolicy,omitempty"`
|
||||||
|
// Number of the pod's Libpod lock.
|
||||||
|
LockNumber uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
// InspectPodInfraConfig contains the configuration of the pod's infra
|
// InspectPodInfraConfig contains the configuration of the pod's infra
|
||||||
|
@ -61,6 +61,8 @@ type InspectVolumeData struct {
|
|||||||
// StorageID is the ID of the container backing the volume in c/storage.
|
// StorageID is the ID of the container backing the volume in c/storage.
|
||||||
// Only used with Image Volumes.
|
// Only used with Image Volumes.
|
||||||
StorageID string `json:"StorageID,omitempty"`
|
StorageID string `json:"StorageID,omitempty"`
|
||||||
|
// LockNumber is the number of the volume's Libpod lock.
|
||||||
|
LockNumber uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
type VolumeReload struct {
|
type VolumeReload struct {
|
||||||
|
@ -742,6 +742,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
|
|||||||
BlkioDeviceWriteBps: p.BlkiThrottleWriteBps(),
|
BlkioDeviceWriteBps: p.BlkiThrottleWriteBps(),
|
||||||
CPUShares: p.CPUShares(),
|
CPUShares: p.CPUShares(),
|
||||||
RestartPolicy: p.config.RestartPolicy,
|
RestartPolicy: p.config.RestartPolicy,
|
||||||
|
LockNumber: p.lock.ID(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &inspectData, nil
|
return &inspectData, nil
|
||||||
|
@ -65,6 +65,7 @@ func (v *Volume) Inspect() (*define.InspectVolumeData, error) {
|
|||||||
data.NeedsCopyUp = v.state.NeedsCopyUp
|
data.NeedsCopyUp = v.state.NeedsCopyUp
|
||||||
data.NeedsChown = v.state.NeedsChown
|
data.NeedsChown = v.state.NeedsChown
|
||||||
data.StorageID = v.config.StorageID
|
data.StorageID = v.config.StorageID
|
||||||
|
data.LockNumber = v.lock.ID()
|
||||||
|
|
||||||
if v.config.Timeout != nil {
|
if v.config.Timeout != nil {
|
||||||
data.Timeout = *v.config.Timeout
|
data.Timeout = *v.config.Timeout
|
||||||
|
Reference in New Issue
Block a user