cleanup: move servers to a new struct

For future enhancments like adding more
servers. Moving the list of servers to a
new structure.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2021-02-08 17:55:18 +05:30
committed by mergify[bot]
parent cfb6abc067
commit ee0576278f
3 changed files with 29 additions and 12 deletions

View File

@ -168,7 +168,12 @@ func (r *Driver) Run(conf *util.Config) {
}
s := csicommon.NewNonBlockingGRPCServer()
s.Start(conf.Endpoint, conf.HistogramOption, r.ids, r.cs, r.ns, conf.EnableGRPCMetrics)
srv := csicommon.Servers{
IS: r.ids,
CS: r.cs,
NS: r.ns,
}
s.Start(conf.Endpoint, conf.HistogramOption, srv, conf.EnableGRPCMetrics)
if conf.EnableGRPCMetrics {
util.WarningLogMsg("EnableGRPCMetrics is deprecated")
go util.StartMetricsServer(conf)