@@ -44,15 +44,15 @@ use nexus_db_schema::schema::{
44
44
} ;
45
45
use nexus_sled_agent_shared:: inventory:: BootImageHeader ;
46
46
use nexus_sled_agent_shared:: inventory:: BootPartitionDetails ;
47
- use nexus_sled_agent_shared:: inventory:: ClearMupdateOverrideBootSuccessInventory ;
48
- use nexus_sled_agent_shared:: inventory:: ClearMupdateOverrideInventory ;
49
47
use nexus_sled_agent_shared:: inventory:: ConfigReconcilerInventoryStatus ;
50
48
use nexus_sled_agent_shared:: inventory:: HostPhase2DesiredContents ;
51
49
use nexus_sled_agent_shared:: inventory:: HostPhase2DesiredSlots ;
52
50
use nexus_sled_agent_shared:: inventory:: MupdateOverrideBootInventory ;
53
51
use nexus_sled_agent_shared:: inventory:: MupdateOverrideInventory ;
54
52
use nexus_sled_agent_shared:: inventory:: MupdateOverrideNonBootInventory ;
55
53
use nexus_sled_agent_shared:: inventory:: OrphanedDataset ;
54
+ use nexus_sled_agent_shared:: inventory:: RemoveMupdateOverrideBootSuccessInventory ;
55
+ use nexus_sled_agent_shared:: inventory:: RemoveMupdateOverrideInventory ;
56
56
use nexus_sled_agent_shared:: inventory:: ZoneArtifactInventory ;
57
57
use nexus_sled_agent_shared:: inventory:: ZoneImageResolverInventory ;
58
58
use nexus_sled_agent_shared:: inventory:: ZoneManifestBootInventory ;
@@ -1003,7 +1003,7 @@ pub struct InvSledConfigReconciler {
1003
1003
pub boot_partition_a_error : Option < String > ,
1004
1004
pub boot_partition_b_error : Option < String > ,
1005
1005
#[ diesel( embed) ]
1006
- pub clear_mupdate_override : InvClearMupdateOverride ,
1006
+ pub remove_mupdate_override : InvRemoveMupdateOverride ,
1007
1007
}
1008
1008
1009
1009
impl InvSledConfigReconciler {
@@ -1014,7 +1014,7 @@ impl InvSledConfigReconciler {
1014
1014
boot_disk : Result < M2Slot , String > ,
1015
1015
boot_partition_a_error : Option < String > ,
1016
1016
boot_partition_b_error : Option < String > ,
1017
- clear_mupdate_override : InvClearMupdateOverride ,
1017
+ remove_mupdate_override : InvRemoveMupdateOverride ,
1018
1018
) -> Self {
1019
1019
// TODO-cleanup We should use `HwM2Slot` instead of integers for this
1020
1020
// column: https://github.com/oxidecomputer/omicron/issues/8642
@@ -1032,7 +1032,7 @@ impl InvSledConfigReconciler {
1032
1032
boot_disk_error,
1033
1033
boot_partition_a_error,
1034
1034
boot_partition_b_error,
1035
- clear_mupdate_override ,
1035
+ remove_mupdate_override ,
1036
1036
}
1037
1037
}
1038
1038
@@ -1072,48 +1072,50 @@ impl InvSledConfigReconciler {
1072
1072
}
1073
1073
}
1074
1074
1075
- // See [`nexus_sled_agent_shared::inventory::DbClearMupdateOverrideBootSuccess `].
1075
+ // See [`nexus_sled_agent_shared::inventory::DbRemoveMupdateOverrideBootSuccess `].
1076
1076
impl_enum_type ! (
1077
- ClearMupdateOverrideBootSuccessEnum :
1077
+ RemoveMupdateOverrideBootSuccessEnum :
1078
1078
1079
1079
#[ derive( Copy , Clone , Debug , AsExpression , FromSqlRow , PartialEq ) ]
1080
- pub enum DbClearMupdateOverrideBootSuccess ;
1080
+ pub enum DbRemoveMupdateOverrideBootSuccess ;
1081
1081
1082
1082
// Enum values
1083
1083
Cleared => b"cleared"
1084
1084
NoOverride => b"no-override"
1085
1085
) ;
1086
1086
1087
- impl From < ClearMupdateOverrideBootSuccessInventory >
1088
- for DbClearMupdateOverrideBootSuccess
1087
+ impl From < RemoveMupdateOverrideBootSuccessInventory >
1088
+ for DbRemoveMupdateOverrideBootSuccess
1089
1089
{
1090
- fn from ( value : ClearMupdateOverrideBootSuccessInventory ) -> Self {
1090
+ fn from ( value : RemoveMupdateOverrideBootSuccessInventory ) -> Self {
1091
1091
match value {
1092
- ClearMupdateOverrideBootSuccessInventory :: Cleared => Self :: Cleared ,
1093
- ClearMupdateOverrideBootSuccessInventory :: NoOverride => {
1092
+ RemoveMupdateOverrideBootSuccessInventory :: Removed => Self :: Cleared ,
1093
+ RemoveMupdateOverrideBootSuccessInventory :: NoOverride => {
1094
1094
Self :: NoOverride
1095
1095
}
1096
1096
}
1097
1097
}
1098
1098
}
1099
1099
1100
- impl From < DbClearMupdateOverrideBootSuccess >
1101
- for ClearMupdateOverrideBootSuccessInventory
1100
+ impl From < DbRemoveMupdateOverrideBootSuccess >
1101
+ for RemoveMupdateOverrideBootSuccessInventory
1102
1102
{
1103
- fn from ( value : DbClearMupdateOverrideBootSuccess ) -> Self {
1103
+ fn from ( value : DbRemoveMupdateOverrideBootSuccess ) -> Self {
1104
1104
match value {
1105
- DbClearMupdateOverrideBootSuccess :: Cleared => Self :: Cleared ,
1106
- DbClearMupdateOverrideBootSuccess :: NoOverride => Self :: NoOverride ,
1105
+ DbRemoveMupdateOverrideBootSuccess :: Cleared => Self :: Removed ,
1106
+ DbRemoveMupdateOverrideBootSuccess :: NoOverride => Self :: NoOverride ,
1107
1107
}
1108
1108
}
1109
1109
}
1110
1110
1111
- /// See [`nexus_sled_agent_shared::inventory::ClearMupdateOverrideInventory `].
1111
+ /// See [`nexus_sled_agent_shared::inventory::RemoveMupdateOverrideInventory `].
1112
1112
#[ derive( Queryable , Clone , Debug , Selectable , Insertable ) ]
1113
1113
#[ diesel( table_name = inv_sled_config_reconciler) ]
1114
- pub struct InvClearMupdateOverride {
1114
+ pub struct InvRemoveMupdateOverride {
1115
+ // NOTE: the column names start with "clear_" for legacy reasons. Prefer
1116
+ // "remove" in the future.
1115
1117
#[ diesel( column_name = clear_mupdate_override_boot_success) ]
1116
- pub boot_success : Option < DbClearMupdateOverrideBootSuccess > ,
1118
+ pub boot_success : Option < DbRemoveMupdateOverrideBootSuccess > ,
1117
1119
1118
1120
#[ diesel( column_name = clear_mupdate_override_boot_error) ]
1119
1121
pub boot_error : Option < String > ,
@@ -1122,38 +1124,38 @@ pub struct InvClearMupdateOverride {
1122
1124
pub non_boot_message : Option < String > ,
1123
1125
}
1124
1126
1125
- impl InvClearMupdateOverride {
1127
+ impl InvRemoveMupdateOverride {
1126
1128
pub fn new (
1127
- clear_mupdate_override : Option < & ClearMupdateOverrideInventory > ,
1129
+ remove_mupdate_override : Option < & RemoveMupdateOverrideInventory > ,
1128
1130
) -> Self {
1129
- let boot_success = clear_mupdate_override . and_then ( |inv| {
1131
+ let boot_success = remove_mupdate_override . and_then ( |inv| {
1130
1132
inv. boot_disk_result . as_ref ( ) . ok ( ) . map ( |v| v. clone ( ) . into ( ) )
1131
1133
} ) ;
1132
- let boot_error = clear_mupdate_override
1134
+ let boot_error = remove_mupdate_override
1133
1135
. and_then ( |inv| inv. boot_disk_result . as_ref ( ) . err ( ) . cloned ( ) ) ;
1134
1136
let non_boot_message =
1135
- clear_mupdate_override . map ( |inv| inv. non_boot_message . clone ( ) ) ;
1137
+ remove_mupdate_override . map ( |inv| inv. non_boot_message . clone ( ) ) ;
1136
1138
1137
1139
Self { boot_success, boot_error, non_boot_message }
1138
1140
}
1139
1141
1140
1142
pub fn into_inventory (
1141
1143
self ,
1142
- ) -> anyhow:: Result < Option < ClearMupdateOverrideInventory > > {
1144
+ ) -> anyhow:: Result < Option < RemoveMupdateOverrideInventory > > {
1143
1145
match self {
1144
1146
Self {
1145
1147
boot_success : Some ( success) ,
1146
1148
boot_error : None ,
1147
1149
non_boot_message : Some ( non_boot_message) ,
1148
- } => Ok ( Some ( ClearMupdateOverrideInventory {
1150
+ } => Ok ( Some ( RemoveMupdateOverrideInventory {
1149
1151
boot_disk_result : Ok ( success. into ( ) ) ,
1150
1152
non_boot_message,
1151
1153
} ) ) ,
1152
1154
Self {
1153
1155
boot_success : None ,
1154
1156
boot_error : Some ( boot_error) ,
1155
1157
non_boot_message : Some ( non_boot_message) ,
1156
- } => Ok ( Some ( ClearMupdateOverrideInventory {
1158
+ } => Ok ( Some ( RemoveMupdateOverrideInventory {
1157
1159
boot_disk_result : Err ( boot_error) ,
1158
1160
non_boot_message,
1159
1161
} ) ) ,
0 commit comments