From 09d69cdb962da93f65aa23dd8d3a1d0a5d1be8e6 Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 4 Nov 2024 15:52:16 +0800 Subject: [PATCH] enhance: Support username/password ETCD credential (#324) Add username/password auth method for connecting etcd Signed-off-by: Congqi Xia --- states/etcd_connect.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/states/etcd_connect.go b/states/etcd_connect.go index 3352422..25fb1c6 100644 --- a/states/etcd_connect.go +++ b/states/etcd_connect.go @@ -51,6 +51,8 @@ type ConnectParams struct { RootCA string `name:"rootCAPem" default:"" desc:"root CA pem file path"` ETCDPem string `name:"etcdCert" default:"" desc:"etcd tls cert file path"` ETCDKey string `name:"etcdKey" default:"" desc:"etcd tls key file path"` + ETCDUserName string `name:"etcdUserName" default:"" desc:"etcd credential username"` + ETCDPassword string `name:"etcdPassword" default:"" desc:"etcd creidentail password"` Auto bool `name:"auto" default:"false" desc:"auto detect rootPath if possible"` } @@ -115,6 +117,9 @@ func (s *disconnectState) ConnectCommand(ctx context.Context, cp *ConnectParams) grpc.WithBlock(), }, + Username: cp.ETCDUserName, + Password: cp.ETCDPassword, + TLS: tls, // disable grpc logging Logger: zap.NewNop(),