(req *runtimeapi.ExecRequest)
| 163 | } |
| 164 | |
| 165 | func validateExecRequest(req *runtimeapi.ExecRequest) error { |
| 166 | if req.ContainerId == "" { |
| 167 | return status.Errorf(codes.InvalidArgument, "missing required container_id") |
| 168 | } |
| 169 | if req.Tty && req.Stderr { |
| 170 | // If TTY is set, stderr cannot be true because multiplexing is not |
| 171 | // supported. |
| 172 | return status.Errorf(codes.InvalidArgument, "tty and stderr cannot both be true") |
| 173 | } |
| 174 | if !req.Stdin && !req.Stdout && !req.Stderr { |
| 175 | return status.Errorf(codes.InvalidArgument, "one of stdin, stdout, or stderr must be set") |
| 176 | } |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | func (s *server) GetExec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) { |
| 181 | if err := validateExecRequest(req); err != nil { |
no outgoing calls
searching dependent graphs…