()
| 119 | func (h *rawContainerHandler) Cleanup() {} |
| 120 | |
| 121 | func (h *rawContainerHandler) GetSpec() (info.ContainerSpec, error) { |
| 122 | const hasNetwork = false |
| 123 | hasFilesystem := isRootCgroup(h.name) || len(h.externalMounts) > 0 |
| 124 | spec, err := common.GetSpec(h.cgroupPaths, h.machineInfoFactory, hasNetwork, hasFilesystem) |
| 125 | if err != nil { |
| 126 | return spec, err |
| 127 | } |
| 128 | |
| 129 | if isRootCgroup(h.name) { |
| 130 | // Check physical network devices for root container. |
| 131 | nd, err := h.GetRootNetworkDevices() |
| 132 | if err != nil { |
| 133 | return spec, err |
| 134 | } |
| 135 | spec.HasNetwork = spec.HasNetwork || len(nd) != 0 |
| 136 | |
| 137 | // Get memory and swap limits of the running machine |
| 138 | memLimit, err := machine.GetMachineMemoryCapacity() |
| 139 | if err != nil { |
| 140 | klog.Warningf("failed to obtain memory limit for machine container") |
| 141 | spec.HasMemory = false |
| 142 | } else { |
| 143 | spec.Memory.Limit = uint64(memLimit) |
| 144 | // Spec is marked to have memory only if the memory limit is set |
| 145 | spec.HasMemory = true |
| 146 | } |
| 147 | |
| 148 | swapLimit, err := machine.GetMachineSwapCapacity() |
| 149 | if err != nil { |
| 150 | klog.Warningf("failed to obtain swap limit for machine container") |
| 151 | } else { |
| 152 | spec.Memory.SwapLimit = uint64(swapLimit) |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | return spec, nil |
| 157 | } |
| 158 | |
| 159 | func fsToFsStats(fs *fs.Fs) info.FsStats { |
| 160 | inodes := uint64(0) |
nothing calls this directly
no test coverage detected