Skip to content

Commit

Permalink
Update deprecated packages
Browse files Browse the repository at this point in the history
Signed-off-by: Shubharanshu Mahapatra <[email protected]>
  • Loading branch information
Shubhranshu153 committed Sep 9, 2024
1 parent 02d73cc commit 49be4c0
Show file tree
Hide file tree
Showing 61 changed files with 74 additions and 86 deletions.
7 changes: 3 additions & 4 deletions cmd/nerdctl/compose_exec_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"net"
"os"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -98,7 +97,7 @@ services:
if !strings.Contains(stdout, "\nBAR=bar1 bar2\n") {
return errors.New("got bad BAR")
}
if !strings.Contains(stdout, "\nBAZ=\n") && runtime.GOOS != "windows" {
if !strings.Contains(stdout, "\nBAZ=\n") {
return errors.New("got bad BAZ")
}
if strings.Contains(stdout, "QUX") {
Expand All @@ -113,10 +112,10 @@ services:
if !strings.Contains(stdout, "\nGRAULT=grault_key=grault_value\n") {
return errors.New("got bad GRAULT")
}
if !strings.Contains(stdout, "\nGARPLY=\n") && runtime.GOOS != "windows" {
if !strings.Contains(stdout, "\nGARPLY=\n") {
return errors.New("got bad GARPLY")
}
if !strings.Contains(stdout, "\nWALDO=\n") && runtime.GOOS != "windows" {
if !strings.Contains(stdout, "\nWALDO=\n") {
return errors.New("got bad WALDO")
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/compose_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"time"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime/restart"
"github.com/containerd/errdefs"
gocni "github.com/containerd/go-cni"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/clientutil"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/compose_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/pkg/clientutil"
"github.com/containerd/nerdctl/pkg/cmd/compose"
"github.com/containerd/nerdctl/pkg/containerutil"
Expand Down
4 changes: 0 additions & 4 deletions cmd/nerdctl/container_create_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"fmt"
"runtime"
"testing"

"github.com/containerd/nerdctl/pkg/testutil"
Expand Down Expand Up @@ -113,9 +112,6 @@ func TestCreateWithMACAddress(t *testing.T) {
}

func TestCreateWithTty(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("json-file log driver is not yet implemented on Windows")
}
base := testutil.NewBase(t)
imageName := testutil.CommonImage
withoutTtyContainerName := "without-terminal-" + testutil.Identifier(t)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/platforms"
"github.com/containerd/continuity/fs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
Expand All @@ -35,6 +34,7 @@ import (
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/pkg/imgutil"
"github.com/containerd/nerdctl/pkg/labels"
"github.com/containerd/platforms"
"github.com/opencontainers/image-spec/identity"
"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_cgroup_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"testing"

"github.com/containerd/cgroups/v3"
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/continuity/testutil/loopback"
"github.com/containerd/nerdctl/pkg/cmd/container"
"github.com/containerd/nerdctl/pkg/testutil"
"github.com/moby/sys/userns"
"gotest.tools/v3/assert"
)

Expand Down
7 changes: 0 additions & 7 deletions cmd/nerdctl/container_run_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"net/http"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
Expand Down Expand Up @@ -329,9 +328,6 @@ func TestRunSigProxy(t *testing.T) {
}

func TestRunWithFluentdLogDriver(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("fluentd log driver is not yet implemented on Windows")
}
base := testutil.NewBase(t)
tempDirectory := t.TempDir()
err := os.Chmod(tempDirectory, 0777)
Expand Down Expand Up @@ -361,9 +357,6 @@ func TestRunWithFluentdLogDriver(t *testing.T) {
}

func TestRunWithFluentdLogDriverWithLogOpt(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("fluentd log driver is not yet implemented on Windows")
}
base := testutil.NewBase(t)
tempDirectory := t.TempDir()
err := os.Chmod(tempDirectory, 0777)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_run_network_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"testing"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/pkg/rootlessutil"
"github.com/containerd/nerdctl/pkg/testutil"
"github.com/containerd/nerdctl/pkg/testutil/nettestutil"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/container_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/clientutil"
Expand Down
2 changes: 1 addition & 1 deletion cmd/nerdctl/login_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestLoginWithSpecificRegHosts(t *testing.T) {
},
}
for _, tc := range testCases {
t.Logf(tc.log)
t.Log(tc.log)
base.Cmd("--debug-full", "--hosts-dir", reg.HostsDir, "login", "-u", "admin", "-p", "validTestPassword", tc.url).AssertOK()
}

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ require (
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/cilium/ebpf v0.11.0 // indirect
github.com/containerd/cgroups v1.1.0 // indirect
github.com/containerd/errdefs v0.1.0 // indirect
github.com/containerd/errdefs v0.1.0
github.com/containerd/go-runc v1.0.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/containerd/platforms v0.2.1
github.com/containerd/ttrpc v1.2.5 // indirect
github.com/containerd/typeurl v1.0.3-0.20220422153119-7f6e6d160d67 // indirect
github.com/containers/ocicrypt v1.1.10 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/distribution/reference v0.6.0
github.com/djherbis/times v1.5.0 // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
Expand Down Expand Up @@ -108,7 +108,7 @@ require (
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/symlink v0.2.0 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/sys/userns v0.1.0
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/apparmorutil/apparmorutil_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"sync"

"github.com/containerd/containerd/pkg/apparmor"
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/log"
"github.com/moby/sys/userns"
)

// CanLoadNewProfile returns whether the current process can load a new AppArmor profile.
Expand Down
2 changes: 1 addition & 1 deletion pkg/bypass4netnsutil/bypass.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net"
"path/filepath"

"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
gocni "github.com/containerd/go-cni"
b4nnapi "github.com/rootless-containers/bypass4netns/pkg/api"
"github.com/rootless-containers/bypass4netns/pkg/api/daemon/client"
Expand Down
2 changes: 1 addition & 1 deletion pkg/clientutil/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/platforms"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/platformutil"
"github.com/containerd/nerdctl/pkg/systemutil"
"github.com/containerd/platforms"
"github.com/opencontainers/go-digest"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ import (
"strings"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/images/archive"
"github.com/containerd/containerd/platforms"
dockerreference "github.com/containerd/containerd/reference/docker"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/buildkitutil"
"github.com/containerd/nerdctl/pkg/clientutil"
"github.com/containerd/nerdctl/pkg/platformutil"
"github.com/containerd/nerdctl/pkg/strutil"
"github.com/containerd/platforms"
dockerreference "github.com/distribution/reference"
)

func Build(ctx context.Context, client *containerd.Client, options types.BuilderBuildOptions) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import (
"path/filepath"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/platforms"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/cmd/volume"
"github.com/containerd/nerdctl/pkg/composer"
Expand All @@ -36,6 +35,7 @@ import (
"github.com/containerd/nerdctl/pkg/referenceutil"
"github.com/containerd/nerdctl/pkg/signutil"
"github.com/containerd/nerdctl/pkg/strutil"
"github.com/containerd/platforms"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/cio"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/containerutil"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/pkg/progress"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/formatter"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"syscall"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/api/types/cri"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/cio"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/clientutil"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/bypass4netnsutil"
Expand All @@ -33,6 +32,7 @@ import (
"github.com/containerd/nerdctl/pkg/rootlessutil"
"github.com/containerd/nerdctl/pkg/strutil"
"github.com/docker/go-units"
"github.com/moby/sys/userns"
"github.com/opencontainers/runtime-spec/specs-go"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/container/run_mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ import (

"github.com/containerd/containerd"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/leases"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/oci"
"github.com/containerd/containerd/pkg/userns"
"github.com/containerd/continuity/fs"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/cmd/volume"
Expand All @@ -46,6 +45,7 @@ import (
"github.com/containerd/nerdctl/pkg/mountutil/volumestore"
"github.com/containerd/nerdctl/pkg/strutil"
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/moby/sys/userns"
"github.com/opencontainers/image-spec/identity"
"github.com/opencontainers/runtime-spec/specs-go"
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/container/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (

"github.com/containerd/containerd"
eventstypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/clientutil"
Expand Down Expand Up @@ -81,14 +81,14 @@ func (s *stats) isKnownContainer(cid string) (int, bool) {
}

// Stats displays a live stream of container(s) resource usage statistics.
func Stats(ctx context.Context, client *containerd.Client, containerIds []string, options types.ContainerStatsOptions) error {
func Stats(ctx context.Context, client *containerd.Client, containerIDs []string, options types.ContainerStatsOptions) error {
// NOTE: rootless container does not rely on cgroupv1.
// more details about possible ways to resolve this concern: #223
if rootlessutil.IsRootless() && infoutil.CgroupsVersion() == "1" {
return errors.New("stats requires cgroup v2 for rootless containers, see https://rootlesscontaine.rs/getting-started/common/cgroup2/")
}

showAll := len(containerIds) == 0
showAll := len(containerIDs) == 0
closeChan := make(chan error)

var err error
Expand Down Expand Up @@ -227,7 +227,7 @@ func Stats(ctx context.Context, client *containerd.Client, containerIds []string
},
}

if err := walker.WalkAll(ctx, containerIds, false); err != nil {
if err := walker.WalkAll(ctx, containerIDs, false); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/container/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"

"github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/containerutil"
"github.com/containerd/nerdctl/pkg/idutil/containerwalker"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/image/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/pkg/progress"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/snapshots"
"github.com/containerd/log"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/formatter"
"github.com/containerd/nerdctl/pkg/imgutil"
"github.com/containerd/platforms"
v1 "github.com/opencontainers/image-spec/specs-go/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/image/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
"github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/images/archive"
"github.com/containerd/containerd/platforms"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/imgutil"
"github.com/containerd/nerdctl/pkg/platformutil"
"github.com/containerd/platforms"
)

type readCounter struct {
Expand Down
Loading

0 comments on commit 49be4c0

Please sign in to comment.