From bb3b967e17c2c0e7efbdbbddf524852e177866be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Gro=C3=9Fmann?= Date: Wed, 14 Oct 2026 13:26:15 +0200 Subject: [PATCH] refactor(store): move ErrEmptySecret to x/secrets Define the sentinel next to ErrNotFound and ErrAccessDenied, and alias it from store the way ErrCredentialNotFound already aliases ErrNotFound. Packages that import x/secrets can now match an empty-secret error without importing store. errors.Is(err, store.ErrEmptySecret) keeps matching, and the message is unchanged. --- store/errors.go | 4 +--- x/secrets/secrets.go | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/store/errors.go b/store/errors.go index 1eb885ee..1b7fe18d 100644 --- a/store/errors.go +++ b/store/errors.go @@ -15,8 +15,6 @@ package store import ( - "errors" - "github.com/docker/secrets-engine/x/secrets" ) @@ -24,4 +22,4 @@ var ErrCredentialNotFound = secrets.ErrNotFound // ErrEmptySecret is returned by Save and Upsert when the secret's value is // empty. -var ErrEmptySecret = errors.New("secret value must not be empty") +var ErrEmptySecret = secrets.ErrEmptySecret diff --git a/x/secrets/secrets.go b/x/secrets/secrets.go index 047b5bff..95e113e7 100644 --- a/x/secrets/secrets.go +++ b/x/secrets/secrets.go @@ -24,6 +24,7 @@ import ( var ( ErrNotFound = errors.New("secret not found") ErrAccessDenied = errors.New("access denied") // nuh, uh, uh! + ErrEmptySecret = errors.New("secret value must not be empty") ) type Envelope struct {