Initial commit

This commit is contained in:
2022-06-02 08:05:25 +02:00
commit dfbbc0ee5f
316 changed files with 151609 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package main
import (
"log"
"os"
"path/filepath"
"strconv"
// Vendors
"iscsi"
"github.com/Sirupsen/logrus"
"github.com/docker/go-plugins-helpers/volume"
)
// Main
func main() {
debug := os.Getenv("DEBUG")
if ok, _ := strconv.ParseBool(debug); ok {
logrus.SetLevel(logrus.DebugLevel)
}
iSCSI = iscsi.NewISCSIPlugin()
path := "/var/lib/docker"
d, err := newiscsiDriver(path)
if err != nil {
log.Fatal(err)
}
socketPath := "/run/docker/plugins"
if err := os.MkdirAll(socketPath, 0755); err != nil {
logrus.Error(err.Error())
}
socketAddress := filepath.Join(socketPath, "volume-iscsi.sock")
h := volume.NewHandler(d)
logrus.Infof("listening on %s", socketAddress)
logrus.Error(h.ServeUnix(socketAddress, 0))
}