feat(storage): support DynamoDB tablenamePrefix for cache driver#4016
Open
AkashKumar7902 wants to merge 1 commit into
Open
feat(storage): support DynamoDB tablenamePrefix for cache driver#4016AkashKumar7902 wants to merge 1 commit into
AkashKumar7902 wants to merge 1 commit into
Conversation
Add a tablenamePrefix option to the dynamodb cacheDriver so administrators can configure all DynamoDB table names with a single prefix instead of declaring each table individually. Explicit per-table names continue to override derived names for backward compatibility. Fixes project-zot#2966 Signed-off-by: Akash Kumar <meakash7902@gmail.com>
02e8ebe to
4c1290e
Compare
Contributor
|
I like this change for better ux but concern is whether this is a breaking change. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4016 +/- ##
==========================================
+ Coverage 91.47% 91.49% +0.02%
==========================================
Files 197 197
Lines 28353 28413 +60
==========================================
+ Hits 25935 25997 +62
+ Misses 1565 1563 -2
Partials 853 853 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
I wouldn't drop support for earlier config. I would add this new behavior as an addendum. It is always useful to have the older way to override defaults. |
rchincha
reviewed
May 8, 2026
| DynamoDBUserDataSuffix = "UserDataTable" | ||
| DynamoDBAPIKeySuffix = "ApiKeyDataTable" | ||
| DynamoDBVersionSuffix = "VersionTable" | ||
| RedisLocksBucket = "locks" |
Contributor
There was a problem hiding this comment.
Restore this before the new entries. Will make the patch a lot cleaner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
feature
Which issue does this PR fix: #2966
What does this PR do / Why do we need it:
Adds a new
tablenamePrefixoption to thedynamodbcache driver so administrators can configure all DynamoDB table names with a single prefix instead of declaring each table individually.When
tablenamePrefixis set, zot derives the following table names automatically:"tablenamePrefix": "Zot")ZotBlobTableZotRepoMetadataTableZotRepoBlobsInfoTableZotImageMetaTableZotUserDataTableZotApiKeyDataTableZotVersionTableExplicit per-table options (
cacheTablename,repoMetaTablename, etc.) continue to take precedence, so existing configurations keep working unchanged.Example new config:
If an issue # is not available please add repro steps and logs showing the issue:
N/A — issue #2966 is open with the feature request.
Testing done on this change:
pkg/storage/cache_internal_test.gocovering: derivation from prefix, explicit name precedence, missing/empty/non-string prefix, and missing/empty/non-string explicit table name.pkg/meta/meta_internal_test.gocovering the equivalent cases for the metadata tables.go test ./pkg/storage/ ./pkg/meta/passes.golangci-lint run ./pkg/storage/... ./pkg/meta/...reports 0 issues.examples/config-dynamodb.jsonwas simplified to use the newtablenamePrefixand validated via the unit tests.Automation added to e2e:
No new e2e cases. The existing search/auth e2e suite still exercises explicit per-table configuration, which the new code path preserves verbatim.
Will this break upgrades or downgrades?
No. Existing configurations that use explicit table names continue to work because explicit names always take precedence over the derived prefix. Older zot versions ignore the new
tablenamePrefixfield.Does this PR introduce any user-facing change?:
Yes — administrators can configure DynamoDB tables via a single
tablenamePrefixinstead of seven individual table-name fields.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.