Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update containerd and nerdctl v2 #148

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ endif
GOBIN=$(BIN) go install github.com/golang/mock/mockgen
GOBIN=$(BIN) go install golang.org/x/tools/cmd/stringer
PATH=$(BIN):$(PATH) go generate ./...
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/container.go -package=mocks_container github.com/containerd/containerd Container
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/process.go -package=mocks_container github.com/containerd/containerd Process
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/task.go -package=mocks_container github.com/containerd/containerd Task
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_image/store.go -package=mocks_image github.com/containerd/containerd/images Store
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/network_manager.go -package=mocks_container github.com/containerd/nerdctl/pkg/containerutil NetworkOptionsManager
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_cio/io.go -package=mocks_cio github.com/containerd/containerd/cio IO
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/container.go -package=mocks_container github.com/containerd/containerd/v2/client Container
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/process.go -package=mocks_container github.com/containerd/containerd/v2/client Process
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/task.go -package=mocks_container github.com/containerd/containerd/v2/client Task
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_image/store.go -package=mocks_image github.com/containerd/containerd/v2/core/images Store
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_container/network_manager.go -package=mocks_container github.com/containerd/nerdctl/v2/pkg/containerutil NetworkOptionsManager
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_cio/io.go -package=mocks_cio github.com/containerd/containerd/v2/pkg/cio IO
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_http/response_writer.go -package=mocks_http net/http ResponseWriter
PATH=$(BIN):$(PATH) mockgen --destination=./mocks/mocks_http/conn.go -package=mocks_http net Conn

Expand Down
4 changes: 2 additions & 2 deletions api/handlers/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"net/http"
"strconv"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/nerdctl/v2/pkg/api/types"

"github.com/runfinch/finch-daemon/api/response"
"github.com/runfinch/finch-daemon/pkg/utility/maputility"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/builder/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"io"
"net/http"

ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/config"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/config"

"github.com/runfinch/finch-daemon/api/types"
"github.com/runfinch/finch-daemon/internal/backend"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/builder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http/httptest"
"testing"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/attach_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/runfinch/finch-daemon/api/types"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"net/http"
"time"

ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/config"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/config"

"github.com/runfinch/finch-daemon/api/types"
"github.com/runfinch/finch-daemon/pkg/flog"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http/httptest"
"testing"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
6 changes: 3 additions & 3 deletions api/handlers/container/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"strconv"
"strings"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
gocni "github.com/containerd/go-cni"
ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/defaults"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/defaults"
"github.com/docker/go-connections/nat"
"github.com/sirupsen/logrus"

Expand Down
6 changes: 3 additions & 3 deletions api/handlers/container/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"strings"

gocni "github.com/containerd/go-cni"
"github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/pkg/defaults"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/defaults"
"github.com/docker/go-connections/nat"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"

"github.com/runfinch/finch-daemon/api/response"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/get_archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package container
import (
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http"
"os"

"github.com/containerd/containerd/namespaces"
ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/containerd/v2/pkg/namespaces"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/gorilla/mux"

"github.com/runfinch/finch-daemon/api/response"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/kill_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/http"
"net/http/httptest"

ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/config"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"net/url"
"strconv"

"github.com/containerd/containerd/namespaces"
ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/containerd/v2/pkg/namespaces"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"

"github.com/runfinch/finch-daemon/api/response"
)
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/http"
"net/http/httptest"

ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/nerdctl/pkg/config"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os"
"strings"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/put_archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"strconv"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/remove_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
4 changes: 2 additions & 2 deletions api/handlers/container/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package container
import (
"net/http"

"github.com/containerd/containerd/namespaces"
ncTypes "github.com/containerd/nerdctl/pkg/api/types"
"github.com/containerd/containerd/v2/pkg/namespaces"
ncTypes "github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/rename_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"time"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/runfinch/finch-daemon/api/response"
"github.com/runfinch/finch-daemon/pkg/errdefs"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package container
import (
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"strconv"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"

"github.com/runfinch/finch-daemon/api/response"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http/httptest"
"time"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
dockertypes "github.com/docker/docker/api/types/container"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"time"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/container/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package container
import (
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"

Expand Down
4 changes: 2 additions & 2 deletions api/handlers/distribution/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/nerdctl/v2/pkg/config"
dockertypes "github.com/docker/cli/cli/config/types"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/gorilla/mux"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/distribution/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http/httptest"
"testing"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"strings"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"

"github.com/runfinch/finch-daemon/api/types"
"github.com/runfinch/finch-daemon/pkg/flog"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http/httptest"
"testing"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/exec/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package exec
import (
"net/http"

"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/gorilla/mux"

"github.com/runfinch/finch-daemon/api/response"
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/exec/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"net/http/httptest"

"github.com/containerd/nerdctl/pkg/config"
"github.com/containerd/nerdctl/v2/pkg/config"
"github.com/golang/mock/gomock"
"github.com/gorilla/mux"
. "github.com/onsi/ginkgo/v2"
Expand Down
Loading
Loading