Skip to content

Commit

Permalink
Merge pull request containerd#10073 from dcantah/snapshotters-root-ex…
Browse files Browse the repository at this point in the history
…port

Snapshotters: Export the root path
  • Loading branch information
samuelkarp authored Apr 15, 2024
2 parents 8eb03f1 + 32caaee commit 8317959
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/snapshots/blockfile/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func init() {
}
opts = append(opts, blockfile.WithRecreateScratch(config.RecreateScratch))

ic.Meta.Exports[plugins.SnapshotterRootDir] = root
return blockfile.NewSnapshotter(root, opts...)
},
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/snapshots/btrfs/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func init() {
root = config.RootPath
}

ic.Meta.Exports = map[string]string{"root": root}
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
return btrfs.NewSnapshotter(root)
},
})
Expand Down
1 change: 1 addition & 0 deletions plugins/snapshots/devmapper/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func init() {
config.RootPath = ic.Properties[plugins.PropertyRootDir]
}

ic.Meta.Exports[plugins.SnapshotterRootDir] = config.RootPath
return devmapper.NewSnapshotter(ic.Context, config)
},
})
Expand Down
1 change: 1 addition & 0 deletions plugins/snapshots/native/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func init() {
root = config.RootPath
}

ic.Meta.Exports[plugins.SnapshotterRootDir] = root
return native.NewSnapshotter(root)
},
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/snapshots/overlay/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func init() {
ic.Meta.Capabilities = append(ic.Meta.Capabilities, capaOnlyRemapIDs)
}

ic.Meta.Exports["root"] = root
ic.Meta.Exports[plugins.SnapshotterRootDir] = root
return overlay.NewSnapshotter(root, oOpts...)
},
})
Expand Down
4 changes: 4 additions & 0 deletions plugins/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ const (
// PropertyTTRPCAddress is the ttrpc address used for client connections to containerd
PropertyTTRPCAddress = "io.containerd.plugin.ttrpc.address"
)

const (
SnapshotterRootDir = "root"
)

0 comments on commit 8317959

Please sign in to comment.