Andrei Aaron
da426850e7
chore: update golangci-lint and fix all issues ( #3575 )
...
* chore: Update golangci-lint
Signed-off-by: Lars Francke <git@lars-francke.de >
* chore: fix all golangci-lint issues
- Remove deprecated `// +build` tags
- Fix godoclint, modernize, wsl_v5, govet, lll, gci, noctx issues
- Update linter configuration
- Modernize code to use Go 1.22+ features (for range N, slices.Contains, etc.)
- Update make check lint the privileged tests
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com >
---------
Signed-off-by: Lars Francke <git@lars-francke.de >
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com >
Co-authored-by: Lars Francke <git@lars-francke.de >
2025-11-22 23:36:48 +02:00
Andrei Aaron
69dd648d20
fix(sync): properly handle CommitAll errors in syncImage and skip failed temp sync dirs ( #3567 )
...
- Return CommitAll errors instead of ignoring them
- Skip ErrRepoNotFound from temp sync dirs to allow other tags to sync
- Each tag uses separate temp directory, so failures are isolated
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com >
2025-11-20 09:21:48 -08:00
Lars Francke
7fa53f5b0f
Sync images with a background context ( #3537 )
...
feat: Sync images with a background context
This means syncs/pulls will not be cancelled anymore when the requesting client disconnects.
The timeout used can be configured per registry
Signed-off-by: Lars Francke <git@lars-francke.de >
2025-11-20 08:52:27 -08:00
Andrei Aaron
1fb2b67419
fix: minor fixes based on intermittent test failures ( #3465 )
...
1. preload busybox image to fix: https://github.com/project-zot/zot/actions/runs/18614431126/job/53077015870?pr=3465
2. stabilize test coverage in by using different error type: https://app.codecov.io/gh/project-zot/zot/pull/3444/indirect-changes
3. attempt to fx an intermitent sync test failure:
Failures:
* /home/andaaron/zot/pkg/extensions/sync/sync_test.go
Line 4857:
Expected: digest.Digest("sha256:dc1377539a9db8bf077100bfa3118052feb6b5c67509ca09bdd841e4ac14c4cc")
Actual: digest.Digest("sha256:3a3fb31a422846a680f0a07b8b666bdcb1122d912d1adca79523c7bf2715996e")
(Should equal)!
4. fix a race condition in sync by, I don't have a link, but this is the failure:
* zotregistry.dev/zot/pkg/extensions/sync/sync_test.go
Line 5963:
Expected: 1
Actual: 2
(Should equal)!
1426 total assertions
--- FAIL: TestOnDemandPullsOnce (0.42s)
sync_test.go:5921: Goroutine 0: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
sync_test.go:5921: Goroutine 1: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
sync_test.go:5921: Goroutine 4: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
sync_test.go:5921: Goroutine 3: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
sync_test.go:5921: Goroutine 2: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
FAIL
coverage: 21.4% of statements in ./...
FAIL zotregistry.dev/zot/pkg/extensions/sync 255.189s
5. Fix flaky coverage in https://app.codecov.io/gh/project-zot/zot/pull/3465/indirect-changes
6. Stability fix for https://github.com/project-zot/zot/actions/runs/18632536285/job/53119244557?pr=3465
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com >
2025-10-19 17:59:32 -07:00
Luca Muscariello
2402296e9a
fix: migrate to Go module v2 for proper semantic versioning ( #3462 )
...
* fix: migrate to Go module v2 for proper semantic versioning
This change updates the module path from 'zotregistry.dev/zot' to
'zotregistry.dev/zot/v2' to comply with Go's semantic versioning rules.
According to Go's module versioning requirements, major version v2+
must include the major version in the module path. The current
module path 'zotregistry.dev/zot' only supports v0.x.x and v1.x.x
versions, making existing v2.x.x tags (like v2.1.8) unusable.
Changes:
- Updated go.mod module path to zotregistry.dev/zot/v2
- Updated all internal import paths across 280+ Go source files
- Updated configuration files (golangcilint.yaml, gqlgen.yml)
- Updated README.md Go reference badge
This fix enables proper use of existing v2.x.x Git tags and allows
external packages to import zot v2+ versions without compatibility
errors.
Resolves: Go module import compatibility for v2+ versions
Fixes : #3071
Signed-off-by: Luca Muscariello <muscariello@ieee.org >
* fix: regenerate GraphQL files with updated v2 import paths
The gqlgen tool needs to regenerate the GraphQL schema files after
the module path change to use the new v2 imports.
Signed-off-by: Luca Muscariello <muscariello@ieee.org >
---------
Signed-off-by: Luca Muscariello <muscariello@ieee.org >
2025-10-16 22:43:47 -07:00
Lukasz Jakimczuk
b740a6f037
fix: close the syncResult channel by any goroutine that receives the data ( #3348 )
...
fix: race condition in on-demand syncing
Signed-off-by: Łukasz Jakimczuk <ljakimczuk@gmail.com >
2025-09-01 11:55:48 -07:00
peusebiu
0e2aa81439
feat(sync): use regclient for sync extension ( #2903 )
...
* feat(sync): use regclient for sync extension
replaced containers/image package with regclient/regclient package
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(sync): fixed converting innner docker list mediatype
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* feat(sync): added option to preserve digest
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(sync): added coverage and various fixes
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(metadb): fixed converting manifest list not setting platform and annotations
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(sync): remove read lock on storage, not used concurrently
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* feat(sync): added cache for repo tags
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(sync): fixed Makefile
removed opengpg tag
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
* fix(sync): add test for on demand referrer
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
---------
Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com >
2025-04-15 16:58:15 -07:00
peusebiu
8e68255946
fix(sync): added bearer client for sync ( #2222 )
...
fixed ping function taking too much time
closes : #2213 #2212
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2024-02-14 09:18:10 -08:00
Andrei Aaron
ce4924f841
refactor: rename go module from zotregistry.io/zot to zotregistry.dev/zot ( #2187 )
...
Signed-off-by: Andrei Aaron <aaaron@luxoft.com >
2024-01-31 20:34:07 -08:00
LaurentiuNiculae
79e14027ee
refactor(test): add lint rule for messages starting with the component ( #2045 )
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com >
Signed-off-by: Andrei Aaron <aaaron@luxoft.com >
2023-12-08 10:05:02 +02:00
peusebiu
59dc4c3229
feat(scheduler): pass the shutdown/reload ctx to running tasks ( #1671 )
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2023-09-05 09:48:56 -07:00
peusebiu
612a12e5a8
refactor(sync): use task scheduler ( #1301 )
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2023-05-31 10:26:23 -07:00
Nicol
c169698c95
feat: remove usage of zerolog.Logger.Msgf() from zot code ( #1382 )
...
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
2023-04-27 19:44:22 -07:00
LaurentiuNiculae
4c156234cb
feat(repodb): sync-repodb WIP ( #1241 )
...
Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com >
2023-03-09 10:41:48 -08:00
peusebiu
79783b4b06
feat(sync): skip already synced images in sync ondemand ( #1234 )
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2023-03-07 09:58:42 -08:00
Bogdan Bivolaru
7c3bf86a6b
refactor: Centralise extensions config entries ( #1177 )
...
Except for registry sync config
Signed-off-by: Bogdan BIVOLARU <104334+bogdanbiv@users.noreply.github.com >
2023-02-15 22:20:28 -08:00
Andreea Lupu
ee95ab0ffc
fix: call notation-go libs instead of using notation binary ( #1104 )
...
fix: add loading notation path
Signed-off-by: Andreea-Lupu <andreealupu1470@yahoo.com >
Co-authored-by: Roxana Nemulescu <roxana.nemulescu@gmail.com >
2023-02-13 10:43:52 -08:00
Lisca Ana-Roberta
14238d4a8d
fix: removed resty calls from sync ( #1016 )
...
Signed-off-by: Ana-Roberta Lisca <ana.kagome@yahoo.com >
2022-12-22 10:19:42 -08:00
peusebiu
024b13efe6
fix(sync): syncing OCI artifacts with distribution package fails ( #1013 )
...
sync OCI artifacts using REST APIs
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-12-09 11:38:00 -08:00
Catalin-George Hofnar
31b9481713
feat(cache): dynamodb implementation ( #953 )
...
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
2022-11-22 10:29:57 -08:00
peusebiu
e96c80c344
feat(sync,s3): added s3 logic for ORAS and OCI artifacts ( #985 )
...
added sync logic for OCI artifacts
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-11-14 22:21:49 -08:00
Ramkumar Chinchani
c0f93caacb
feat(artifact): add OCI references support ( #936 )
...
Thanks @jdolitsky et al for kicking off these changes at:
https://github.com/oci-playground/zot/commits/main
Thanks @sudo-bmitch for reviewing the patch
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2022-11-08 00:38:16 -08:00
peusebiu
2d877aaea1
fix(sync): also sync on demand digests, not only tags, closes #902 ( #932 )
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-10-27 09:39:59 -07:00
peusebiu
5f99f9a445
fix(sync): fixed broken logic to get tags for repo ( #900 )
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-10-22 00:26:14 -07:00
Andrei Aaron
38b00e3507
chore(lint): gci to separate zot from other imports ( #870 )
...
Signed-off-by: Andrei Aaron <andaaron@cisco.com >
2022-10-20 09:39:20 -07:00
Nicol
33a431ef43
Update go version to 1.19 ( #829 )
...
* ci: Update go version to 1.19
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
* ci: Fix lint issues
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
* ci: Added needprivileges to lint, made needprivileges pass lint
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
Signed-off-by: Nicol Draghici <idraghic@cisco.com >
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
Co-authored-by: Catalin Hofnar <catalin.hofnar@gmail.com >
2022-10-05 13:21:14 +03:00
Lisca Ana-Roberta
87fc941b3c
image level lint: enforce manifest mandatory annotations
...
closes #536
Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com >
2022-07-27 11:48:04 +03:00
Catalin Hofnar
a8a65a6c37
Modified sync log calls to include error type ( #336 )
...
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
2022-06-15 09:45:49 -07:00
Catalin Hofnar
20a60cbad4
Enhance sync logic - stop blob redownloads and re-pushes ( #479 #480 )
...
Changed imagesToCopyFromUpstream to return a map[string][]types.ImageReference from just an array of refs
Rewrote some logic in sync.go to use the new signature of imagesToCopyFromUpstream
Split getLocalImageRef by adding function getLocalCachePath
Adapted tests for new changes, added some tests
Merged #481
Signed-off-by: Catalin Hofnar <catalin.hofnar@gmail.com >
2022-05-16 10:05:01 -07:00
Alex Stan
d325c8b5f4
Fix problems signaled by new linter version v1.45.2
...
PR (linter: upgrade linter version #405 ) triggered lint job which failed
with many errors generated by various linters. Configurations were added to
golangcilint.yaml and several refactorings were made in order to improve the
results of the linter.
maintidx linter disabled
Signed-off-by: Alex Stan <alexandrustan96@yahoo.ro >
2022-04-27 09:55:44 -07:00
Petu Eusebiu
f53dc9eb8d
sync: Add a new flag to enforce syncing only signed images, closes #455
...
sync: When checking if a image is already synced also check for changes in upstream signatures.
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-03-24 10:50:01 -07:00
laurentiuNiculae
0d148e1d6b
new config option for sync-destination
...
Signed-off-by: laurentiuNiculae <themelopeus@gmail.com >
2022-03-21 08:12:34 -07:00
Petu Eusebiu
45968e0bb7
sync: fix inconsistent test, used inject error fw for hard to reach test cases
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-03-01 09:56:27 -08:00
Petu Eusebiu
f89925fb27
sync: periodically retry if on-demand fails inline, closes #281
...
sync: don't return error on sync signatures, just skip them, closes #375
sync: sync signatures on demand
sync on demand: in case of parallel requests pull image just once, closes #344
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-02-07 09:04:13 -08:00
Petu Eusebiu
a0e65379c8
sync: for a prefix, allow multiple registries as a list instead of only one, closes #343
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-02-01 09:45:09 -08:00
Petu Eusebiu
1109bb4dde
sync: Added support for syncing notary/cosign signatures, closes #261
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2022-01-13 08:45:59 -08:00
Ramkumar Chinchani
ac3801ea2d
lint: upgrade golangci-lint
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-20 17:20:35 -08:00
Petu Eusebiu
c86f44cc53
Disable sync periodically polling when pollInterval is not configured
...
Filtering out sync on demand images based on content configuration
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-12-14 08:59:50 -08:00
Petu Eusebiu
627cb97ef1
Add wait group for graceful shutdown, closes #302
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-12-08 10:04:52 -08:00
Ramkumar Chinchani
96226af869
move references to zotregistry.io and project-zot
...
Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com >
2021-12-05 10:52:27 -08:00
Petu Eusebiu
f0ef10fa50
sync: cleanup the orphaned private download dir on failure, closes 282
...
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-11-25 10:31:45 -08:00
Petu Eusebiu
5c07e19c8d
Changed sync behaviour, it used to copy images over http interface
...
now it copies to a local cache and then it copies over storage APIs
- accept all images with or without signatures
- disable sync writing to stdout
- added more logs
- fixed switch statement in routes
- fixed enabling sync multiple times for storage subpaths
closes #266
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-11-15 09:32:43 -08:00
Petu Eusebiu
19003e8a71
Added new extension "sync"
...
Periodically poll registries and pull images according to sync's config
Added sync on demand, syncing when clients asks for an image which
zot doesn't have.
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com >
2021-10-21 10:32:46 -07:00