@@ -557,6 +557,7 @@ pub async fn reconcile_compute(
557557 spec. compute . tolerations . as_ref ( ) ,
558558 & job_api,
559559 & pod_api,
560+ & ctx. canary_image ,
560561 )
561562 . await ?;
562563
@@ -672,6 +673,7 @@ pub async fn reconcile_compute(
672673 base_metadata,
673674 spec. compute . tolerations . as_ref ( ) ,
674675 & job_api,
676+ & ctx. canary_image ,
675677 )
676678 . await ?;
677679
@@ -825,6 +827,8 @@ async fn apply_pod_identity_association(
825827struct CanaryConfig {
826828 /// Job name, e.g. "restate-pia-canary"
827829 name : & ' static str ,
830+ /// Container image to use for the canary pod
831+ image : String ,
828832 /// Command to run in the canary container
829833 command : Vec < String > ,
830834 /// Reason prefix for NotReady conditions, e.g. "PodIdentityAssociation"
@@ -859,7 +863,7 @@ fn canary_job_spec(
859863 service_account_name : Some ( "restate" . into ( ) ) ,
860864 containers : vec ! [ Container {
861865 name: "canary" . into( ) ,
862- image: Some ( "busybox:uclibc" . into ( ) ) ,
866+ image: Some ( config . image . clone ( ) ) ,
863867 command: Some ( config. command. clone( ) ) ,
864868 ..Default :: default ( )
865869 } ] ,
@@ -965,9 +969,11 @@ async fn check_pia(
965969 tolerations : Option < & Vec < Toleration > > ,
966970 job_api : & Api < Job > ,
967971 pod_api : & Api < Pod > ,
972+ canary_image : & str ,
968973) -> Result < ( ) , Error > {
969974 let config = CanaryConfig {
970975 name : "restate-pia-canary" ,
976+ image : canary_image. into ( ) ,
971977 command : vec ! [
972978 "grep" . into( ) ,
973979 "-q" . into( ) ,
@@ -1182,9 +1188,11 @@ async fn check_workload_identity(
11821188 base_metadata : & ObjectMeta ,
11831189 tolerations : Option < & Vec < Toleration > > ,
11841190 job_api : & Api < Job > ,
1191+ canary_image : & str ,
11851192) -> Result < ( ) , Error > {
11861193 let config = CanaryConfig {
11871194 name : "restate-wi-canary" ,
1195+ image : canary_image. into ( ) ,
11881196 command : vec ! [
11891197 "wget" . into( ) ,
11901198 "--header" . into( ) ,
@@ -1680,6 +1688,7 @@ mod tests {
16801688 fn test_canary_job_spec_structure ( ) {
16811689 let config = CanaryConfig {
16821690 name : "test-canary" ,
1691+ image : "my-registry/busybox:latest" . into ( ) ,
16831692 command : vec ! [ "echo" . into( ) , "hello" . into( ) ] ,
16841693 reason_prefix : "Test" ,
16851694 failure_message : "test failed" ,
@@ -1697,7 +1706,10 @@ mod tests {
16971706
16981707 let container = & pod_spec. containers [ 0 ] ;
16991708 assert_eq ! ( container. name, "canary" ) ;
1700- assert_eq ! ( container. image. as_deref( ) , Some ( "busybox:uclibc" ) ) ;
1709+ assert_eq ! (
1710+ container. image. as_deref( ) ,
1711+ Some ( "my-registry/busybox:latest" )
1712+ ) ;
17011713 assert_eq ! (
17021714 container. command. as_ref( ) . unwrap( ) ,
17031715 & vec![ "echo" . to_string( ) , "hello" . to_string( ) ]
@@ -1708,6 +1720,7 @@ mod tests {
17081720 fn test_canary_job_spec_label ( ) {
17091721 let config = CanaryConfig {
17101722 name : "my-canary" ,
1723+ image : "busybox:uclibc" . into ( ) ,
17111724 command : vec ! [ "true" . into( ) ] ,
17121725 reason_prefix : "Test" ,
17131726 failure_message : "" ,
@@ -1734,6 +1747,7 @@ mod tests {
17341747 } ] ;
17351748 let config = CanaryConfig {
17361749 name : "test-canary" ,
1750+ image : "busybox:uclibc" . into ( ) ,
17371751 command : vec ! [ "true" . into( ) ] ,
17381752 reason_prefix : "Test" ,
17391753 failure_message : "" ,
0 commit comments