mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
move flag configuration variable to util
remove unwanted checks remove getting drivertype from binary name Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
2b1355061e
commit
89732d923f
@ -24,6 +24,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/ceph/ceph-csi/pkg/util"
|
||||
|
||||
connlib "github.com/kubernetes-csi/csi-lib-utils/connection"
|
||||
"github.com/kubernetes-csi/csi-lib-utils/rpc"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -83,7 +85,7 @@ func recordLiveness(endpoint string, pollTime, timeout time.Duration) {
|
||||
}
|
||||
}
|
||||
|
||||
func Run(endpoint, livenessendpoint string, port int, pollTime, timeout time.Duration) {
|
||||
func Run(conf *util.Config) {
|
||||
klog.Infof("Liveness Running")
|
||||
|
||||
ip := os.Getenv("POD_IP")
|
||||
@ -94,11 +96,11 @@ func Run(endpoint, livenessendpoint string, port int, pollTime, timeout time.Dur
|
||||
}
|
||||
|
||||
// start liveness collection
|
||||
go recordLiveness(endpoint, pollTime, timeout)
|
||||
go recordLiveness(conf.Endpoint, conf.PollTime, conf.PoolTimeout)
|
||||
|
||||
// start up prometheus endpoint
|
||||
addr := net.JoinHostPort(ip, strconv.Itoa(port))
|
||||
http.Handle(livenessendpoint, promhttp.Handler())
|
||||
addr := net.JoinHostPort(ip, strconv.Itoa(conf.LivenessPort))
|
||||
http.Handle(conf.LivenessPath, promhttp.Handler())
|
||||
err := http.ListenAndServe(addr, nil)
|
||||
if err != nil {
|
||||
klog.Fatalln(err)
|
||||
|
Reference in New Issue
Block a user