diff --git a/docs/cri/config.md b/docs/cri/config.md index 67c25d114..19a0276f1 100644 --- a/docs/cri/config.md +++ b/docs/cri/config.md @@ -227,6 +227,16 @@ version = 2 # https://github.com/container-orchestrated-devices/container-device-interface#containerd-configuration cdi_spec_dirs = ["/etc/cdi", "/var/run/cdi"] + # drain_exec_sync_io_timeout is the maximum duration to wait for ExecSync API' + # IO EOF event after exec init process exits. A zero value means there is no + # timeout. + # + # The string is in the golang duration format, see: + # https://golang.org/pkg/time/#ParseDuration + # + # For example, the value can be '5h', '2h30m', '10s'. + drain_exec_sync_io_timeout = "0s" + # 'plugins."io.containerd.grpc.v1.cri".containerd' contains config related to containerd [plugins."io.containerd.grpc.v1.cri".containerd] diff --git a/pkg/cri/config/config.go b/pkg/cri/config/config.go index 33f81958c..7f0403c30 100644 --- a/pkg/cri/config/config.go +++ b/pkg/cri/config/config.go @@ -357,6 +357,8 @@ type PluginConfig struct { // // The string is in the golang duration format, see: // https://golang.org/pkg/time/#ParseDuration + // + // For example, the value can be '5h', '2h30m', '10s'. DrainExecSyncIOTimeout string `toml:"drain_exec_sync_io_timeout" json:"drainExecSyncIOTimeout"` } diff --git a/pkg/cri/config/config_unix.go b/pkg/cri/config/config_unix.go index c131ce865..72348ca3f 100644 --- a/pkg/cri/config/config_unix.go +++ b/pkg/cri/config/config_unix.go @@ -110,6 +110,6 @@ func DefaultConfig() PluginConfig { EnableCDI: false, CDISpecDirs: []string{"/etc/cdi", "/var/run/cdi"}, ImagePullProgressTimeout: time.Minute.String(), - DrainExecSyncIOTimeout: "0", + DrainExecSyncIOTimeout: "0s", } } diff --git a/pkg/cri/config/config_windows.go b/pkg/cri/config/config_windows.go index 19fd020b7..63bb2decd 100644 --- a/pkg/cri/config/config_windows.go +++ b/pkg/cri/config/config_windows.go @@ -86,6 +86,6 @@ func DefaultConfig() PluginConfig { KeyModel: KeyModelNode, }, ImagePullProgressTimeout: time.Minute.String(), - DrainExecSyncIOTimeout: "0", + DrainExecSyncIOTimeout: "0s", } }