@@ -116,25 +116,13 @@ type Runtime struct {
116
116
117
117
// ContainerdConfig contains toml config related to containerd
118
118
type ContainerdConfig struct {
119
- // Snapshotter is the snapshotter used by containerd.
120
- Snapshotter string `toml:"snapshotter" json:"snapshotter"`
121
119
// DefaultRuntimeName is the default runtime name to use from the runtimes table.
122
120
DefaultRuntimeName string `toml:"default_runtime_name" json:"defaultRuntimeName"`
123
121
124
122
// Runtimes is a map from CRI RuntimeHandler strings, which specify types of runtime
125
123
// configurations, to the matching configurations.
126
124
Runtimes map [string ]Runtime `toml:"runtimes" json:"runtimes"`
127
125
128
- // DisableSnapshotAnnotations disables to pass additional annotations (image
129
- // related information) to snapshotters. These annotations are required by
130
- // stargz snapshotter (https://github.com/containerd/stargz-snapshotter).
131
- DisableSnapshotAnnotations bool `toml:"disable_snapshot_annotations" json:"disableSnapshotAnnotations"`
132
-
133
- // DiscardUnpackedLayers is a boolean flag to specify whether to allow GC to
134
- // remove layers from the content store after successfully unpacking these
135
- // layers to the snapshotter.
136
- DiscardUnpackedLayers bool `toml:"discard_unpacked_layers" json:"discardUnpackedLayers"`
137
-
138
126
// IgnoreBlockIONotEnabledErrors is a boolean flag to ignore
139
127
// blockio related errors when blockio support has not been
140
128
// enabled.
@@ -249,17 +237,57 @@ type ImageDecryption struct {
249
237
KeyModel string `toml:"key_model" json:"keyModel"`
250
238
}
251
239
240
+ type ImageConfig struct {
241
+ // Snapshotter is the snapshotter used by containerd.
242
+ Snapshotter string `toml:"snapshotter" json:"snapshotter"`
243
+
244
+ // DisableSnapshotAnnotations disables to pass additional annotations (image
245
+ // related information) to snapshotters. These annotations are required by
246
+ // stargz snapshotter (https://github.com/containerd/stargz-snapshotter).
247
+ DisableSnapshotAnnotations bool `toml:"disable_snapshot_annotations" json:"disableSnapshotAnnotations"`
248
+
249
+ // DiscardUnpackedLayers is a boolean flag to specify whether to allow GC to
250
+ // remove layers from the content store after successfully unpacking these
251
+ // layers to the snapshotter.
252
+ DiscardUnpackedLayers bool `toml:"discard_unpacked_layers" json:"discardUnpackedLayers"`
253
+
254
+ // Registry contains config related to the registry
255
+ Registry Registry `toml:"registry" json:"registry"`
256
+
257
+ // ImageDecryption contains config related to handling decryption of encrypted container images
258
+ ImageDecryption `toml:"image_decryption" json:"imageDecryption"`
259
+
260
+ // MaxConcurrentDownloads restricts the number of concurrent downloads for each image.
261
+ // TODO: Migrate to transfer service
262
+ MaxConcurrentDownloads int `toml:"max_concurrent_downloads" json:"maxConcurrentDownloads"`
263
+
264
+ // ImagePullProgressTimeout is the maximum duration that there is no
265
+ // image data read from image registry in the open connection. It will
266
+ // be reset whatever a new byte has been read. If timeout, the image
267
+ // pulling will be cancelled. A zero value means there is no timeout.
268
+ //
269
+ // The string is in the golang duration format, see:
270
+ // https://golang.org/pkg/time/#ParseDuration
271
+ ImagePullProgressTimeout string `toml:"image_pull_progress_timeout" json:"imagePullProgressTimeout"`
272
+
273
+ // ImagePullWithSyncFs is an experimental setting. It's to force sync
274
+ // filesystem during unpacking to ensure that data integrity.
275
+ // TODO: Migrate to transfer service
276
+ ImagePullWithSyncFs bool `toml:"image_pull_with_sync_fs" json:"imagePullWithSyncFs"`
277
+
278
+ // StatsCollectPeriod is the period (in seconds) of snapshots stats collection.
279
+ StatsCollectPeriod int `toml:"stats_collect_period" json:"statsCollectPeriod"`
280
+ }
281
+
252
282
// PluginConfig contains toml config related to CRI plugin,
253
283
// it is a subset of Config.
254
284
type PluginConfig struct {
285
+ // ImageConfig is the image service configuration
286
+ ImageConfig
255
287
// ContainerdConfig contains config related to containerd
256
288
ContainerdConfig `toml:"containerd" json:"containerd"`
257
289
// CniConfig contains config related to cni
258
290
CniConfig `toml:"cni" json:"cni"`
259
- // Registry contains config related to the registry
260
- Registry Registry `toml:"registry" json:"registry"`
261
- // ImageDecryption contains config related to handling decryption of encrypted container images
262
- ImageDecryption `toml:"image_decryption" json:"imageDecryption"`
263
291
// DisableTCPService disables serving CRI on the TCP server.
264
292
DisableTCPService bool `toml:"disable_tcp_service" json:"disableTCPService"`
265
293
// StreamServerAddress is the ip address streaming server is listening on.
@@ -278,8 +306,6 @@ type PluginConfig struct {
278
306
SelinuxCategoryRange int `toml:"selinux_category_range" json:"selinuxCategoryRange"`
279
307
// SandboxImage is the image used by sandbox container.
280
308
SandboxImage string `toml:"sandbox_image" json:"sandboxImage"`
281
- // StatsCollectPeriod is the period (in seconds) of snapshots stats collection.
282
- StatsCollectPeriod int `toml:"stats_collect_period" json:"statsCollectPeriod"`
283
309
// EnableTLSStreaming indicates to enable the TLS streaming support.
284
310
EnableTLSStreaming bool `toml:"enable_tls_streaming" json:"enableTLSStreaming"`
285
311
// X509KeyPairStreaming is a x509 key pair used for TLS streaming
@@ -298,8 +324,6 @@ type PluginConfig struct {
298
324
// current OOMScoreADj.
299
325
// This is useful when the containerd does not have permission to decrease OOMScoreAdj.
300
326
RestrictOOMScoreAdj bool `toml:"restrict_oom_score_adj" json:"restrictOOMScoreAdj"`
301
- // MaxConcurrentDownloads restricts the number of concurrent downloads for each image.
302
- MaxConcurrentDownloads int `toml:"max_concurrent_downloads" json:"maxConcurrentDownloads"`
303
327
// DisableProcMount disables Kubernetes ProcMount support. This MUST be set to `true`
304
328
// when using containerd with Kubernetes <=1.11.
305
329
DisableProcMount bool `toml:"disable_proc_mount" json:"disableProcMount"`
@@ -345,14 +369,7 @@ type PluginConfig struct {
345
369
// For more details about CDI configuration please refer to
346
370
// https://github.com/container-orchestrated-devices/container-device-interface#containerd-configuration
347
371
CDISpecDirs []string `toml:"cdi_spec_dirs" json:"cdiSpecDirs"`
348
- // ImagePullProgressTimeout is the maximum duration that there is no
349
- // image data read from image registry in the open connection. It will
350
- // be reset whatever a new byte has been read. If timeout, the image
351
- // pulling will be cancelled. A zero value means there is no timeout.
352
- //
353
- // The string is in the golang duration format, see:
354
- // https://golang.org/pkg/time/#ParseDuration
355
- ImagePullProgressTimeout string `toml:"image_pull_progress_timeout" json:"imagePullProgressTimeout"`
372
+
356
373
// DrainExecSyncIOTimeout is the maximum duration to wait for ExecSync
357
374
// API' IO EOF event after exec init process exits. A zero value means
358
375
// there is no timeout.
@@ -362,9 +379,6 @@ type PluginConfig struct {
362
379
//
363
380
// For example, the value can be '5h', '2h30m', '10s'.
364
381
DrainExecSyncIOTimeout string `toml:"drain_exec_sync_io_timeout" json:"drainExecSyncIOTimeout"`
365
- // ImagePullWithSyncFs is an experimental setting. It's to force sync
366
- // filesystem during unpacking to ensure that data integrity.
367
- ImagePullWithSyncFs bool `toml:"image_pull_with_sync_fs" json:"imagePullWithSyncFs"`
368
382
}
369
383
370
384
// X509KeyPairStreaming contains the x509 configuration for streaming
0 commit comments