Merge pull request #741 from rjnagal/summary

Add filesystem, diskio, and network to spec.
This commit is contained in:
Victor Marmol 2015-05-28 16:36:00 -07:00
commit 909749d357
2 changed files with 11 additions and 3 deletions

View File

@ -72,6 +72,11 @@ type ContainerSpec struct {
HasMemory bool `json:"has_memory"`
Memory MemorySpec `json:"memory,omitempty"`
// Following resources have no associated spec, but are being isolated.
HasNetwork bool `json:"has_network"`
HasFilesystem bool `json:"has_filesystem"`
HasDiskIo bool `json:"has_diskio"`
}
type ContainerStats struct {

View File

@ -361,9 +361,12 @@ func (self *manager) GetContainerSpec(containerName string, options v2.RequestOp
func (self *manager) getV2Spec(cinfo *containerInfo) v2.ContainerSpec {
specV1 := self.getAdjustedSpec(cinfo)
specV2 := v2.ContainerSpec{
CreationTime: specV1.CreationTime,
HasCpu: specV1.HasCpu,
HasMemory: specV1.HasMemory,
CreationTime: specV1.CreationTime,
HasCpu: specV1.HasCpu,
HasMemory: specV1.HasMemory,
HasFilesystem: specV1.HasFilesystem,
HasNetwork: specV1.HasNetwork,
HasDiskIo: specV1.HasDiskIo,
}
if specV1.HasCpu {
specV2.Cpu.Limit = specV1.Cpu.Limit