Skip to content

Commit 44dd4fe

Browse files
authored
fix(policy-tests): adapt curl library for native sidecar proxies (#14840)
(Extracted from #14566) Fixed the curl library logic such that when blocking on the init container for termination, it blocks on init containers different than the proxy.
1 parent d22fbc7 commit 44dd4fe

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

policy-test/src/curl.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,17 @@ impl Running {
338338
|pod: Option<&k8s::Pod>| -> bool {
339339
if let Some(pod) = pod {
340340
if let Some(status) = pod.status.as_ref() {
341-
return status.init_container_statuses.iter().flatten().all(|init| {
342-
init.state
343-
.as_ref()
344-
.map(|s| s.terminated.is_some())
345-
.unwrap_or(false)
346-
});
341+
return status
342+
.init_container_statuses
343+
.iter()
344+
.flatten()
345+
.filter(|init| init.name != "linkerd-proxy")
346+
.all(|init| {
347+
init.state
348+
.as_ref()
349+
.map(|s| s.terminated.is_some())
350+
.unwrap_or(false)
351+
});
347352
}
348353
}
349354
false

0 commit comments

Comments
 (0)