File tree Expand file tree Collapse file tree
src/controllers/restatecluster/reconcilers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,7 +713,7 @@ async fn check_pia(
713713 namespace
714714 ) ;
715715
716- let created = job_api
716+ let created = match job_api
717717 . patch (
718718 name,
719719 & params,
@@ -747,7 +747,28 @@ async fn check_pia(
747747 status : None ,
748748 } ) ,
749749 )
750- . await ?;
750+ . await
751+ {
752+ Ok ( created) => created,
753+ Err ( kube:: Error :: Api ( kube:: error:: ErrorResponse {
754+ code : 422 ,
755+ reason,
756+ message,
757+ ..
758+ } ) ) if reason == "Invalid" && message. contains ( "field is immutable" ) => {
759+ // when tolerations change, the existing job becomes invalid
760+ delete_job ( namespace, job_api, name) . await ?;
761+
762+ return Err ( Error :: NotReady {
763+ reason : "PodIdentityAssociationCanaryPending" . into ( ) ,
764+ message : "Canary Job has not yet succeeded; recreated Job after tolerations change"
765+ . into ( ) ,
766+ // job watch will cover this
767+ requeue_after : None ,
768+ } ) ;
769+ }
770+ Err ( err) => return Err ( err. into ( ) ) ,
771+ } ;
751772
752773 if let Some ( conditions) = created. status . and_then ( |s| s. conditions ) {
753774 for condition in conditions {
You can’t perform that action at this time.
0 commit comments