Skip to content

Commit

Permalink
enhance: Support username/password ETCD credential (#324)
Browse files Browse the repository at this point in the history
Add username/password auth method for connecting etcd

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia authored Nov 4, 2024
1 parent 18618bb commit 09d69cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions states/etcd_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 09d69cd

Please sign in to comment.