From fbdc6d36e2a496e0acea4486476e8ac40151f0b2 Mon Sep 17 00:00:00 2001 From: Kohei Tokunaga Date: Mon, 6 Jan 2025 15:29:37 +0900 Subject: [PATCH 1/2] CI: Fix some tests don't run Signed-off-by: Kohei Tokunaga --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96d3399c7..dba07bfed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,6 @@ jobs: fail-fast: false matrix: buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version - buildargs: [""] builtin: ["true", "false"] metadata-store: ["memory", "db"] exclude: @@ -81,7 +80,6 @@ jobs: fail-fast: false matrix: buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version - buildargs: [""] steps: - name: Install htpasswd for setting up private registry run: sudo apt-get update -y && sudo apt-get --no-install-recommends install -y apache2-utils @@ -98,7 +96,6 @@ jobs: fail-fast: false matrix: buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version - buildargs: [""] builtin: ["true", "false"] exclude: - buildargs: "" @@ -120,7 +117,6 @@ jobs: fail-fast: false matrix: buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version - buildargs: [""] builtin: ["true", "false"] exclude: - buildargs: "" @@ -142,7 +138,6 @@ jobs: fail-fast: false matrix: buildargs: ["", "--build-arg=CONTAINERD_VERSION=main"] # released version & main version - buildargs: [""] builtin: ["true", "false"] metadata-store: ["memory", "db"] exclude: From 054b5aee83097632a28b4cd1d465d48672bf05e9 Mon Sep 17 00:00:00 2001 From: Kohei Tokunaga Date: Mon, 6 Jan 2025 15:50:56 +0900 Subject: [PATCH 2/2] Ensure task is started before signal-related operations This is needed to avoid a race on github.com/containerd/containerd/v2/client.(*task).Pid() Signed-off-by: Kohei Tokunaga --- analyzer/analyzer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/analyzer/analyzer.go b/analyzer/analyzer.go index 08b9fbc27..e32f3ba46 100644 --- a/analyzer/analyzer.go +++ b/analyzer/analyzer.go @@ -225,6 +225,9 @@ func Analyze(ctx context.Context, client *containerd.Client, ref string, opts .. successCount++ } }() + if err := task.Start(ctx); err != nil { + return "", err + } if aOpts.terminal { if err := tasks.HandleConsoleResize(ctx, task, con); err != nil { log.G(ctx).WithError(err).Error("failed to resize console") @@ -233,9 +236,6 @@ func Analyze(ctx context.Context, client *containerd.Client, ref string, opts .. sigc := commands.ForwardAllSignals(ctx, task) defer commands.StopCatch(sigc) } - if err := task.Start(ctx); err != nil { - return "", err - } // Wait until the task exit var status containerd.ExitStatus