mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Fix goreport warnings of ineffassign and misspell
Signed-off-by: Ashok Pon Kumar <ashokponkumar@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Package devicefilter containes eBPF device filter program
|
// Package devicefilter contains eBPF device filter program
|
||||||
//
|
//
|
||||||
// The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c
|
// The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ func (s *CpuacctGroup) GetStats(path string, stats *cgroups.Stats) error {
|
|||||||
|
|
||||||
// Returns user and kernel usage breakdown in nanoseconds.
|
// Returns user and kernel usage breakdown in nanoseconds.
|
||||||
func getCpuUsageBreakdown(path string) (uint64, uint64, error) {
|
func getCpuUsageBreakdown(path string) (uint64, uint64, error) {
|
||||||
userModeUsage := uint64(0)
|
var userModeUsage, kernelModeUsage uint64
|
||||||
kernelModeUsage := uint64(0)
|
|
||||||
const (
|
const (
|
||||||
userField = "user"
|
userField = "user"
|
||||||
systemField = "system"
|
systemField = "system"
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
|
|||||||
RootlessCgroups: opts.RootlessCgroups,
|
RootlessCgroups: opts.RootlessCgroups,
|
||||||
}
|
}
|
||||||
|
|
||||||
exists := false
|
|
||||||
for _, m := range spec.Mounts {
|
for _, m := range spec.Mounts {
|
||||||
config.Mounts = append(config.Mounts, createLibcontainerMount(cwd, m))
|
config.Mounts = append(config.Mounts, createLibcontainerMount(cwd, m))
|
||||||
}
|
}
|
||||||
@@ -253,6 +252,7 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
|
|||||||
config.Cgroups = c
|
config.Cgroups = c
|
||||||
// set linux-specific config
|
// set linux-specific config
|
||||||
if spec.Linux != nil {
|
if spec.Linux != nil {
|
||||||
|
var exists bool
|
||||||
if config.RootPropagation, exists = mountPropagationMapping[spec.Linux.RootfsPropagation]; !exists {
|
if config.RootPropagation, exists = mountPropagationMapping[spec.Linux.RootfsPropagation]; !exists {
|
||||||
return nil, fmt.Errorf("rootfsPropagation=%v is not supported", spec.Linux.RootfsPropagation)
|
return nil, fmt.Errorf("rootfsPropagation=%v is not supported", spec.Linux.RootfsPropagation)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user