You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(guest-agent): answer 501, not 400, when the image cannot attest a GPU
`AttestGpu` reported "GPU attestation is not available in this image" as an
uncoded error, which `dispatch_prpc` turns into the generic 400. That tells a
client its request was malformed. It was not: the request is well-formed, and
no other request would succeed either, because the image ships no nvattest and
will not grow one at runtime. A client branching on the status retries with
different arguments forever instead of falling back.
`ra_rpc::ErrorExt::with_code` already carries a chosen status through the
transport, and `code_of` walks the whole error chain, so the code survives the
handler's `.context("GPU attestation failed")`. 501 rather than 503 because the
capability is absent for the lifetime of the CVM, not temporarily unavailable.
A malformed nonce keeps the default 400 -- that one really is the caller's
fault, and the two failures must not be indistinguishable.
Safe to change now: `AttestGpu` is v1-only and never shipped in a release, so
no deployed client is reading the old 400. `rpc_service_v1.rs` already asserts
it is absent from both frozen surfaces.
The availability probe moves from `nvattest::available()` to a `GpuAttestor`
field holding the binary's path. Without that, a test for the unavailable
answer would pass only on a host with no nvattest installed and would spawn a
real collection against the host's GPUs anywhere else. The test fixture pins it
to a path that cannot exist, so every guest-agent test sees the same answer.
Documented in the proto comment, the spec's Errors and Status codes sections,
and the curl API reference, which listed only 400 and 500.
0 commit comments