Support project auto sync feature by pull-based replication mode #15060
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.
Signed-off-by: yunkunrao [email protected]
Summary
This PR adds event-based trigger mode for pull-based replication mode. This PR is related with #14736 .
Background
Briefly, current replication policy doesn't support event-based trigger mode for pull-based replication mode.
And alternative solution proxy cache seems to have a similar function, but it has it's own limitation that docker image namespace has to be changed with a new proxy cache project as the prefix.
Solution
Harbor admin can create a project with the same project name as the upsteam Harbor's project name with specified upstream registry_id and enable auto sync option.
When client run the docker pull cmd, local harbor will synchronize the docker image automically in the project. In other words it's totally transparent to docker client without any prefix in docker image full name.
For example, if we want to pull the latest image from downstream Harbor
docker pull <downstream_harbor:port>/proxy/<your ns>/<your image>:latest
docker run <downsteam_harbor:port>/<your ns>/<your image>:latest
. Only prerequisites are project name should be the same as upstream's project name and project enable auto-synced option.