0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/pkg/extensions
peusebiu d62dbcdf63
fix(sync): fix syncing signatures when using destination in sync's config (#1429)
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
2023-05-08 10:16:20 -07:00
..
config feat(mgmt): added mgmt extension which returns current zot configuration (#1198) 2023-03-09 10:43:26 -08:00
lint fix(errors): remove direct dependency on 'github.com/pkg/errors' (#1275) 2023-03-20 09:34:04 -07:00
monitoring feat: remove usage of zerolog.Logger.Msgf() from zot code (#1382) 2023-04-27 19:44:22 -07:00
scrub feat(storage): rebuild storage(s3/local) dedupe index when switching dedupe status (#1062) 2023-04-07 09:49:24 -07:00
search fix(repoinfo): fix userprefs values for repos returned by expanded repo info (#1413) 2023-05-04 09:51:21 -07:00
sync fix(sync): fix syncing signatures when using destination in sync's config (#1429) 2023-05-08 10:16:20 -07:00
_zot.md feat(mgmt): added mgmt extension which returns current zot configuration (#1198) 2023-03-09 10:43:26 -08:00
extension_metrics.go feat(ui): package zui within zot binary (#1161) 2023-02-10 14:52:54 -08:00
extension_metrics_disabled.go feat(ui): package zui within zot binary (#1161) 2023-02-10 14:52:54 -08:00
extension_mgmt.go feat(mgmt): added mgmt extension which returns current zot configuration (#1198) 2023-03-09 10:43:26 -08:00
extension_mgmt_disabled.go feat(mgmt): added mgmt extension which returns current zot configuration (#1198) 2023-03-09 10:43:26 -08:00
extension_scrub.go add enable/disable option for scrub extension (#827) 2022-09-27 18:06:50 -07:00
extension_scrub_disabled.go initial design for task scheduler (#700) 2022-09-22 22:27:56 -07:00
extension_search.go fix(trivy): consistent coverage for reset method + longer wait time between retries (#1272) 2023-03-22 09:52:48 -07:00
extension_search_disabled.go fix: trivydb update now uses task scheduler (#1204) 2023-03-02 09:43:54 -08:00
extension_search_test.go fix(trivy): consistent coverage for reset method + longer wait time between retries (#1272) 2023-03-22 09:52:48 -07:00
extension_sync.go feat: remove usage of zerolog.Logger.Msgf() from zot code (#1382) 2023-04-27 19:44:22 -07:00
extension_sync_disabled.go test: stop task scheduler between test runs (#1311) 2023-03-29 11:37:58 -07:00
extension_ui.go fix(csp): upgrade UI and fix zap failure (#1372) 2023-04-13 13:48:09 -07:00
extension_ui_disabled.go build(ui): the ui is now included in the zot binary by default (#1202) 2023-02-23 22:28:08 +02:00
extension_ui_test.go feat(repodb): Multiarch Image support (#1147) 2023-02-27 11:23:18 -08:00
extension_userprefs.go feat(repodb): add user related information to repodb (#1317) 2023-04-24 11:13:15 -07:00
extension_userprefs_disable.go feat(repodb): add user related information to repodb (#1317) 2023-04-24 11:13:15 -07:00
extension_userprefs_test.go chore: update golang (to 1.20.x) and golangci-linter (#1388) 2023-04-27 00:09:46 -07:00
extensions_lint.go image level lint: enforce manifest mandatory annotations 2022-07-27 11:48:04 +03:00
extensions_lint_disabled.go image level lint: enforce manifest mandatory annotations 2022-07-27 11:48:04 +03:00
extensions_test.go feat(storage): rebuild storage(s3/local) dedupe index when switching dedupe status (#1062) 2023-04-07 09:49:24 -07:00
mgmt.md feat(mgmt): added mgmt extension which returns current zot configuration (#1198) 2023-03-09 10:43:26 -08:00
README.md build(tags): remove redundant build tag ui_base (#857) 2022-10-10 15:05:55 +03:00

Adding new extensions

As new requirements come and build time extensions need to be added, there are a few things that you have to make sure are present before commiting :

  • files that should be included in the binary only with a specific extension must contain the following syntax at the beginning of the file :

//go:build sync will be added automatically by the linter, so only the second line is mandatory .

NOTE: the third line in the example should be blank, otherwise the build tag would be just another comment.

//go:build sync
// +build sync

package extensions
...................
  • when adding a new tag, specify the new order in which multiple tags should be used (bottom of this page)

  • for each and every new file that contains functions (functionalities) specific to an extension, one should create a corresponding file that must contain the exact same functions, but no functionalities included. This file must begin with an "anti-tag" (e.g. // +build !sync) which will include this file in binaries that don't include this extension ( in this example, the file won't be used in binaries that include sync extension ). See extension-sync-disabled.go for an example.

  • when a new extension comes out, the developer should also write some blackbox tests, where a binary that contains the new extension should be tested in a real usage scenario. See test/blackbox folder for multiple extensions examples.

  • newly added blackbox tests should have targets in Makefile. You should also add them as Github Workflows, in .github/workflows/ecosystem-tools.yaml

  • with every new extension, you should modify the EXTENSIONS variable in Makefile by adding the new extension. The EXTENSIONS variable represents all extensions and is used in Make targets that require them all (e.g make test).

  • the available extensions that can be used at the moment are: sync, scrub, metrics, search . NOTE: When multiple extensions are used, they should be enlisted in the above presented order.