| 491 | } |
| 492 | |
| 493 | fn validate_sandbox_template_base(template: &DriverSandboxTemplate) -> Result<(), Status> { |
| 494 | if template.image.trim().is_empty() { |
| 495 | return Err(Status::failed_precondition( |
| 496 | "docker sandboxes require a template image", |
| 497 | )); |
| 498 | } |
| 499 | if !template.agent_socket_path.trim().is_empty() { |
| 500 | return Err(Status::failed_precondition( |
| 501 | "docker compute driver does not support template.agent_socket_path", |
| 502 | )); |
| 503 | } |
| 504 | if template |
| 505 | .platform_config |
| 506 | .as_ref() |
| 507 | .is_some_and(|config| !config.fields.is_empty()) |
| 508 | { |
| 509 | return Err(Status::failed_precondition( |
| 510 | "docker compute driver does not support template.platform_config", |
| 511 | )); |
| 512 | } |
| 513 | |
| 514 | Ok(()) |
| 515 | } |
| 516 | |
| 517 | fn validate_sandbox_auth(sandbox: &DriverSandbox) -> Result<(), Status> { |
| 518 | let token_present = sandbox |