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

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