Skip to content

Commit

Permalink
Merge pull request #100 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
go.mod: module github.com/containerd/fuse-overlayfs-snapshotter/v2
  • Loading branch information
AkihiroSuda authored Oct 24, 2024
2 parents fb6d1a2 + dca913c commit cde39b0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ COPY . /go/src/github.com/containerd/fuse-overlayfs-snapshotter
WORKDIR /go/src/github.com/containerd/fuse-overlayfs-snapshotter
ENV CGO_ENABLED=0
ENV GO111MODULE=on
RUN go build ./...
RUN mkdir /out && go test -c -o /out/containerd-fuse-overlayfs.test

# from https://github.com/containers/fuse-overlayfs/blob/53c17dab78b43de1cd121bf9260b20b76371bbaf/Dockerfile.static.ubuntu
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ VERSION ?= $(shell $(GIT) describe --match 'v[0-9]*' --dirty='.m' --always --tag
VERSION_TRIMMED := $(VERSION:v%=%)
REVISION ?= $(shell $(GIT) rev-parse HEAD)$(shell if ! $(GIT) diff --no-ext-diff --quiet --exit-code; then $(ECHO) .m; fi)

PKG_MAIN := github.com/containerd/fuse-overlayfs-snapshotter/cmd/$(TARGET_BIN)
PKG_VERSION := github.com/containerd/fuse-overlayfs-snapshotter/cmd/$(TARGET_BIN)/version
PKG_MAIN := github.com/containerd/fuse-overlayfs-snapshotter/v2/cmd/$(TARGET_BIN)
PKG_VERSION := github.com/containerd/fuse-overlayfs-snapshotter/v2/cmd/$(TARGET_BIN)/version

export GO_BUILD=GO111MODULE=on CGO_ENABLED=0 $(GO) build -ldflags "-s -w -X $(PKG_VERSION).Version=$(VERSION) -X $(PKG_VERSION).Revision=$(REVISION)"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Choose 1 if you don't mind recompiling containerd, otherwise choose 2.

### Option 1: Embed `fuse-overlayfs` plugin into the containerd binary

Create `builtins_fuseoverlayfs_linux.go` under [`$GOPATH/src/github.com/containerd/containerd/cmd/containerd`](https://github.com/containerd/containerd/tree/master/cmd/containerd)
Create `builtins_fuseoverlayfs_linux.go` under [`$GOPATH/src/github.com/containerd/containerd/cmd/containerd/builtins`](https://github.com/containerd/containerd/tree/master/cmd/containerd/builtins)
with the following content, and recompile the containerd binary:

```go
Expand All @@ -45,7 +45,7 @@ with the following content, and recompile the containerd binary:

package main

import _ "github.com/containerd/fuse-overlayfs-snapshotter/plugin"
import _ "github.com/containerd/fuse-overlayfs-snapshotter/v2/plugin"
```

No extra configuration is needed.
Expand Down
4 changes: 2 additions & 2 deletions cmd/containerd-fuse-overlayfs-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1"
"github.com/containerd/containerd/v2/contrib/snapshotservice"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter"
"github.com/containerd/fuse-overlayfs-snapshotter/cmd/containerd-fuse-overlayfs-grpc/version"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter/v2"
"github.com/containerd/fuse-overlayfs-snapshotter/v2/cmd/containerd-fuse-overlayfs-grpc/version"
"github.com/containerd/log"
sddaemon "github.com/coreos/go-systemd/v22/daemon"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/containerd/fuse-overlayfs-snapshotter
module github.com/containerd/fuse-overlayfs-snapshotter/v2

go 1.22.0

Expand Down
10 changes: 6 additions & 4 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ package fuseoverlayfs
import (
"errors"

fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter"
"github.com/containerd/containerd/v2/plugins"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter/v2"
"github.com/containerd/platforms"
"github.com/containerd/plugin"
"github.com/containerd/plugin/registry"
)

// Config represents configuration for the fuse-overlayfs plugin.
Expand All @@ -34,8 +36,8 @@ type Config struct {
}

func init() {
plugin.Register(&plugin.Registration{
Type: plugin.SnapshotPlugin,
registry.Register(&plugin.Registration{
Type: plugins.SnapshotPlugin,
ID: "fuse-overlayfs",
Config: &Config{},
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
Expand All @@ -46,7 +48,7 @@ func init() {
return nil, errors.New("invalid fuse-overlayfs configuration")
}

root := ic.Root
root := ic.Properties[plugins.PropertyRootDir]
if config.RootPath != "" {
root = config.RootPath
}
Expand Down

0 comments on commit cde39b0

Please sign in to comment.