Merge pull request #1521 from jodh-intel/verify-cid

Verify container ID
This commit is contained in:
James O. D. Hunt
2021-03-24 13:27:58 +00:00
committed by GitHub
8 changed files with 435 additions and 2 deletions

View File

@@ -87,9 +87,11 @@ var kataExecCLICommand = cli.Command{
span.SetAttributes(label.Key("port").Uint64(port))
sandboxID := context.Args().Get(0)
if sandboxID == "" {
return fmt.Errorf("SandboxID not found")
if err := katautils.VerifyContainerID(sandboxID); err != nil {
return err
}
span.SetAttributes(label.Key("sandbox").String(sandboxID))
conn, err := getConn(namespace, sandboxID, port)