Returns true when `sandbox` opted into the extension identified by `key` via a policy-stamped `{SANDBOX_EXTENSION_LABEL_PREFIX}{key}` template label set to an enabled value.
(sandbox: &Sandbox, key: &str)
| 659 | /// `key` via a policy-stamped `{SANDBOX_EXTENSION_LABEL_PREFIX}{key}` |
| 660 | /// template label set to an enabled value. |
| 661 | fn sandbox_requested_extension(sandbox: &Sandbox, key: &str) -> bool { |
| 662 | let label_key = format!("{SANDBOX_EXTENSION_LABEL_PREFIX}{key}"); |
| 663 | sandbox |
| 664 | .spec |
| 665 | .as_ref() |
| 666 | .and_then(|spec| spec.template.as_ref()) |
| 667 | .and_then(|template| template.labels.get(&label_key)) |
| 668 | .is_some_and(|value| extension_label_enabled(value)) |
| 669 | } |
| 670 | |
| 671 | /// Interpret an extension request-label value. Accepts the explicit |
| 672 | /// `enabled`/`requested` spellings as well as the common bool-like values |
no test coverage detected