Skip to content

Commit 0267aa7

Browse files
committed
fix(ingress): complete SDK and example compatibility checks
Use generated defaults for the legacy example validation response, document public ingress constants, and use the generated enum value in the Python fixture. Preserve legacy admission absence and the existing assertions. Refs NVIDIA#5110 Signed-off-by: Shiju <[email protected]>
1 parent db2e5ab commit 0267aa7

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎examples/isolation-backend-v8/src/driver.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ impl compute_driver_server::ComputeDriver for DriverService {
384384
.as_ref()
385385
.ok_or_else(|| Status::invalid_argument("sandbox required"))?,
386386
)?;
387-
Ok(Response::new(ValidateSandboxCreateResponse {}))
387+
Ok(Response::new(ValidateSandboxCreateResponse::default()))
388388
}
389389
async fn create_sandbox(
390390
&self,

‎python/openshell/sandbox_test.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from google.protobuf.struct_pb2 import Struct
1919

2020
import openshell.sandbox as sandbox_module
21-
from openshell._proto import openshell_pb2
21+
from openshell._proto import openshell_pb2, sandbox_pb2
2222
from openshell.mutations import DeletionOutcome
2323
from openshell.sandbox import (
2424
_OIDC_TOKEN_EXPIRY_GRACE_SECONDS,
@@ -2818,10 +2818,16 @@ def test_sandbox_ref_exposes_host_identity_and_accepts_legacy_response() -> None
28182818
proto.host_key_fingerprint = "SHA256:expected"
28192819
assert _sandbox_ref(proto).host_key_fingerprint == "SHA256:expected"
28202820
assert _sandbox_ref(proto).status.ingress_admission is None
2821-
proto.status.ingress_admission.scope = 3
2821+
proto.status.ingress_admission.scope = (
2822+
sandbox_pb2.INGRESS_SCOPE_SHARED_HOST_LOOPBACK
2823+
)
28222824
proto.status.ingress_admission.ports.append(8080)
28232825
admission = _sandbox_ref(proto).status.ingress_admission
2824-
assert admission is not None and admission.ports == (8080,) and admission.scope == 3
2826+
assert (
2827+
admission is not None
2828+
and admission.ports == (8080,)
2829+
and admission.scope == sandbox_pb2.INGRESS_SCOPE_SHARED_HOST_LOOPBACK
2830+
)
28252831
proto.status.ingress_admission.ports[0] = 9090
28262832
assert admission.ports == (8080,)
28272833

‎sdk/go/openshell/v1/types.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type SandboxIngressAdmission = types.SandboxIngressAdmission
6464
// IngressScope identifies the admitted loopback namespace.
6565
type IngressScope = types.IngressScope
6666

67+
// IngressScope values identify the admitted loopback namespace.
6768
const (
6869
IngressUnknown = types.IngressUnknown
6970
IngressUnsupported = types.IngressUnsupported

‎sdk/go/openshell/v1/types/sandbox.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ type DetachProviderResult struct {
281281
// IngressScope describes the network namespace of admitted service targets.
282282
type IngressScope string
283283

284+
// IngressScope values identify the admitted loopback namespace.
284285
const (
285286
IngressUnknown IngressScope = "unknown"
286287
IngressUnsupported IngressScope = "unsupported"

0 commit comments

Comments
 (0)