File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
internal/cvmfs/singlemount Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -47,17 +47,21 @@ func main() {
4747 os .Exit (0 )
4848 }
4949
50- // Initialize and run automount -runner.
50+ // Initialize and run singlemount -runner.
5151
5252 log .Infof ("singlemount-runner for CVMFS CSI plugin version %s" , cvmfsversion .FullVersion ())
5353 log .Infof ("Command line arguments %v" , os .Args )
5454
55+ if err := singlemount .CreateSingleMountsDir (); err != nil {
56+ log .Fatalf ("Failed to create metadata directory in %s: %v" , singlemount .SinglemountsDir , err )
57+ }
58+
5559 opts := singlemount.Opts {
5660 Endpoint : * endpoint ,
5761 }
5862
5963 if err := singlemount .RunBlocking (opts ); err != nil {
60- log .Fatalf ("Failed to run automount -runner: %v" , err )
64+ log .Fatalf ("Failed to run singlemount -runner: %v" , err )
6165 }
6266
6367 os .Exit (0 )
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ const (
4141 // bind.json
4242 // config
4343 // mount.json
44- singlemountsDir = "/var/lib/cvmfs.csi.cern.ch/single"
44+ SinglemountsDir = "/var/lib/cvmfs.csi.cern.ch/single"
4545
4646 // Contains mapping between all mountpoint -> mount ID that are currently
4747 // in use. We need to keep track of these, because CSI's NodeUnstageVolume
8080)
8181
8282func fmtMountSingleBasePath (mountID string ) string {
83- return path .Join (singlemountsDir , mountID )
83+ return path .Join (SinglemountsDir , mountID )
8484}
8585
8686func fmtMountpointPath (mountID string ) string {
@@ -100,13 +100,14 @@ func fmtConfigPath(mountID string) string {
100100}
101101
102102func fmtMountpointsMetadataPath () string {
103- return path .Join (singlemountsDir , mountpointsFilename )
103+ return path .Join (SinglemountsDir , mountpointsFilename )
104104}
105105
106- func init () {
107- if err := os .MkdirAll (singlemountsDir , 0775 ); err != nil {
108- panic (err )
109- }
106+ // Creates the metadata directory for singlemount-runner.
107+ // Must be called before RunBlocking().
108+ // TOOD: make the path configurable and expose via the chart.
109+ func CreateSingleMountsDir () error {
110+ return os .MkdirAll (SinglemountsDir , 0775 )
110111}
111112
112113// Makes sure that directory <mountsDir>/<MountSingleRequest.MountId> exists.
You can’t perform that action at this time.
0 commit comments