From 2453b95ad428c33277305c51a0fd001717139c64 Mon Sep 17 00:00:00 2001 From: abushwang Date: Mon, 9 Dec 2024 14:25:38 +0800 Subject: [PATCH] mv fusemanager to cmd dir Signed-off-by: abushwang --- cmd/containerd-stargz-grpc/main.go | 8 +++--- .../fusemanager}/api/api.pb.go | 0 .../fusemanager}/api/api.proto | 0 .../fusemanager}/api/generate.go | 0 .../fusemanager}/client.go | 4 +-- .../fusemanager}/fusemanager.go | 2 +- .../fusemanager}/fusestore.go | 0 .../fusemanager}/service.go | 9 +++++- cmd/stargz-fuse-manager/main.go | 2 +- fusemanager/config.go | 28 ------------------- 10 files changed, 16 insertions(+), 37 deletions(-) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/api/api.pb.go (100%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/api/api.proto (100%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/api/generate.go (100%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/client.go (97%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/fusemanager.go (98%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/fusestore.go (100%) rename {fusemanager => cmd/stargz-fuse-manager/fusemanager}/service.go (97%) delete mode 100644 fusemanager/config.go diff --git a/cmd/containerd-stargz-grpc/main.go b/cmd/containerd-stargz-grpc/main.go index cfed6c1ef..596002730 100644 --- a/cmd/containerd-stargz-grpc/main.go +++ b/cmd/containerd-stargz-grpc/main.go @@ -36,9 +36,9 @@ import ( "github.com/containerd/containerd/v2/pkg/sys" "github.com/containerd/log" "github.com/containerd/stargz-snapshotter/cmd/containerd-stargz-grpc/fsopts" + "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager" "github.com/containerd/stargz-snapshotter/service" "github.com/containerd/stargz-snapshotter/service/keychain/keychainconfig" - "github.com/containerd/stargz-snapshotter/fusemanager" snbase "github.com/containerd/stargz-snapshotter/snapshot" "github.com/containerd/stargz-snapshotter/version" sddaemon "github.com/coreos/go-systemd/v22/daemon" @@ -181,9 +181,9 @@ func main() { } fuseManagerConfig := fusemanager.Config{ - Config: &config.Config, - IPFS:config.IPFS, - MetadataStore: config.MetadataStore, + Config: &config.Config, + IPFS: config.IPFS, + MetadataStore: config.MetadataStore, DefaultImageServiceAddress: defaultImageServiceAddress, } diff --git a/fusemanager/api/api.pb.go b/cmd/stargz-fuse-manager/fusemanager/api/api.pb.go similarity index 100% rename from fusemanager/api/api.pb.go rename to cmd/stargz-fuse-manager/fusemanager/api/api.pb.go diff --git a/fusemanager/api/api.proto b/cmd/stargz-fuse-manager/fusemanager/api/api.proto similarity index 100% rename from fusemanager/api/api.proto rename to cmd/stargz-fuse-manager/fusemanager/api/api.proto diff --git a/fusemanager/api/generate.go b/cmd/stargz-fuse-manager/fusemanager/api/generate.go similarity index 100% rename from fusemanager/api/generate.go rename to cmd/stargz-fuse-manager/fusemanager/api/generate.go diff --git a/fusemanager/client.go b/cmd/stargz-fuse-manager/fusemanager/client.go similarity index 97% rename from fusemanager/client.go rename to cmd/stargz-fuse-manager/fusemanager/client.go index 2415cff65..3a38dc203 100644 --- a/fusemanager/client.go +++ b/cmd/stargz-fuse-manager/fusemanager/client.go @@ -22,13 +22,13 @@ import ( "fmt" "time" - "github.com/containerd/log" "github.com/containerd/containerd/v2/defaults" "github.com/containerd/containerd/v2/pkg/dialer" + "github.com/containerd/log" "google.golang.org/grpc" "google.golang.org/grpc/backoff" - pb "github.com/containerd/stargz-snapshotter/fusemanager/api" + pb "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager/api" "github.com/containerd/stargz-snapshotter/snapshot" ) diff --git a/fusemanager/fusemanager.go b/cmd/stargz-fuse-manager/fusemanager/fusemanager.go similarity index 98% rename from fusemanager/fusemanager.go rename to cmd/stargz-fuse-manager/fusemanager/fusemanager.go index fafd13f9f..8ae870467 100644 --- a/fusemanager/fusemanager.go +++ b/cmd/stargz-fuse-manager/fusemanager/fusemanager.go @@ -35,7 +35,7 @@ import ( "golang.org/x/sys/unix" "google.golang.org/grpc" - pb "github.com/containerd/stargz-snapshotter/fusemanager/api" + pb "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager/api" "github.com/containerd/stargz-snapshotter/version" ) diff --git a/fusemanager/fusestore.go b/cmd/stargz-fuse-manager/fusemanager/fusestore.go similarity index 100% rename from fusemanager/fusestore.go rename to cmd/stargz-fuse-manager/fusemanager/fusestore.go diff --git a/fusemanager/service.go b/cmd/stargz-fuse-manager/fusemanager/service.go similarity index 97% rename from fusemanager/service.go rename to cmd/stargz-fuse-manager/fusemanager/service.go index 9d3d33eb4..efd9dc706 100644 --- a/fusemanager/service.go +++ b/cmd/stargz-fuse-manager/fusemanager/service.go @@ -33,8 +33,8 @@ import ( bolt "go.etcd.io/bbolt" "google.golang.org/grpc" - pb "github.com/containerd/stargz-snapshotter/fusemanager/api" "github.com/containerd/stargz-snapshotter/cmd/containerd-stargz-grpc/fsopts" + pb "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager/api" "github.com/containerd/stargz-snapshotter/service" "github.com/containerd/stargz-snapshotter/service/keychain/keychainconfig" "github.com/containerd/stargz-snapshotter/snapshot" @@ -46,6 +46,13 @@ const ( FuseManagerReady ) +type Config struct { + Config *service.Config + IPFS bool + MetadataStore string + DefaultImageServiceAddress string +} + type Server struct { pb.UnimplementedStargzFuseManagerServiceServer diff --git a/cmd/stargz-fuse-manager/main.go b/cmd/stargz-fuse-manager/main.go index f0ef0c7a5..3fba7e3ff 100644 --- a/cmd/stargz-fuse-manager/main.go +++ b/cmd/stargz-fuse-manager/main.go @@ -17,7 +17,7 @@ package main import ( - fusemanager "github.com/containerd/stargz-snapshotter/fusemanager" + fusemanager "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager" ) func main() { diff --git a/fusemanager/config.go b/fusemanager/config.go deleted file mode 100644 index d3dd0a9e0..000000000 --- a/fusemanager/config.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package fusemanager - -import ( - "github.com/containerd/stargz-snapshotter/service" -) - -type Config struct { - Config *service.Config - IPFS bool - MetadataStore string - DefaultImageServiceAddress string -} \ No newline at end of file