From 80cee15f8f77ef49e1533bc1750669062c4fd6dd Mon Sep 17 00:00:00 2001 From: abushwang Date: Tue, 10 Dec 2024 16:46:48 +0800 Subject: [PATCH] fix CI error Signed-off-by: abushwang --- cmd/containerd-stargz-grpc/main.go | 4 ++++ cmd/go.mod | 10 +++++----- cmd/stargz-fuse-manager/fusemanager/client.go | 14 ++++++++------ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cmd/containerd-stargz-grpc/main.go b/cmd/containerd-stargz-grpc/main.go index 21c572bb7..db92f896d 100644 --- a/cmd/containerd-stargz-grpc/main.go +++ b/cmd/containerd-stargz-grpc/main.go @@ -213,6 +213,10 @@ func main() { log.G(ctx).WithError(err).Fatalf("failed to serve snapshotter") } + // TODO: In detach mode, rs is taken over by fusemanager, + // but client will send unmount request to fusemanager, + // and fusemanager need get mount info from local db to + // determine its behavior if cleanup { log.G(ctx).Debug("Closing the snapshotter") rs.Close() diff --git a/cmd/go.mod b/cmd/go.mod index bec37eeec..a23594631 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -14,19 +14,22 @@ require ( github.com/coreos/go-systemd/v22 v22.5.0 github.com/docker/go-metrics v0.0.1 github.com/goccy/go-json v0.10.3 + github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-multierror v1.1.1 github.com/klauspost/compress v1.17.11 + github.com/moby/sys/mountinfo v0.7.2 github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0 github.com/opencontainers/runtime-spec v1.2.0 github.com/pelletier/go-toml v1.9.5 + github.com/pkg/errors v0.9.1 github.com/rs/xid v1.6.0 + github.com/sirupsen/logrus v1.9.3 github.com/urfave/cli/v2 v2.27.5 go.etcd.io/bbolt v1.3.11 golang.org/x/sync v0.9.0 golang.org/x/sys v0.26.0 google.golang.org/grpc v1.68.0 - k8s.io/cri-api v0.32.0-alpha.0 ) require ( @@ -65,7 +68,6 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect @@ -88,7 +90,6 @@ require ( github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/moby/locker v1.0.1 // indirect - github.com/moby/sys/mountinfo v0.7.2 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/signal v0.7.1 // indirect github.com/moby/sys/symlink v0.3.0 // indirect @@ -107,13 +108,11 @@ require ( github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 // indirect github.com/opencontainers/selinux v1.11.1 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect @@ -141,6 +140,7 @@ require ( k8s.io/api v0.31.2 // indirect k8s.io/apimachinery v0.31.2 // indirect k8s.io/client-go v0.31.2 // indirect + k8s.io/cri-api v0.32.0-alpha.0 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect diff --git a/cmd/stargz-fuse-manager/fusemanager/client.go b/cmd/stargz-fuse-manager/fusemanager/client.go index 3a38dc203..4d79da8c0 100644 --- a/cmd/stargz-fuse-manager/fusemanager/client.go +++ b/cmd/stargz-fuse-manager/fusemanager/client.go @@ -27,6 +27,7 @@ import ( "github.com/containerd/log" "google.golang.org/grpc" "google.golang.org/grpc/backoff" + "google.golang.org/grpc/credentials/insecure" pb "github.com/containerd/stargz-snapshotter/cmd/stargz-fuse-manager/fusemanager/api" "github.com/containerd/stargz-snapshotter/snapshot" @@ -60,17 +61,18 @@ func newClient(ctx context.Context, socket string) (pb.StargzFuseManagerServiceC connParams := grpc.ConnectParams{ Backoff: backoff.DefaultConfig, } + gopts := []grpc.DialOption{ - grpc.WithBlock(), - grpc.WithInsecure(), - grpc.FailOnNonTempDialError(true), + grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithConnectParams(connParams), grpc.WithContextDialer(dialer.ContextDialer), - grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize)), - grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize)), + grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize), + grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize), + ), } - conn, err := grpc.DialContext(ctx, fmt.Sprintf("unix://%s", socket), gopts...) + conn, err := grpc.NewClient(fmt.Sprintf("unix://%s", socket), gopts...) if err != nil { return nil, err }