client/swarm: use containerd errdefs checks

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-05-19 14:14:17 +02:00
committed by Sebastiaan van Stijn
parent 0b4495463f
commit 68a8a8f3c8
7 changed files with 14 additions and 14 deletions

View File

@@ -9,8 +9,8 @@ import (
"strings"
"testing"
cerrdefs "github.com/containerd/errdefs"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/errdefs"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
@@ -21,7 +21,7 @@ func TestSwarmUnlockError(t *testing.T) {
}
err := client.SwarmUnlock(context.Background(), swarm.UnlockRequest{UnlockKey: "SWMKEY-1-y6guTZNTwpQeTL5RhUfOsdBdXoQjiB2GADHSRJvbXeU"})
assert.Check(t, is.ErrorType(err, errdefs.IsSystem))
assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
}
func TestSwarmUnlock(t *testing.T) {