refactor(storage): move storage init from controller to storagefactory#1345
refactor(storage): move storage init from controller to storagefactory#1345eusebiu-constantin-petu-dbk wants to merge 1 commit into
Conversation
6b6b29c to
e52445e
Compare
| func compareImageStore(root1, root2 string) bool { | ||
| isSameFile, err := config.SameFile(root1, root2) | ||
| // This error is path error that means either of root directory doesn't exist, in that case do string match | ||
| storeController, err := storagefactory.New(c.Config, linter, c.Metrics, c.Log) |
There was a problem hiding this comment.
Really want this to be a storage.New() ... no factory pls.
| "zotregistry.io/zot/pkg/storage/s3" | ||
| ) | ||
|
|
||
| func New(config *config.Config, linter common.Lint, metrics monitoring.MetricServer, |
There was a problem hiding this comment.
Why not promote this up to pkg/storage/?
There was a problem hiding this comment.
because it needs to import local/s3 for constructors, but at the same time local/s3 needs common code (which needs storage interface).
5992869 to
823792f
Compare
Codecov Report
@@ Coverage Diff @@
## main #1345 +/- ##
=======================================
Coverage 90.50% 90.51%
=======================================
Files 97 98 +1
Lines 21503 21509 +6
=======================================
+ Hits 19462 19468 +6
Misses 1526 1526
Partials 515 515
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
823792f to
212c28b
Compare
|
pkg/storage/types <- all interfaces Remove keyword "factory" pkg/api/controller only calls storage.New(config) |
|
Superseded by #1459 |
What type of PR is this?
Which issue does this PR fix:
What does this PR do / Why do we need it:
If an issue # is not available please add repro steps and logs showing the issue:
Testing done on this change:
Automation added to e2e:
Will this break upgrades or downgrades?
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.