diff --git a/src/scaler/daemonscaler/mod.rs b/src/scaler/daemonscaler/mod.rs index 24d8b433..f9fe46dc 100644 --- a/src/scaler/daemonscaler/mod.rs +++ b/src/scaler/daemonscaler/mod.rs @@ -969,7 +969,7 @@ mod test { assert_eq!(cmds.len(), 1); assert_eq!( blobby_daemonscaler.status().await.status_type, - StatusType::Compensating + StatusType::Reconciling ); for cmd in cmds.iter() { @@ -1030,7 +1030,7 @@ mod test { assert_eq!( blobby_daemonscaler.status().await.status_type, - StatusType::Ready + StatusType::Deployed ); Ok(()) diff --git a/src/server/types.rs b/src/server/types.rs index 32fd16b6..c4f72036 100644 --- a/src/server/types.rs +++ b/src/server/types.rs @@ -205,7 +205,7 @@ impl StatusInfo { pub fn ready(message: &str) -> Self { StatusInfo { - status_type: StatusType::Ready, + status_type: StatusType::Deployed, message: message.to_owned(), } } @@ -219,7 +219,7 @@ impl StatusInfo { pub fn compensating(message: &str) -> Self { StatusInfo { - status_type: StatusType::Compensating, + status_type: StatusType::Reconciling, message: message.to_owned(), } } @@ -231,8 +231,10 @@ impl StatusInfo { pub enum StatusType { #[default] Undeployed, - Compensating, - Ready, + #[serde(alias = "compensating")] + Reconciling, + #[serde(alias = "ready")] + Deployed, Failed, } @@ -256,8 +258,8 @@ impl std::ops::Add for StatusType { // If anything is undeployed, the whole thing is (Self::Undeployed, _) => Self::Undeployed, (_, Self::Undeployed) => Self::Undeployed, - (Self::Compensating, _) => Self::Compensating, - (_, Self::Compensating) => Self::Compensating, + (Self::Reconciling, _) => Self::Reconciling, + (_, Self::Reconciling) => Self::Reconciling, _ => unreachable!("aggregating StatusType failure. This is programmer error"), } } @@ -278,8 +280,10 @@ mod test { #[test] fn test_status_aggregate() { assert!(matches!( - [StatusType::Ready, StatusType::Ready].into_iter().sum(), - StatusType::Ready + [StatusType::Deployed, StatusType::Deployed] + .into_iter() + .sum(), + StatusType::Deployed )); assert!(matches!( @@ -297,14 +301,14 @@ mod test { )); assert!(matches!( - [StatusType::Compensating, StatusType::Undeployed] + [StatusType::Reconciling, StatusType::Undeployed] .into_iter() .sum(), StatusType::Undeployed )); assert!(matches!( - [StatusType::Ready, StatusType::Undeployed] + [StatusType::Deployed, StatusType::Undeployed] .into_iter() .sum(), StatusType::Undeployed @@ -312,8 +316,8 @@ mod test { assert!(matches!( [ - StatusType::Ready, - StatusType::Compensating, + StatusType::Deployed, + StatusType::Reconciling, StatusType::Undeployed, StatusType::Failed ] diff --git a/tests/e2e_multiple_hosts.rs b/tests/e2e_multiple_hosts.rs index d31d9842..7e86ee4c 100644 --- a/tests/e2e_multiple_hosts.rs +++ b/tests/e2e_multiple_hosts.rs @@ -121,7 +121,7 @@ async fn test_no_requirements(client_info: &ClientInfo) { ); // Once manifest is deployed, first status should be compensating - check_status(&stream, "default", "echo-simple", StatusType::Compensating) + check_status(&stream, "default", "echo-simple", StatusType::Reconciling) .await .unwrap(); @@ -165,7 +165,7 @@ async fn test_no_requirements(client_info: &ClientInfo) { ) } - check_status(&stream, "default", "echo-simple", StatusType::Ready) + check_status(&stream, "default", "echo-simple", StatusType::Deployed) .await .unwrap(); diff --git a/tests/e2e_multitenant.rs b/tests/e2e_multitenant.rs index bbc9aeef..84fa1ea5 100644 --- a/tests/e2e_multitenant.rs +++ b/tests/e2e_multitenant.rs @@ -125,7 +125,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> { &stream, LATTICE_EAST, "echo-simple", - StatusType::Compensating, + StatusType::Reconciling, ) .await .unwrap(); @@ -133,7 +133,7 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> { &stream, LATTICE_WEST, "messaging-simple", - StatusType::Compensating, + StatusType::Reconciling, ) .await .unwrap(); @@ -299,10 +299,10 @@ async fn test_basic_separation(client_info: &ClientInfo) -> anyhow::Result<()> { ) } - check_status(&stream, LATTICE_EAST, "echo-simple", StatusType::Ready) + check_status(&stream, LATTICE_EAST, "echo-simple", StatusType::Deployed) .await .unwrap(); - check_status(&stream, LATTICE_WEST, "messaging-simple", StatusType::Ready) + check_status(&stream, LATTICE_WEST, "messaging-simple", StatusType::Deployed) .await .unwrap(); diff --git a/tests/e2e_upgrades.rs b/tests/e2e_upgrades.rs index 6be9e238..08afd4f9 100644 --- a/tests/e2e_upgrades.rs +++ b/tests/e2e_upgrades.rs @@ -97,7 +97,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ); // Once manifest is deployed, first status should be compensating - check_status(&stream, "default", "updateapp", StatusType::Compensating) + check_status(&stream, "default", "updateapp", StatusType::Reconciling) .await .unwrap(); @@ -180,7 +180,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ) } - check_status(&stream, "default", "updateapp", StatusType::Ready) + check_status(&stream, "default", "updateapp", StatusType::Deployed) .await .unwrap(); @@ -209,7 +209,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ); // Once manifest is updated, status should be compensating - check_status(&stream, "default", "updateapp", StatusType::Compensating) + check_status(&stream, "default", "updateapp", StatusType::Reconciling) .await .unwrap(); @@ -292,7 +292,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ) } - check_status(&stream, "default", "updateapp", StatusType::Ready) + check_status(&stream, "default", "updateapp", StatusType::Deployed) .await .unwrap(); @@ -321,7 +321,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ); // Once manifest is updated, status should be compensating - check_status(&stream, "default", "updateapp", StatusType::Compensating) + check_status(&stream, "default", "updateapp", StatusType::Reconciling) .await .unwrap(); @@ -404,7 +404,7 @@ async fn test_upgrade(client_info: &ClientInfo) { ) } - check_status(&stream, "default", "updateapp", StatusType::Ready) + check_status(&stream, "default", "updateapp", StatusType::Deployed) .await .unwrap();