Merge pull request #8198 from kiashok/argsEscapedSupportInCri

Add ArgsEscaped support for CRI
This commit is contained in:
Fu Wei
2023-03-07 16:12:24 +08:00
committed by GitHub
11 changed files with 363 additions and 20 deletions

View File

@@ -35,6 +35,16 @@ func escapeAndCombineArgs(args []string) string {
return strings.Join(escaped, " ")
}
// WithProcessCommandLine replaces the command line on the generated spec
func WithProcessCommandLine(cmdLine string) SpecOpts {
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
setProcess(s)
s.Process.Args = nil
s.Process.CommandLine = cmdLine
return nil
}
}
// WithHostDevices adds all the hosts device nodes to the container's spec
//
// Not supported on windows