diff --git a/bin/democratic-csi b/bin/democratic-csi index 52f149d..6ccdf7d 100755 --- a/bin/democratic-csi +++ b/bin/democratic-csi @@ -342,7 +342,10 @@ logger.info( let socketPath = bindSocket; socketPath = socketPath.replace(/^unix:\/\//g, ""); if (socketPath && fs.existsSync(socketPath)) { - fs.unlinkSync(socketPath); + let fsStat = fs.statSync(socketPath); + if (fsStat.isSocket()) { + fs.unlinkSync(socketPath); + } } process.exit(code); @@ -373,7 +376,10 @@ if (require.main === module) { let socketPath = bindSocket; socketPath = socketPath.replace(/^unix:\/\//g, ""); if (socketPath && fs.existsSync(socketPath)) { - fs.unlinkSync(socketPath); + let fsStat = fs.statSync(socketPath); + if (fsStat.isSocket()) { + fs.unlinkSync(socketPath); + } } await new Promise((resolve, reject) => { diff --git a/bin/liveness-probe b/bin/liveness-probe index 48847ea..c2d9470 100755 --- a/bin/liveness-probe +++ b/bin/liveness-probe @@ -35,7 +35,7 @@ const package = require("../package.json"); args.version = package.version; const protoLoader = require("@grpc/proto-loader"); -const csiVersion = process.env.CSI_VERSION || args.csiVersion || "1.2.0"; +const csiVersion = process.env.CSI_VERSION || args.csiVersion || "1.5.0"; const PROTO_PATH = __dirname + "/../csi_proto/csi-v" + csiVersion + ".proto"; // Suggested options for similarity to existing grpc.load behavior