@@ -175,6 +175,7 @@ impl DataStore {
175
175
let service_db = db:: model:: Service :: new (
176
176
service. service_id ,
177
177
service. sled_id ,
178
+ service. zone_id ,
178
179
service. address ,
179
180
service. kind . into ( ) ,
180
181
) ;
@@ -624,9 +625,11 @@ mod test {
624
625
let sled = create_test_sled ( & datastore) . await ;
625
626
626
627
let nexus_ip = IpAddr :: V4 ( Ipv4Addr :: new ( 1 , 2 , 3 , 4 ) ) ;
628
+ let nexus_id = Uuid :: new_v4 ( ) ;
627
629
let services = vec ! [ internal_params:: ServicePutRequest {
628
- service_id: Uuid :: new_v4 ( ) ,
630
+ service_id: nexus_id ,
629
631
sled_id: sled. id( ) ,
632
+ zone_id: Some ( nexus_id) ,
630
633
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 123 , 0 , 0 ) ,
631
634
kind: internal_params:: ServiceKind :: Nexus {
632
635
external_address: nexus_ip,
@@ -718,18 +721,22 @@ mod test {
718
721
// Ask for two Nexus services, with different external IPs.
719
722
let nexus_ip_start = Ipv4Addr :: new ( 1 , 2 , 3 , 4 ) ;
720
723
let nexus_ip_end = Ipv4Addr :: new ( 1 , 2 , 3 , 5 ) ;
724
+ let nexus_id1 = Uuid :: new_v4 ( ) ;
725
+ let nexus_id2 = Uuid :: new_v4 ( ) ;
721
726
let mut services = vec ! [
722
727
internal_params:: ServicePutRequest {
723
- service_id: Uuid :: new_v4 ( ) ,
728
+ service_id: nexus_id1 ,
724
729
sled_id: sled. id( ) ,
730
+ zone_id: Some ( nexus_id1) ,
725
731
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 123 , 0 , 0 ) ,
726
732
kind: internal_params:: ServiceKind :: Nexus {
727
733
external_address: IpAddr :: V4 ( nexus_ip_start) ,
728
734
} ,
729
735
} ,
730
736
internal_params:: ServicePutRequest {
731
- service_id: Uuid :: new_v4 ( ) ,
737
+ service_id: nexus_id2 ,
732
738
sled_id: sled. id( ) ,
739
+ zone_id: Some ( nexus_id2) ,
733
740
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 456 , 0 , 0 ) ,
734
741
kind: internal_params:: ServiceKind :: Nexus {
735
742
external_address: IpAddr :: V4 ( nexus_ip_end) ,
@@ -904,9 +911,11 @@ mod test {
904
911
let sled = create_test_sled ( & datastore) . await ;
905
912
906
913
let nexus_ip = IpAddr :: V4 ( Ipv4Addr :: new ( 1 , 2 , 3 , 4 ) ) ;
914
+ let nexus_id = Uuid :: new_v4 ( ) ;
907
915
let services = vec ! [ internal_params:: ServicePutRequest {
908
- service_id: Uuid :: new_v4 ( ) ,
916
+ service_id: nexus_id ,
909
917
sled_id: sled. id( ) ,
918
+ zone_id: Some ( nexus_id) ,
910
919
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 123 , 0 , 0 ) ,
911
920
kind: internal_params:: ServiceKind :: Nexus {
912
921
external_address: nexus_ip,
@@ -957,19 +966,23 @@ mod test {
957
966
958
967
// Request two services which happen to be using the same IP address.
959
968
let nexus_ip = IpAddr :: V4 ( Ipv4Addr :: new ( 1 , 2 , 3 , 4 ) ) ;
969
+ let nexus_id1 = Uuid :: new_v4 ( ) ;
970
+ let nexus_id2 = Uuid :: new_v4 ( ) ;
960
971
961
972
let services = vec ! [
962
973
internal_params:: ServicePutRequest {
963
- service_id: Uuid :: new_v4 ( ) ,
974
+ service_id: nexus_id1 ,
964
975
sled_id: sled. id( ) ,
976
+ zone_id: Some ( nexus_id1) ,
965
977
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 123 , 0 , 0 ) ,
966
978
kind: internal_params:: ServiceKind :: Nexus {
967
979
external_address: nexus_ip,
968
980
} ,
969
981
} ,
970
982
internal_params:: ServicePutRequest {
971
- service_id: Uuid :: new_v4 ( ) ,
983
+ service_id: nexus_id2 ,
972
984
sled_id: sled. id( ) ,
985
+ zone_id: Some ( nexus_id2) ,
973
986
address: SocketAddrV6 :: new( Ipv6Addr :: LOCALHOST , 123 , 0 , 0 ) ,
974
987
kind: internal_params:: ServiceKind :: Nexus {
975
988
external_address: nexus_ip,
0 commit comments