Skip to content

Commit 32caaee

Browse files
committed
Snapshotters: Export the root path
Some of the snapshotters that allow you to change their root location were already doing this, this just makes all of them follow the same pattern. Signed-off-by: Danny Canter <[email protected]>
1 parent 8eb03f1 commit 32caaee

File tree

6 files changed

+9
-2
lines changed

6 files changed

+9
-2
lines changed

plugins/snapshots/blockfile/plugin/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func init() {
7474
}
7575
opts = append(opts, blockfile.WithRecreateScratch(config.RecreateScratch))
7676

77+
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
7778
return blockfile.NewSnapshotter(root, opts...)
7879
},
7980
})

plugins/snapshots/btrfs/plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func init() {
5454
root = config.RootPath
5555
}
5656

57-
ic.Meta.Exports = map[string]string{"root": root}
57+
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
5858
return btrfs.NewSnapshotter(root)
5959
},
6060
})

plugins/snapshots/devmapper/plugin/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func init() {
5050
config.RootPath = ic.Properties[plugins.PropertyRootDir]
5151
}
5252

53+
ic.Meta.Exports[plugins.SnapshotterRootDir] = config.RootPath
5354
return devmapper.NewSnapshotter(ic.Context, config)
5455
},
5556
})

plugins/snapshots/native/plugin/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func init() {
5050
root = config.RootPath
5151
}
5252

53+
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
5354
return native.NewSnapshotter(root)
5455
},
5556
})

plugins/snapshots/overlay/plugin/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func init() {
9292
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIDs)
9393
}
9494

95-
ic.Meta.Exports["root"] = root
95+
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
9696
return overlay.NewSnapshotter(root, oOpts...)
9797
},
9898
})

plugins/types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@ const (
9393
// PropertyTTRPCAddress is the ttrpc address used for client connections to containerd
9494
PropertyTTRPCAddress = "io.containerd.plugin.ttrpc.address"
9595
)
96+
97+
const (
98+
SnapshotterRootDir = "root"
99+
)

0 commit comments

Comments
 (0)