Skip to content

Commit

Permalink
*: update drainExecSyncIO docs and validate the timeout
Browse files Browse the repository at this point in the history
We should validate the drainExecSyncIO timeout at the beginning and
raise the error for any invalid input.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 791f137)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
  • Loading branch information
fuweid committed Feb 16, 2024
1 parent 0438e47 commit 85bed58
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/cri/config.md
Expand Up @@ -120,6 +120,16 @@ version = 2
# Note that currently default is set to disabled but target change it in future together with enable_unprivileged_ports
enable_unprivileged_icmp = false

# 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]

Expand Down
2 changes: 2 additions & 0 deletions pkg/cri/config/config.go
Expand Up @@ -312,6 +312,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"`
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cri/config/config_unix.go
Expand Up @@ -104,6 +104,6 @@ func DefaultConfig() PluginConfig {
ImageDecryption: ImageDecryption{
KeyModel: KeyModelNode,
},
DrainExecSyncIOTimeout: "0",
DrainExecSyncIOTimeout: "0s",
}
}
2 changes: 1 addition & 1 deletion pkg/cri/config/config_windows.go
Expand Up @@ -62,6 +62,6 @@ func DefaultConfig() PluginConfig {
ImageDecryption: ImageDecryption{
KeyModel: KeyModelNode,
},
DrainExecSyncIOTimeout: "0",
DrainExecSyncIOTimeout: "0s",
}
}

0 comments on commit 85bed58

Please sign in to comment.