From cba34770d28fae4ec3fec39614767c47db70516f Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Tue, 12 Mar 2024 08:13:53 +0000 Subject: [PATCH] Handle containerd "CRIU not found" error message During the PR to get "Forensic Container Checkpointing" enabled in containerd the decision was made to not correctly report if containerd cannot find the CRIU binary. The reason was that the e2e_node checkpoint test did not understand the error message. The e2e_node checkpoint test is skipped if the container runtime (CRI-O or containerd) does not enable checkpoint support of if checkpoint support is not implemented. This commit adds another reason to skip a check. If the underlying OS which is used to test "Forensic Container Checkpointing" in combination with containerd or CRI-O is missing the CRIU binary. This was encountered on Google's Container-Optimized OS (COS) based tests where CRIU was not installed. With this change merged it is possible for containerd to return the correct error message without breaking Kubernetes e2e tests. Signed-off-by: Adrian Reber --- test/e2e_node/checkpoint_container.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/e2e_node/checkpoint_container.go b/test/e2e_node/checkpoint_container.go index 4096d827a72..40ab27ca060 100644 --- a/test/e2e_node/checkpoint_container.go +++ b/test/e2e_node/checkpoint_container.go @@ -217,6 +217,9 @@ var _ = SIGDescribe("Checkpoint Container", nodefeature.CheckpointContainer, fun // or // '(rpc error: code = Unknown desc = checkpoint/restore support not available)' // if the container engine explicitly disabled the checkpoint/restore support + // or + // '(rpc error: code = Unknown desc = CRIU binary not found or too old (<31600). Failed to checkpoint container' + // if the CRIU binary was not found if it is too old if (int(statusError.ErrStatus.Code)) == http.StatusInternalServerError { if strings.Contains( statusError.ErrStatus.Message, @@ -239,6 +242,13 @@ var _ = SIGDescribe("Checkpoint Container", nodefeature.CheckpointContainer, fun ginkgo.Skip("Container engine does not implement 'CheckpointContainer'") return } + if strings.Contains( + statusError.ErrStatus.Message, + "(rpc error: code = Unknown desc = CRIU binary not found or too old (<31600). Failed to checkpoint container", + ) { + ginkgo.Skip("Container engine reports missing or too old CRIU binary") + return + } } framework.Failf( "Unexpected status code (%d) during 'CheckpointContainer': %q",