From e8d6be40b6e0783568ee9ecf37b9a9d8ec933088 Mon Sep 17 00:00:00 2001 From: qingliu Date: Thu, 6 Jun 2024 20:08:32 +0800 Subject: [PATCH] refactor: exact match based on sidecar name --- pkg/pod/status.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/pod/status.go b/pkg/pod/status.go index 08899729c35..59a18db7414 100644 --- a/pkg/pod/status.go +++ b/pkg/pod/status.go @@ -633,7 +633,9 @@ func areContainersCompleted(ctx context.Context, pod *corev1.Pod) bool { if config.FromContextOrDefaults(ctx).FeatureFlags.ResultExtractionMethod == config.ResultExtractionMethodSidecarLogs { // If we are using sidecar logs to extract results, we need to wait for the sidecar to complete. // Avoid failing to obtain the final result from the sidecar because the sidecar is not yet complete. - nameFilters = append(nameFilters, IsContainerSidecar) + nameFilters = append(nameFilters, func(name string) bool { + return name == pipeline.ReservedResultsSidecarContainerName + }) } return checkContainersCompleted(pod, nameFilters) }