From c4a58d259a98d2807cddf7759726f3069881493a Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Sat, 27 Mar 2021 11:56:57 +0800 Subject: [PATCH] Add deploy mode env variable Signed-off-by: cai.zhang --- cmd/proxy/node/proxy_node.go | 1 + cmd/singlenode/main.go | 1 + internal/proxynode/impl.go | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/proxy/node/proxy_node.go b/cmd/proxy/node/proxy_node.go index 7c6a8970b1..c570497798 100644 --- a/cmd/proxy/node/proxy_node.go +++ b/cmd/proxy/node/proxy_node.go @@ -16,6 +16,7 @@ import ( ) func main() { + os.Setenv("DEPLOY_MODE", "DISTRIBUTED") ctx, cancel := context.WithCancel(context.Background()) msFactory := pulsarms.NewFactory() proxynode.Params.Init() diff --git a/cmd/singlenode/main.go b/cmd/singlenode/main.go index 95e9e4cade..e5961927ca 100644 --- a/cmd/singlenode/main.go +++ b/cmd/singlenode/main.go @@ -42,6 +42,7 @@ func main() { var roles roles.MilvusRoles initRoles(&roles) os.Setenv("QUERY_NODE_ID", "1") + os.Setenv("DEPLOY_MODE", "SINGLE_NODE") logCfg := initLogCfg() logutil.SetupLogger(&logCfg) diff --git a/internal/proxynode/impl.go b/internal/proxynode/impl.go index 45d4447769..d0dde4172b 100644 --- a/internal/proxynode/impl.go +++ b/internal/proxynode/impl.go @@ -3,6 +3,7 @@ package proxynode import ( "context" "errors" + "os" "strconv" "go.uber.org/zap" @@ -1281,7 +1282,7 @@ func (node *ProxyNode) RegisterLink(ctx context.Context, req *milvuspb.RegisterL Address: nil, Status: &commonpb.Status{ ErrorCode: commonpb.ErrorCode_Success, - Reason: "", + Reason: os.Getenv("DEPLOY_MODE"), }, }, nil }