Skip to content

Commit

Permalink
Update to containerd v2
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Jul 31, 2024
1 parent 331a09a commit 72d1960
Show file tree
Hide file tree
Showing 69 changed files with 586 additions and 677 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
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .github/workflows/k8s-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: |
AUTH_TYPE='${{ inputs.auth-type }}'
./tests/helpers/kind.sh
- name: Dump logs
if: failure()
continue-on-error: true
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@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21.12"
go-version: "1.22.5"
- name: cache go mod
uses: actions/cache@v4
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
2 changes: 1 addition & 1 deletion docs/run_nydus_in_kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ networking:
ipFamily: dual
nodes:
- role: control-plane
image: kindest/node:v1.23.4
image: kindest/node:v1.30.2
extraMounts:
- hostPath: ./containerd-config.toml
containerPath: /etc/containerd/config.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 72d1960

Please sign in to comment.