// If there is more than one line (table headers) in /proc/swaps, swap is enabled and we should
// If there is more than one line (table headers) in /proc/swaps, swap is enabled and we should
// error out unless --fail-swap-on is set to false.
// error out unless --fail-swap-on is set to false.
iffailSwapOn&&len(swapLines)>1{
iflen(swapLines)>1{
returnnil,fmt.Errorf("Running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false. /proc/swaps contained: %v",swapLines)
returnnil,fmt.Errorf("Running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false. /proc/swaps contained: %v",swapLines)
}
}
}
varcapacity=v1.ResourceList{}
varcapacity=v1.ResourceList{}
// It is safe to invoke `MachineInfo` on cAdvisor before logically initializing cAdvisor here because
// It is safe to invoke `MachineInfo` on cAdvisor before logically initializing cAdvisor here because
// machine info is computed and cached once as part of cAdvisor object creation.
// machine info is computed and cached once as part of cAdvisor object creation.