Skip to content

Commit

Permalink
feat: add longhorn/types
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <poan.yang@suse.com>
  • Loading branch information
FrankYang0529 committed May 10, 2024
1 parent 5fdc92a commit 09aec89
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 324 deletions.
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/longhorn/go-common-libs v0.0.0-20240427164621-70d1933bfa90
github.com/longhorn/go-iscsi-helper v0.0.0-20240427164656-e9439c0018ce
github.com/longhorn/sparse-tools v0.0.0-20240427164751-a7b9f1b2c8a8
github.com/longhorn/types v0.0.0-20240427164854-38dbed8528d3
github.com/longhorn/types v0.0.0
github.com/moby/moby v24.0.9+incompatible
github.com/pkg/errors v0.9.1
github.com/rancher/go-fibmap v0.0.0-20160418233256-5fc9f8c1ed47
Expand Down Expand Up @@ -76,3 +76,7 @@ require (
k8s.io/mount-utils v0.30.0 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
)

replace github.com/longhorn/types => github.com/FrankYang0529/types v0.0.0-20240510025234-5c597a448bbb

replace github.com/longhorn/go-common-libs => github.com/FrankYang0529/go-common-libs v0.0.0-20240510031242-ecfff0cc61d7
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSu
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 h1:Px2UA+2RvSSvv+RvJNuUB6n7rs5Wsel4dXLe90Um2n4=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/FrankYang0529/go-common-libs v0.0.0-20240510031242-ecfff0cc61d7 h1:U7aQF24LOyXoDGaaTfF7EW6iAXWZ33RYzKzry29YiuY=
github.com/FrankYang0529/go-common-libs v0.0.0-20240510031242-ecfff0cc61d7/go.mod h1:CUw92Qs1CJcV81ggBejEkyYGR/N/7urkzixldzJt1Vc=
github.com/FrankYang0529/types v0.0.0-20240510025234-5c597a448bbb h1:ekXv67CVSh5PLi2jm32gYkTjKT7G2WaNle66Kv9gr1k=
github.com/FrankYang0529/types v0.0.0-20240510025234-5c597a448bbb/go.mod h1:pqT+7B8T+nkyUZYe8tL3CwPDCHjkbe3mHUDY5ntJFyQ=
github.com/aws/aws-sdk-go v1.34.2 h1:9vCknCdTAmmV4ht7lPuda7aJXzllXwEQyCMZKJHjBrM=
github.com/aws/aws-sdk-go v1.34.2/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -68,14 +72,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/longhorn/backupstore v0.0.0-20240509144945-3bce6e69af15 h1:D838/RWPKmP9ozjOM2Al8s11NbTGLC2m+ZKT3JAogfY=
github.com/longhorn/backupstore v0.0.0-20240509144945-3bce6e69af15/go.mod h1:n210xpMUVrSn/W4Za/9BZhyXLCTVfAOq5lNdLrRSyz8=
github.com/longhorn/go-common-libs v0.0.0-20240427164621-70d1933bfa90 h1:uBVee6AulPsgSvsvaxdj4xIdgkIvjIqA0j7ZD+Hg/Mc=
github.com/longhorn/go-common-libs v0.0.0-20240427164621-70d1933bfa90/go.mod h1:qppGSy9WsxH1C9T6yhSMvG53ynpasyKOH/n9e1jr8mw=
github.com/longhorn/go-iscsi-helper v0.0.0-20240427164656-e9439c0018ce h1:PxKniE9F6IZ2DMKfmxDsbqeAxQI1TZhnw7/HOBMs1Is=
github.com/longhorn/go-iscsi-helper v0.0.0-20240427164656-e9439c0018ce/go.mod h1:d9t3gtE+UPjescbCFluXd4xBc8OQT/JrC2cdkk2IXWQ=
github.com/longhorn/sparse-tools v0.0.0-20240427164751-a7b9f1b2c8a8 h1:lwtmZEomiv8uchwo9JIyoo+lK8J3cLCm7/qzpn6wmzo=
github.com/longhorn/sparse-tools v0.0.0-20240427164751-a7b9f1b2c8a8/go.mod h1:pvlUkVwRGojXhcTkkzksOe4i7GVk59P2PbJjHIB2Yj0=
github.com/longhorn/types v0.0.0-20240427164854-38dbed8528d3 h1:7YDGJTwro/kCcMmnCWM1UIL4JgervR6MT++71PvcbGY=
github.com/longhorn/types v0.0.0-20240427164854-38dbed8528d3/go.mod h1:pqT+7B8T+nkyUZYe8tL3CwPDCHjkbe3mHUDY5ntJFyQ=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"google.golang.org/grpc/reflection"
"google.golang.org/protobuf/types/known/emptypb"

"github.com/longhorn/go-common-libs/generated/profilerpb"
"github.com/longhorn/go-common-libs/profiler"
journal "github.com/longhorn/sparse-tools/stats"
"github.com/longhorn/types/pkg/generated/enginerpc"
"github.com/longhorn/types/pkg/generated/profilerrpc"

"github.com/longhorn/longhorn-engine/pkg/controller"
"github.com/longhorn/longhorn-engine/pkg/interceptor"
Expand Down Expand Up @@ -52,7 +52,7 @@ func GetControllerGRPCServer(volumeName, instanceName string, c *controller.Cont
enginerpc.RegisterControllerServiceServer(server, cs)
healthpb.RegisterHealthServer(server, NewControllerHealthCheckServer(cs))
reflection.Register(server)
profilerpb.RegisterProfilerServer(server, profiler.NewServer(volumeName))
profilerrpc.RegisterProfilerServer(server, profiler.NewServer(volumeName))
return server
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/replica/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"strconv"

"github.com/longhorn/go-common-libs/generated/profilerpb"
"github.com/longhorn/go-common-libs/profiler"
"github.com/longhorn/types/pkg/generated/enginerpc"
"github.com/longhorn/types/pkg/generated/profilerrpc"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -35,7 +35,7 @@ func NewReplicaServer(volumeName, instanceName string, s *replica.Server) *grpc.
enginerpc.RegisterReplicaServiceServer(server, rs)
healthpb.RegisterHealthServer(server, NewReplicaHealthCheckServer(rs))
reflection.Register(server)
profilerpb.RegisterProfilerServer(server, profiler.NewServer(volumeName))
profilerrpc.RegisterProfilerServer(server, profiler.NewServer(volumeName))
return server
}

Expand Down

This file was deleted.

Loading

0 comments on commit 09aec89

Please sign in to comment.