@@ -37,118 +37,118 @@ const (
37
37
type Config struct {
38
38
// Type of cache for compressed contents fetched from the registry. "memory" stores them on memory.
39
39
// Other values default to cache them on disk.
40
- HTTPCacheType string `toml:"http_cache_type"`
40
+ HTTPCacheType string `toml:"http_cache_type" json:"http_cache_type" `
41
41
42
42
// Type of cache for uncompressed files contents. "memory" stores them on memory. Other values
43
43
// default to cache them on disk.
44
- FSCacheType string `toml:"filesystem_cache_type"`
44
+ FSCacheType string `toml:"filesystem_cache_type" json:"filesystem_cache_type" `
45
45
46
46
// ResolveResultEntryTTLSec is TTL (in sec) to cache resolved layers for
47
47
// future use. (default 120s)
48
- ResolveResultEntryTTLSec int `toml:"resolve_result_entry_ttl_sec"`
48
+ ResolveResultEntryTTLSec int `toml:"resolve_result_entry_ttl_sec" json:"resolve_result_entry_ttl_sec" `
49
49
50
50
// PrefetchSize is the default size (in bytes) to prefetch when mounting a layer. Default is 0. Stargz-snapshotter still
51
51
// uses the value specified by the image using "containerd.io/snapshot/remote/stargz.prefetch" or the landmark file.
52
- PrefetchSize int64 `toml:"prefetch_size"`
52
+ PrefetchSize int64 `toml:"prefetch_size" json:"prefetch_size" `
53
53
54
54
// PrefetchTimeoutSec is the default timeout (in seconds) when the prefetching takes long. Default is 10s.
55
- PrefetchTimeoutSec int64 `toml:"prefetch_timeout_sec"`
55
+ PrefetchTimeoutSec int64 `toml:"prefetch_timeout_sec" json:"prefetch_timeout_sec" `
56
56
57
57
// NoPrefetch disables prefetching. Default is false.
58
- NoPrefetch bool `toml:"noprefetch"`
58
+ NoPrefetch bool `toml:"noprefetch" json:"noprefetch" `
59
59
60
60
// NoBackgroundFetch disables the behaviour of fetching the entire layer contents in background. Default is false.
61
- NoBackgroundFetch bool `toml:"no_background_fetch"`
61
+ NoBackgroundFetch bool `toml:"no_background_fetch" json:"no_background_fetch" `
62
62
63
63
// Debug enables filesystem debug log.
64
- Debug bool `toml:"debug"`
64
+ Debug bool `toml:"debug" json:"debug" `
65
65
66
66
// AllowNoVerification allows mouting images without verification. Default is false.
67
- AllowNoVerification bool `toml:"allow_no_verification"`
67
+ AllowNoVerification bool `toml:"allow_no_verification" json:"allow_no_verification" `
68
68
69
69
// DisableVerification disables verifying layer contents. Default is false.
70
- DisableVerification bool `toml:"disable_verification"`
70
+ DisableVerification bool `toml:"disable_verification" json:"disable_verification" `
71
71
72
72
// MaxConcurrency is max number of concurrent background tasks for fetching layer contents. Default is 2.
73
- MaxConcurrency int64 `toml:"max_concurrency"`
73
+ MaxConcurrency int64 `toml:"max_concurrency" json:"max_concurrency" `
74
74
75
75
// NoPrometheus disables exposing filesystem-related metrics. Default is false.
76
- NoPrometheus bool `toml:"no_prometheus"`
76
+ NoPrometheus bool `toml:"no_prometheus" json:"no_prometheus" `
77
77
78
78
// BlobConfig is config for layer blob management.
79
- BlobConfig `toml:"blob"`
79
+ BlobConfig `toml:"blob" json:"blob" `
80
80
81
81
// DirectoryCacheConfig is config for directory-based cache.
82
- DirectoryCacheConfig `toml:"directory_cache"`
82
+ DirectoryCacheConfig `toml:"directory_cache" json:"directory_cache" `
83
83
84
84
// FuseConfig is configurations for FUSE fs.
85
- FuseConfig `toml:"fuse"`
85
+ FuseConfig `toml:"fuse" json:"fuse" `
86
86
87
87
// ResolveResultEntry is a deprecated field.
88
- ResolveResultEntry int `toml:"resolve_result_entry"` // deprecated
88
+ ResolveResultEntry int `toml:"resolve_result_entry" json:"resolve_result_entry" ` // deprecated
89
89
}
90
90
91
91
// BlobConfig is configuration for the logic to fetching blobs.
92
92
type BlobConfig struct {
93
93
// ValidInterval specifies a duration (in seconds) during which the layer can be reused without
94
94
// checking the connection to the registry. Default is 60.
95
- ValidInterval int64 `toml:"valid_interval"`
95
+ ValidInterval int64 `toml:"valid_interval" json:"valid_interval" `
96
96
97
97
// CheckAlways overwrites ValidInterval to 0 if it's true. Default is false.
98
- CheckAlways bool `toml:"check_always"`
98
+ CheckAlways bool `toml:"check_always" json:"check_always" `
99
99
100
100
// ChunkSize is the granularity (in bytes) at which background fetch and on-demand reads
101
101
// are fetched from the remote registry. Default is 50000.
102
- ChunkSize int64 `toml:"chunk_size"`
102
+ ChunkSize int64 `toml:"chunk_size" json:"chunk_size" `
103
103
104
104
// FetchTimeoutSec is a timeout duration (in seconds) for fetching chunks from the registry. Default is 300.
105
- FetchTimeoutSec int64 `toml:"fetching_timeout_sec"`
105
+ FetchTimeoutSec int64 `toml:"fetching_timeout_sec" json:"fetching_tieout_sec" `
106
106
107
107
// ForceSingleRangeMode disables using of multiple ranges in a Range Request and always specifies one larger
108
108
// region that covers them. Default is false.
109
- ForceSingleRangeMode bool `toml:"force_single_range_mode"`
109
+ ForceSingleRangeMode bool `toml:"force_single_range_mode" json:"force_single_range_mode" `
110
110
111
111
// PrefetchChunkSize is the maximum bytes transferred per http GET from remote registry
112
112
// during prefetch. It is recommended to have PrefetchChunkSize > ChunkSize.
113
113
// If PrefetchChunkSize < ChunkSize prefetch bytes will be fetched as a single http GET,
114
114
// else total GET requests for prefetch = ceil(PrefetchSize / PrefetchChunkSize).
115
115
// Default is 0.
116
- PrefetchChunkSize int64 `toml:"prefetch_chunk_size"`
116
+ PrefetchChunkSize int64 `toml:"prefetch_chunk_size" json:"prefetch_chunk_size" `
117
117
118
118
// MaxRetries is a max number of reries of a HTTP request. Default is 5.
119
- MaxRetries int `toml:"max_retries"`
119
+ MaxRetries int `toml:"max_retries" json:"max_retries" `
120
120
121
121
// MinWaitMSec is minimal delay (in seconds) for the next retrying after a request failure. Default is 30.
122
- MinWaitMSec int `toml:"min_wait_msec"`
122
+ MinWaitMSec int `toml:"min_wait_msec" json:"min_wait_msec" `
123
123
124
124
// MinWaitMSec is maximum delay (in seconds) for the next retrying after a request failure. Default is 30.
125
- MaxWaitMSec int `toml:"max_wait_msec"`
125
+ MaxWaitMSec int `toml:"max_wait_msec" json:"max_wait_msec" `
126
126
}
127
127
128
128
// DirectoryCacheConfig is configuration for the disk-based cache.
129
129
type DirectoryCacheConfig struct {
130
130
// MaxLRUCacheEntry is the number of entries of LRU cache to cache data on memory. Default is 10.
131
- MaxLRUCacheEntry int `toml:"max_lru_cache_entry"`
131
+ MaxLRUCacheEntry int `toml:"max_lru_cache_entry" json:"max_lru_cache_entry" `
132
132
133
133
// MaxCacheFds is the number of entries of LRU cache to hold fds of files of cached contents. Default is 10.
134
- MaxCacheFds int `toml:"max_cache_fds"`
134
+ MaxCacheFds int `toml:"max_cache_fds" json:"max_cache_fds" `
135
135
136
136
// SyncAdd being true means that each adding of data to the cache blocks until the data is fully written to the
137
137
// cache directory. Default is false.
138
- SyncAdd bool `toml:"sync_add"`
138
+ SyncAdd bool `toml:"sync_add" json:"sync_add" `
139
139
140
140
// Direct disables on-memory data cache. Default is true for saving memory usage.
141
- Direct bool `toml:"direct" default:"true"`
141
+ Direct bool `toml:"direct" default:"true" json:"direct" `
142
142
}
143
143
144
144
// FuseConfig is configuration for FUSE fs.
145
145
type FuseConfig struct {
146
146
// AttrTimeout defines overall timeout attribute for a file system in seconds.
147
- AttrTimeout int64 `toml:"attr_timeout"`
147
+ AttrTimeout int64 `toml:"attr_timeout" json:"attr_timeout" `
148
148
149
149
// EntryTimeout defines TTL for directory, name lookup in seconds.
150
- EntryTimeout int64 `toml:"entry_timeout"`
150
+ EntryTimeout int64 `toml:"entry_timeout" json:"entry_timeout" `
151
151
152
152
// PassThrough indicates whether to enable FUSE passthrough mode to improve local file read performance. Default is false.
153
- PassThrough bool `toml:"passthrough" default:"false"`
153
+ PassThrough bool `toml:"passthrough" default:"false" json:"passthrough" `
154
154
}
0 commit comments