Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions crates/openshell-gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ pub fn install_default_compute_drivers() -> ComputeDriverRegistry {
fn install_mxc_compute_driver(registry: &mut ComputeDriverRegistry) {
let registration = ComputeDriverRegistration::new("mxc", u16::MAX, None, MxcFactory)
.expect("first-party driver name is valid")
.with_telemetry_category(TelemetryComputeDriver::anonymous_category("mxc"))
.with_local_singleplayer();
.with_telemetry_category(TelemetryComputeDriver::anonymous_category("mxc"));
registry
.install(registration)
.expect("first-party driver names are unique");
Expand Down Expand Up @@ -204,7 +203,6 @@ fn install_in_tree_compute_drivers(registry: &mut ComputeDriverRegistry) {
.map(|registration| {
registration
.with_telemetry_category(TelemetryComputeDriver::anonymous_category("podman"))
.with_local_singleplayer()
.with_in_process_tracing(openshell_driver_podman::otel_tracing::TRACING)
}),
#[cfg(feature = "compute-driver-docker")]
Expand All @@ -217,14 +215,11 @@ fn install_in_tree_compute_drivers(registry: &mut ComputeDriverRegistry) {
.map(|registration| {
registration
.with_telemetry_category(TelemetryComputeDriver::anonymous_category("docker"))
.with_local_singleplayer()
.with_in_process_tracing(openshell_driver_docker::otel_tracing::TRACING)
}),
#[cfg(feature = "compute-driver-vm")]
ComputeDriverRegistration::new("vm", u16::MAX, None, VmFactory).map(|registration| {
registration
.with_telemetry_category(TelemetryComputeDriver::anonymous_category("vm"))
.with_local_singleplayer()
registration.with_telemetry_category(TelemetryComputeDriver::anonymous_category("vm"))
}),
] {
registry
Expand Down
38 changes: 14 additions & 24 deletions crates/openshell-server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1757,11 +1757,7 @@ mod tests {
.build()
.unwrap();
let error = runtime
.block_on(super::run_from_args(
args,
matches,
test_registry("test", true),
))
.block_on(super::run_from_args(args, matches, test_registry("test")))
.unwrap_err()
.to_string();
for expected in [
Expand Down Expand Up @@ -1917,12 +1913,9 @@ mod tests {
}
}

fn test_registry(name: &str, singleplayer: bool) -> crate::ComputeDriverRegistry {
let mut registration =
fn test_registry(name: &str) -> crate::ComputeDriverRegistry {
let registration =
crate::ComputeDriverRegistration::new(name, 100, None, TestFactory).unwrap();
if singleplayer {
registration = registration.with_local_singleplayer();
}
let mut registry = crate::ComputeDriverRegistry::new();
registry.install(registration).unwrap();
registry
Expand All @@ -1935,8 +1928,7 @@ mod tests {
Some(detect_registered_local),
TestFactory,
)
.unwrap()
.with_local_singleplayer();
.unwrap();
let mut registry = crate::ComputeDriverRegistry::new();
registry.install(registration).unwrap();
registry
Expand Down Expand Up @@ -2196,7 +2188,7 @@ mod tests {
"sqlite::memory:",
"--disable-tls",
]);
let registry = test_registry("podman", true);
let registry = test_registry("podman");

let prepared =
super::prepare_server_config_with_drivers(&mut args, &matches, &registry)
Expand Down Expand Up @@ -2506,7 +2498,7 @@ mod tests {
"#,
)
.unwrap();
let registry = test_registry("local", true);
let registry = test_registry("local");
let preflight = |argv: &[&str]| {
let (run, matches) = parse_with_args(argv);
super::run_config_preflight_with_drivers(
Expand Down Expand Up @@ -2561,7 +2553,7 @@ mod tests {
.set("OPENSHELL_DRIVERS", "podman,docker")
.run(|| {
let (run, matches) = parse_with_args(&["openshell-gateway"]);
let registry = test_registry("podman", true);
let registry = test_registry("podman");

let error = super::run_config_preflight_with_drivers(
super::ConfigPreflightArgs::default(),
Expand Down Expand Up @@ -2648,7 +2640,7 @@ mod tests {
.remove("OPENSHELL_COMPUTE_DRIVER")
.remove("OPENSHELL_DRIVERS")
.run(|| {
preflight(&test_registry("local", false))
preflight(&test_registry("local"))
.expect_err("a pool table without a shared supervision driver must fail");

let mut registry = crate::ComputeDriverRegistry::new();
Expand Down Expand Up @@ -2845,7 +2837,7 @@ mod tests {
"--enable-mtls-auth",
"true",
]);
let registry = test_registry("shared", false);
let registry = test_registry("shared");

super::run_config_preflight_with_drivers(
super::ConfigPreflightArgs::default(),
Expand Down Expand Up @@ -3466,7 +3458,7 @@ require_client_auth = true
"--metrics-tls-key",
"/metrics/tls.key",
]);
let registry = test_registry("podman", true);
let registry = test_registry("podman");

let Err(error) =
super::prepare_server_config_with_drivers(&mut args, &matches, &registry)
Expand Down Expand Up @@ -3664,7 +3656,7 @@ require_client_auth = true
.remove("OPENSHELL_GATEWAY_CONFIG")
.remove("OPENSHELL_DRIVERS")
.run(|| {
let registry = test_registry("shared", false);
let registry = test_registry("shared");

for (oidc_issuer, expected) in
[(None, false), (Some("https://idp.example.com"), false)]
Expand Down Expand Up @@ -3790,8 +3782,7 @@ require_client_auth = true
Some(detect_registered_local),
TestFactory,
)
.unwrap()
.with_local_singleplayer(),
.unwrap(),
)
.unwrap();
let (preflight_args, preflight_matches) = parse_with_args(&argv);
Expand Down Expand Up @@ -3831,8 +3822,7 @@ require_client_auth = true
Some(detect_registered_local),
TestFactory,
)
.unwrap()
.with_local_singleplayer(),
.unwrap(),
)
.unwrap();

Expand Down Expand Up @@ -4088,7 +4078,7 @@ enabled = false
.remove("OPENSHELL_DRIVERS")
.remove("OPENSHELL_ENABLE_OPERATOR_AUTH")
.run(|| {
let registry = test_registry("shared", false);
let registry = test_registry("shared");
for tls_args in [vec!["--disable-tls"], vec![]] {
let mut argv = vec![
"openshell-gateway",
Expand Down
20 changes: 0 additions & 20 deletions crates/openshell-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1873,19 +1873,6 @@ impl ComputeDriverRegistration {
})
}

/// Compatibility no-op retained for source compatibility with schema-v1
/// factory registrations. Schema v2 never inherits gateway keys into a
/// driver table; move every driver setting under
/// `[openshell.drivers.<name>]`.
#[deprecated(
since = "0.0.0",
note = "schema v2 does not inherit gateway keys into driver configuration"
)]
#[must_use]
pub fn with_inherited_config_keys(self, _keys: &'static [&'static str]) -> Self {
self
}

/// Assign a bounded telemetry category chosen by the binary composition
/// boundary. Runtime driver names are never used as telemetry values.
#[must_use]
Expand All @@ -1894,13 +1881,6 @@ impl ComputeDriverRegistration {
self
}

/// Compatibility no-op retained for existing factory registrations.
/// Gateway mTLS user authentication is independent of compute drivers.
#[must_use]
pub fn with_local_singleplayer(self) -> Self {
self
}

/// Attach process-wide tracing for this in-process compiled driver.
#[must_use]
pub fn with_in_process_tracing(
Expand Down
Loading