Skip to content

Commit

Permalink
Merge pull request cri-o#3402 from openSUSE/golangci-lint
Browse files Browse the repository at this point in the history
Update golangci-lint to v1.24.0
  • Loading branch information
openshift-merge-robot authored Mar 17, 2020
2 parents eae3c15 + a3bab82 commit f7dc46e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ ${RELEASE_NOTES}:

${GOLANGCI_LINT}:
export \
VERSION=v1.23.8 \
VERSION=v1.24.0 \
URL=https://raw.githubusercontent.com/golangci/golangci-lint \
BINDIR=${BUILD_BIN_PATH} && \
curl -sfL $$URL/$$VERSION/install.sh | sh -s $$VERSION
Expand Down
5 changes: 2 additions & 3 deletions internal/storage/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types"
"github.com/containers/storage"
cstorage "github.com/containers/storage"
"github.com/containers/storage/pkg/idtools"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
Expand Down Expand Up @@ -262,11 +261,11 @@ func (r *runtimeService) createContainerOrPodSandbox(systemContext *types.System
names = append(names, metadata.PodName)
}

coptions := cstorage.ContainerOptions{
coptions := storage.ContainerOptions{
LabelOpts: labelOptions,
}
if idMappings != nil {
coptions.IDMappingOptions = cstorage.IDMappingOptions{UIDMap: idMappings.UIDs(), GIDMap: idMappings.GIDs()}
coptions.IDMappingOptions = storage.IDMappingOptions{UIDMap: idMappings.UIDs(), GIDMap: idMappings.GIDs()}
}
container, err := r.storageImageServer.GetStore().CreateContainer(containerID, names, img.ID, "", string(mdata), &coptions)
if err != nil {
Expand Down
7 changes: 3 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/containers/libpod/pkg/rootless"
createconfig "github.com/containers/libpod/pkg/spec"
"github.com/containers/storage"
cstorage "github.com/containers/storage"
"github.com/cri-o/cri-o/internal/config/apparmor"
"github.com/cri-o/cri-o/internal/config/seccomp"
"github.com/cri-o/cri-o/server/useragent"
Expand Down Expand Up @@ -57,13 +56,13 @@ type Config struct {

// Iface provides a config interface for data encapsulation
type Iface interface {
GetStore() (cstorage.Store, error)
GetStore() (storage.Store, error)
GetData() *Config
}

// GetStore returns the container storage for a given configuration
func (c *Config) GetStore() (cstorage.Store, error) {
return cstorage.GetStore(cstorage.StoreOptions{
func (c *Config) GetStore() (storage.Store, error) {
return storage.GetStore(storage.StoreOptions{
RunRoot: c.RunRoot,
GraphRoot: c.Root,
GraphDriverName: c.Storage,
Expand Down
25 changes: 12 additions & 13 deletions server/sandbox_run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cri-o/cri-o/pkg/config"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/runc/libcontainer/cgroups/systemd"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate"
"github.com/opencontainers/selinux/go-selinux/label"
Expand Down Expand Up @@ -162,7 +161,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
if err := label.Relabel(resolvPath, mountLabel, false); err != nil && errors.Cause(err) != unix.ENOTSUP {
return nil, err
}
mnt := runtimespec.Mount{
mnt := spec.Mount{
Type: "bind",
Source: resolvPath,
Destination: "/etc/resolv.conf",
Expand Down Expand Up @@ -265,7 +264,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
}()
}

mnt := runtimespec.Mount{
mnt := spec.Mount{
Type: "bind",
Source: shmPath,
Destination: sandbox.DevShmPath,
Expand Down Expand Up @@ -458,7 +457,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
if err := label.Relabel(hostnamePath, mountLabel, false); err != nil && errors.Cause(err) != unix.ENOTSUP {
return nil, err
}
mnt = runtimespec.Mount{
mnt = spec.Mount{
Type: "bind",
Source: hostnamePath,
Destination: "/etc/hostname",
Expand All @@ -480,7 +479,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
if s.defaultIDMappings != nil && !s.defaultIDMappings.Empty() {
if securityContext.GetNamespaceOptions().GetIpc() == pb.NamespaceMode_NODE {
g.RemoveMount("/dev/mqueue")
mqueue := runtimespec.Mount{
mqueue := spec.Mount{
Type: "bind",
Source: "/dev/mqueue",
Destination: "/dev/mqueue",
Expand All @@ -501,7 +500,7 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
}
if securityContext.GetNamespaceOptions().GetPid() == pb.NamespaceMode_NODE {
g.RemoveMount("/proc")
proc := runtimespec.Mount{
proc := spec.Mount{
Type: "bind",
Source: "/proc",
Destination: "/proc",
Expand Down Expand Up @@ -768,7 +767,7 @@ func (s *Server) configureGeneratorForSysctls(ctx context.Context, g generate.Ge
func (s *Server) configureGeneratorForSandboxNamespaces(hostNetwork, hostIPC, hostPID bool, sb *sandbox.Sandbox, g generate.Generator) (cleanupFuncs []func() error, err error) {
managedNamespaces := make([]sandbox.NSType, 0, 3)
if hostNetwork {
err = g.RemoveLinuxNamespace(string(runtimespec.NetworkNamespace))
err = g.RemoveLinuxNamespace(string(spec.NetworkNamespace))
if err != nil {
return
}
Expand All @@ -777,7 +776,7 @@ func (s *Server) configureGeneratorForSandboxNamespaces(hostNetwork, hostIPC, ho
}

if hostIPC {
err = g.RemoveLinuxNamespace(string(runtimespec.IPCNamespace))
err = g.RemoveLinuxNamespace(string(spec.IPCNamespace))
if err != nil {
return
}
Expand All @@ -787,7 +786,7 @@ func (s *Server) configureGeneratorForSandboxNamespaces(hostNetwork, hostIPC, ho

// Since we need a process to hold open the PID namespace, CRI-O can't manage the NS lifecycle
if hostPID {
err = g.RemoveLinuxNamespace(string(runtimespec.PIDNamespace))
err = g.RemoveLinuxNamespace(string(spec.PIDNamespace))
if err != nil {
return
}
Expand Down Expand Up @@ -817,10 +816,10 @@ func (s *Server) configureGeneratorForSandboxNamespaces(hostNetwork, hostIPC, ho
// to add or replace the defaults to these paths
func configureGeneratorGivenNamespacePaths(managedNamespaces []*sandbox.ManagedNamespace, g generate.Generator) error {
typeToSpec := map[sandbox.NSType]string{
sandbox.IPCNS: runtimespec.IPCNamespace,
sandbox.NETNS: runtimespec.NetworkNamespace,
sandbox.UTSNS: runtimespec.UTSNamespace,
sandbox.USERNS: runtimespec.UserNamespace,
sandbox.IPCNS: spec.IPCNamespace,
sandbox.NETNS: spec.NetworkNamespace,
sandbox.UTSNS: spec.UTSNamespace,
sandbox.USERNS: spec.UserNamespace,
}

for _, ns := range managedNamespaces {
Expand Down

0 comments on commit f7dc46e

Please sign in to comment.