Skip to content

Commit 7c79cce

Browse files
committed
Make IPFS feature opt-in
Signed-off-by: Kohei Tokunaga <[email protected]>
1 parent 99edafb commit 7c79cce

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

docs/ipfs.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
You can run OCI-compatible container images on IPFS with lazy pulling.
44

5+
Add the following configuration to `config.toml` of Stargz Snapsohtter (typically located at `/etc/containerd-stargz-grpc/config.toml`).
6+
7+
```toml
8+
[blob]
9+
ipfs = true
10+
```
11+
512
## IPFS-enabled OCI Image
613

714
For obtaining IPFS-enabled OCI Image, each descriptor in an OCI image must contain the following URL in `urls` field.

fs/config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ type BlobConfig struct {
7474
MaxRetries int `toml:"max_retries"`
7575
MinWaitMSec int `toml:"min_wait_msec"`
7676
MaxWaitMSec int `toml:"max_wait_msec"`
77+
78+
// IPFS is an option to allow snapshotter mounting layers from IPFS.
79+
IPFS bool `toml:"ipfs"`
7780
}
7881

7982
type DirectoryCacheConfig struct {

fs/remote/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (r *Resolver) Resolve(ctx context.Context, hosts source.RegistryHosts, refs
116116

117117
var f fetcher
118118
var size int64
119-
if ipfs.Supported(desc) {
119+
if r.blobConfig.IPFS && ipfs.Supported(desc) {
120120
r, s, err := ipfs.NewReader(ctx, desc)
121121
if err != nil {
122122
return nil, err

script/integration/containerd/config.stargz.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ metadata_store = "memory"
22

33
[blob]
44
check_always = true
5+
ipfs = true
56

67
[[resolver.host."registry-integration.test".mirrors]]
78
host = "registry-alt.test:5000"

0 commit comments

Comments
 (0)