File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,15 +406,23 @@ impl nexus_test_interface::NexusServer for Server {
406406 // completely uninterested in switch port interaction), we'll insert a
407407 // single qsfp0 for each switch to the db directly.
408408 for which_switch in SwitchSlot :: iter ( ) {
409- datastore
409+ match datastore
410410 . switch_port_create (
411411 & opctx,
412412 config. deployment . rack_id ,
413413 which_switch,
414414 nexus_db_model:: Name ( "qsfp0" . parse ( ) . unwrap ( ) ) ,
415415 )
416416 . await
417- . expect ( "inserted qsfp0" ) ;
417+ {
418+ // We're racing with the background task - it may have already
419+ // contacted dpd and inserted qsfp0. That's fine.
420+ Ok ( _) | Err ( Error :: ObjectAlreadyExists { .. } ) => ( ) ,
421+ Err ( err) => panic ! (
422+ "failed to insert qsfp0 for {which_switch:?}: {}" ,
423+ InlineErrorChain :: new( & err)
424+ ) ,
425+ }
418426 }
419427
420428 // Allocation of initial external IP addresses is a little funny. In
You can’t perform that action at this time.
0 commit comments