Skip to content

Commit

Permalink
Update to containerd v2
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
  • Loading branch information
apostasie committed Jul 22, 2024
1 parent 239009a commit 9b388ab
Show file tree
Hide file tree
Showing 65 changed files with 570 additions and 661 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
go-version-file: 'go.mod'
cache-dependency-path: "go.sum"
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.1
version: v1.59
skip-cache: true
- name: Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
run-e2e-for-cgroups-v1:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -43,7 +43,7 @@ jobs:
make integration
run-e2e-for-cgroups-v2:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19.6"
go-version: "1.22.5"
- name: cache go mod
uses: actions/cache@v3
with:
Expand Down
10 changes: 7 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

run:
concurrency: 4
deadline: 5m
timeout: 5m
issues-exit-code: 1
tests: true
skip-dirs:

issues:
exclude-dirs:
- misc
# The package is ported from containerd project, let's skip it.
- pkg/remote/remotes
Expand All @@ -17,6 +19,8 @@ linters-settings:
deny:
- pkg: "github.com/containerd/containerd/log"
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
- pkg: "github.com/containerd/containerd/errdefs"
desc: The containerd errdefs package was migrated to a separate module. Use github.com/containerd/errdefs instead.
# govet:
# check-shadowing: true
# enable:
Expand Down Expand Up @@ -47,7 +51,7 @@ linters:
- goimports
- revive
- ineffassign
- vet
- govet
- unused
- misspell
- bodyclose
Expand Down
4 changes: 2 additions & 2 deletions cmd/containerd-nydus-grpc/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/containerd/nydus-snapshotter/snapshot"

api "github.com/containerd/containerd/api/services/snapshots/v1"
"github.com/containerd/containerd/contrib/snapshotservice"
"github.com/containerd/containerd/snapshots"
"github.com/containerd/containerd/v2/contrib/snapshotservice"
"github.com/containerd/containerd/v2/core/snapshots"
"github.com/containerd/log"
"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/optimizer-nri-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"github.com/pkg/errors"
"github.com/urfave/cli/v2"

"github.com/containerd/containerd/reference/docker"
"github.com/containerd/nri/pkg/api"
"github.com/containerd/nri/pkg/stub"
"github.com/containerd/nydus-snapshotter/pkg/errdefs"
"github.com/containerd/nydus-snapshotter/pkg/fanotify"
"github.com/containerd/nydus-snapshotter/version"
docker "github.com/distribution/reference"
"github.com/pelletier/go-toml"
)

Expand Down
15 changes: 9 additions & 6 deletions export/snapshotter/snapshotter.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package snapshotter

import (
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/platforms"
"github.com/containerd/plugin"
"github.com/containerd/plugin/registry"
"github.com/pkg/errors"

"github.com/containerd/nydus-snapshotter/config"
"github.com/containerd/nydus-snapshotter/snapshot"
)

func init() {
plugin.Register(&plugin.Registration{
Type: plugin.SnapshotPlugin,
registry.Register(&plugin.Registration{
Type: plugins.SnapshotPlugin,
ID: "nydus",
Config: &config.SnapshotterConfig{},
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
Expand All @@ -22,8 +24,9 @@ func init() {
return nil, errors.New("invalid nydus snapshotter configuration")
}

if cfg.Root == "" {
cfg.Root = ic.Root
root := ic.Properties[plugins.PropertyRootDir]
if root == "" {
cfg.Root = root
}

if err := cfg.FillUpWithDefaults(); err != nil {
Expand Down
Loading

0 comments on commit 9b388ab

Please sign in to comment.