File tree Expand file tree Collapse file tree
rust/operator-binary/src/restart_controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,17 +215,27 @@ async fn report_result(
215215 ) ) = & result
216216 {
217217 const TOO_MANY_REQUESTS_HTTP_CODE : u16 = StatusCode :: TOO_MANY_REQUESTS . as_u16 ( ) ;
218+ // We can not blanket silence all 429 responses, as it could be something else.
219+ // E.g. I have seen "storage is re-initializing" in the past.
220+ const EVICT_ERROR_MESSAGE : & str =
221+ "Cannot evict pod as it would violate the pod's disruption budget." ;
222+
218223 if let kube:: Error :: Api ( ErrorResponse {
219224 code : TOO_MANY_REQUESTS_HTTP_CODE ,
225+ message : error_message,
220226 ..
221227 } ) = evict_pod_error
228+ // TODO: We need Rust 1.88 and 2024 edition for if-let-chains
229+ // && error_message == EVICT_ERROR_MESSAGE
222230 {
223- tracing:: info!(
224- %pod,
225- error = %evict_pod_error,
226- "Tried to evict Pod, but wasn't allowed to do so, as it would violate the Pod's disruption budget. Retrying later"
227- ) ;
228- return ;
231+ if error_message == EVICT_ERROR_MESSAGE {
232+ tracing:: info!(
233+ %pod,
234+ error = %evict_pod_error,
235+ "Tried to evict Pod, but wasn't allowed to do so, as it would violate the Pod's disruption budget. Retrying later"
236+ ) ;
237+ return ;
238+ }
229239 }
230240 }
231241
You can’t perform that action at this time.
0 commit comments