diff --git a/crates/openshell-driver-kubernetes/src/driver.rs b/crates/openshell-driver-kubernetes/src/driver.rs index 1e790bf348..979687fed4 100644 --- a/crates/openshell-driver-kubernetes/src/driver.rs +++ b/crates/openshell-driver-kubernetes/src/driver.rs @@ -3851,12 +3851,9 @@ fn sandbox_template_to_k8s_with_validated_config( apply_pod_driver_config(&mut spec, &driver_config.pod); // Per-sandbox portable intent overrides the cluster-wide default. This - // driver owns the Kubernetes-specific `hostUsers` translation. Accept the - // former platform_config encoding during rolling upgrades from gateways - // that predate the typed field. + // driver owns the Kubernetes-specific `hostUsers` translation. let use_user_namespaces = template .user_namespaces - .or_else(|| platform_config_bool(template, "host_users").map(|host_users| !host_users)) .unwrap_or(params.enable_user_namespaces); if use_user_namespaces { @@ -4469,15 +4466,6 @@ fn platform_config_string(template: &SandboxTemplate, key: &str) -> Option Option { - let config = template.platform_config.as_ref()?; - let value = config.fields.get(key)?; - match value.kind.as_ref() { - Some(prost_types::value::Kind::BoolValue(value)) => Some(*value), - _ => None, - } -} - /// Extract a nested Struct value from the template's `platform_config`, /// converting it to `serde_json::Value`. fn platform_config_struct(template: &SandboxTemplate, key: &str) -> Option { @@ -7728,7 +7716,7 @@ mod tests { } #[test] - fn user_namespaces_accepts_legacy_host_users_encoding() { + fn user_namespaces_ignores_legacy_host_users_encoding() { let template = SandboxTemplate { platform_config: Some(Struct { fields: std::iter::once(( @@ -7751,10 +7739,9 @@ mod tests { ¶ms, ); - assert_eq!( - pod_template["spec"]["hostUsers"], - serde_json::json!(false), - "legacy host_users: false must still enable user namespaces" + assert!( + pod_template["spec"]["hostUsers"].is_null(), + "legacy host_users must not enable user namespaces" ); }