@@ -235,9 +235,6 @@ fn resolve_container_edits(
235235 selected_devices : & [ String ] ,
236236) -> Result < CdiContainerEdits , CdiError > {
237237 let ( mut cache, refresh_error) = build_cache ( & context. spec_dirs ) ;
238- if let Some ( device) = conflicting_selected_device ( refresh_error. as_deref ( ) , selected_devices) {
239- return Err ( CdiError :: DuplicateDevice ( device) ) ;
240- }
241238 let mut merged = UpstreamContainerEdits :: new ( ) ;
242239 let mut applied_specs = BTreeSet :: new ( ) ;
243240
@@ -271,21 +268,6 @@ fn resolve_container_edits(
271268 serde_json:: from_value ( value) . map_err ( |source| CdiError :: EditDecode { source } )
272269}
273270
274- // Temporary compatibility check for the Rust CDI cache revision pinned by
275- // OpenShell. That revision records same-priority device conflicts but leaves
276- // the conflicted device resolvable. Remove this once OpenShell uses the
277- // upstream fix that excludes conflicts from the cache's device map.
278- fn conflicting_selected_device (
279- refresh_error : Option < & str > ,
280- selected_devices : & [ String ] ,
281- ) -> Option < String > {
282- let refresh_error = refresh_error?;
283- selected_devices
284- . iter ( )
285- . find ( |device| refresh_error. contains ( & format ! ( "conflicting device {device} (specs " ) ) )
286- . cloned ( )
287- }
288-
289271fn missing_device_error ( device : & str , refresh_error : Option < & str > ) -> CdiError {
290272 refresh_error. map_or_else (
291273 || CdiError :: MissingDevice ( device. to_string ( ) ) ,
@@ -730,7 +712,11 @@ devices:
730712 )
731713 . unwrap_err ( ) ;
732714
733- assert ! ( matches!( err, CdiError :: DuplicateDevice ( device) if device == "nvidia.com/gpu=0" ) ) ;
715+ assert ! (
716+ matches!( err, CdiError :: MissingDeviceAfterRefresh { device, refresh_error }
717+ if device == "nvidia.com/gpu=0"
718+ && refresh_error. contains( "conflicting device nvidia.com/gpu=0" ) )
719+ ) ;
734720 }
735721
736722 #[ test]
0 commit comments