diff options
-rw-r--r-- | .golangci.yml | 9 | ||||
-rw-r--r-- | cmd/podman/containers/ps.go | 2 | ||||
-rw-r--r-- | pkg/api/handlers/utils/containers.go | 1 | ||||
-rw-r--r-- | pkg/specgen/container_validate.go | 1 | ||||
-rw-r--r-- | pkg/specgen/generate/config_linux.go | 1 | ||||
-rw-r--r-- | pkg/specgen/generate/kube/kube.go | 1 | ||||
-rw-r--r-- | pkg/specgen/generate/kube/seccomp.go | 1 | ||||
-rw-r--r-- | pkg/specgen/generate/kube/volume.go | 2 | ||||
-rw-r--r-- | pkg/specgen/generate/oci.go | 1 | ||||
-rw-r--r-- | pkg/specgen/generate/security.go | 14 | ||||
-rw-r--r-- | pkg/specgen/pod_validate.go | 1 | ||||
-rw-r--r-- | troubleshooting.md | 4 |
12 files changed, 12 insertions, 26 deletions
diff --git a/.golangci.yml b/.golangci.yml index 76cf0cad8..cf067a58c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,14 +4,10 @@ run: deadline: 5m skip-dirs-use-default: true skip-dirs: - - dependencies - contrib - dependencies - test - - pkg/spec - - vendor skip-files: - - iopodman.go - swagger.go modules-download-mode: readonly linters: @@ -51,12 +47,7 @@ linters: - goconst - gocyclo - lll - - structcheck - - typecheck - unconvert - - varcheck - - deadcode - - depguard - errcheck - gocritic - gosec diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go index bfb821159..51e7bf5b5 100644 --- a/cmd/podman/containers/ps.go +++ b/cmd/podman/containers/ps.go @@ -152,7 +152,7 @@ func jsonOut(responses []entities.ListContainer) error { con.Status = psReporter{con}.Status() jf := jsonFormat{ ListContainer: con, - Created: con.Created.UnixNano(), + Created: con.Created.Unix(), } r = append(r, jf) } diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go index ba202cad0..e79def6f3 100644 --- a/pkg/api/handlers/utils/containers.go +++ b/pkg/api/handlers/utils/containers.go @@ -105,6 +105,7 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) { query := waitQueryLibpod{} if err := decoder.Decode(&query, r.URL.Query()); err != nil { Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String())) + return } if _, found := r.URL.Query()["interval"]; found { diff --git a/pkg/specgen/container_validate.go b/pkg/specgen/container_validate.go index 81cb8b78d..042e20e02 100644 --- a/pkg/specgen/container_validate.go +++ b/pkg/specgen/container_validate.go @@ -29,7 +29,6 @@ func exclusiveOptions(opt1, opt2 string) error { // Validate verifies that the given SpecGenerator is valid and satisfies required // input for creating a container. func (s *SpecGenerator) Validate() error { - if rootless.IsRootless() && len(s.CNINetworks) == 0 { if s.StaticIP != nil || s.StaticIPv6 != nil { return ErrNoStaticIPRootless diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go index 1290a8eb6..b9f024814 100644 --- a/pkg/specgen/generate/config_linux.go +++ b/pkg/specgen/generate/config_linux.go @@ -113,7 +113,6 @@ func DevicesFromPath(g *generate.Generator, devicePath string) error { // mount the internal devices recursively if err := filepath.Walk(resolvedDevicePath, func(dpath string, f os.FileInfo, e error) error { - if f.Mode()&os.ModeDevice == os.ModeDevice { found = true device := fmt.Sprintf("%s:%s", dpath, filepath.Join(dest, strings.TrimPrefix(dpath, src))) diff --git a/pkg/specgen/generate/kube/kube.go b/pkg/specgen/generate/kube/kube.go index 98ab82259..e04ced3d3 100644 --- a/pkg/specgen/generate/kube/kube.go +++ b/pkg/specgen/generate/kube/kube.go @@ -384,7 +384,6 @@ func getPodPorts(containers []v1.Container) []specgen.PortMapping { if p.HostPort != 0 { infraPorts = append(infraPorts, portBinding) } - } } return infraPorts diff --git a/pkg/specgen/generate/kube/seccomp.go b/pkg/specgen/generate/kube/seccomp.go index 4cbdf6e2e..353f9cbf2 100644 --- a/pkg/specgen/generate/kube/seccomp.go +++ b/pkg/specgen/generate/kube/seccomp.go @@ -11,6 +11,7 @@ import ( // KubeSeccompPaths holds information about a pod YAML's seccomp configuration // it holds both container and pod seccomp paths +// nolint:golint type KubeSeccompPaths struct { containerPaths map[string]string podPath string diff --git a/pkg/specgen/generate/kube/volume.go b/pkg/specgen/generate/kube/volume.go index f5687f60d..c3241a49e 100644 --- a/pkg/specgen/generate/kube/volume.go +++ b/pkg/specgen/generate/kube/volume.go @@ -17,6 +17,7 @@ const ( kubeFilePermission = 0644 ) +// nolint:golint type KubeVolumeType int const ( @@ -24,6 +25,7 @@ const ( KubeVolumeTypeNamed KubeVolumeType = iota ) +// nolint:golint type KubeVolume struct { // Type of volume to create Type KubeVolumeType diff --git a/pkg/specgen/generate/oci.go b/pkg/specgen/generate/oci.go index e62131244..1a0ec08a5 100644 --- a/pkg/specgen/generate/oci.go +++ b/pkg/specgen/generate/oci.go @@ -219,7 +219,6 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt if !mappingFound { gid5Available = false } - } if !gid5Available { // If we have no GID mappings, the gid=5 default option would fail, so drop it. diff --git a/pkg/specgen/generate/security.go b/pkg/specgen/generate/security.go index 390b19beb..fb45d87db 100644 --- a/pkg/specgen/generate/security.go +++ b/pkg/specgen/generate/security.go @@ -109,17 +109,15 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, } } if !s.Privileged && len(capsRequiredRequested) > 0 { - // Pass capRequiredRequested in CapAdd field to normalize capabilities names capsRequired, err := capabilities.MergeCapabilities(nil, capsRequiredRequested, nil) if err != nil { return errors.Wrapf(err, "capabilities requested by user or image are not valid: %q", strings.Join(capsRequired, ",")) - } else { - // Verify all capRequired are in the capList - for _, cap := range capsRequired { - if !util.StringInSlice(cap, caplist) { - privCapsRequired = append(privCapsRequired, cap) - } + } + // Verify all capRequired are in the capList + for _, cap := range capsRequired { + if !util.StringInSlice(cap, caplist) { + privCapsRequired = append(privCapsRequired, cap) } } if len(privCapsRequired) == 0 { @@ -189,7 +187,6 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, return err } for sysctlKey, sysctlVal := range defaultSysctls { - // Ignore mqueue sysctls if --ipc=host if noUseIPC && strings.HasPrefix(sysctlKey, "fs.mqueue.") { logrus.Infof("Sysctl %s=%s ignored in containers.conf, since IPC Namespace set to host", sysctlKey, sysctlVal) @@ -213,7 +210,6 @@ func securityConfigureGenerator(s *specgen.SpecGenerator, g *generate.Generator, } for sysctlKey, sysctlVal := range s.Sysctl { - if s.IpcNS.IsHost() && strings.HasPrefix(sysctlKey, "fs.mqueue.") { return errors.Wrapf(define.ErrInvalidArg, "sysctl %s=%s can't be set since IPC Namespace set to host", sysctlKey, sysctlVal) } diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go index 518adb32f..c9bcdf623 100644 --- a/pkg/specgen/pod_validate.go +++ b/pkg/specgen/pod_validate.go @@ -19,7 +19,6 @@ func exclusivePodOptions(opt1, opt2 string) error { // Validate verifies the input is valid func (p *PodSpecGenerator) Validate() error { - if rootless.IsRootless() && len(p.CNINetworks) == 0 { if p.StaticIP != nil { return ErrNoStaticIPRootless diff --git a/troubleshooting.md b/troubleshooting.md index c028a7714..077e342cd 100644 --- a/troubleshooting.md +++ b/troubleshooting.md @@ -72,8 +72,8 @@ error pulling image "fedora": unable to pull fedora: error getting default regis #### Solution * Verify that the `/etc/containers/registries.conf` file exists. If not, verify that the containers-common package is installed. - * Verify that the entries in the `[registries.search]` section of the /etc/containers/registries.conf file are valid and reachable. - * i.e. `registries = ['registry.fedoraproject.org', 'quay.io', 'registry.access.redhat.com']` + * Verify that the entries in the `unqualified-search-registries` list of the `/etc/containers/registries.conf` file are valid and reachable. + * i.e. `unqualified-search-registries = ["registry.fedoraproject.org", "quay.io", "registry.access.redhat.com"]` --- ### 4) http: server gave HTTP response to HTTPS client |