From 0145090aa4971a2818ea9d258ae85ddc28505277 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:56:43 +0100 Subject: [PATCH] dockerd: skip content check with containerd snapshotter Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- client/client_test.go | 18 ++++++++++-------- util/testutil/workers/dockerd.go | 1 + util/testutil/workers/features.go | 2 ++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index ab2e3d1ccfec..f345cb2446cb 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -7845,14 +7845,16 @@ loop0: cdAddress := sb.ContainerdAddress() if cdAddress == "" { if checkContent { - store := proxy.NewContentStore(c.ContentClient()) - count := 0 - err := store.Walk(sb.Context(), func(info content.Info) error { - count++ - return nil - }) - require.NoError(t, err) - require.Equal(t, 0, count) + if err := workers.HasFeatureCompat(t, sb, workers.FeatureContentCheck); err == nil { + store := proxy.NewContentStore(c.ContentClient()) + count := 0 + err := store.Walk(sb.Context(), func(info content.Info) error { + count++ + return nil + }) + require.NoError(t, err) + require.Equal(t, 0, count) + } } t.Logf("checkAllReleasable: skipping check for exported tars in non-containerd test") return diff --git a/util/testutil/workers/dockerd.go b/util/testutil/workers/dockerd.go index b6c1d1d51ad1..4a1af71e1874 100644 --- a/util/testutil/workers/dockerd.go +++ b/util/testutil/workers/dockerd.go @@ -50,6 +50,7 @@ func InitDockerdWorker() { Unsupported: []string{ FeatureSecurityMode, FeatureCNINetwork, + FeatureContentCheck, }, }) } diff --git a/util/testutil/workers/features.go b/util/testutil/workers/features.go index 3aaea6c31fec..3325e623e5a6 100644 --- a/util/testutil/workers/features.go +++ b/util/testutil/workers/features.go @@ -30,6 +30,7 @@ const ( FeatureSecurityMode = "security_mode" FeatureSourceDateEpoch = "source_date_epoch" FeatureCNINetwork = "cni_network" + FeatureContentCheck = "content_check" ) var features = map[string]struct{}{ @@ -56,6 +57,7 @@ var features = map[string]struct{}{ FeatureSecurityMode: {}, FeatureSourceDateEpoch: {}, FeatureCNINetwork: {}, + FeatureContentCheck: {}, } func CheckFeatureCompat(t *testing.T, sb integration.Sandbox, reason ...string) {