jfrog / docker2artifactory

Apache License 2.0
29 stars 14 forks source link

For images migrated from source such as harbor, the project prefix can be trimmed/altered. #20

Open c4fun opened 4 years ago

c4fun commented 4 years ago

Right now if we use this tool to migrate a harbor instance, we'll need to export the list of images into a image list and refer to it using the "--image-file" option.

However, as an admin myself, I found that in some organizations, migrating from harbor to artifactory generally means that there is some org change. The harbor repo management is not suitable for their needs. So the migration will also need an org change.

For example,

  1. Previously in harbor, I have a project named product-abc which contains product images for product-abc such as product-abc/backend:latest, product-abc/frontend:latest. As per artifactory naming convention, we named this project into abc-docker-release-loc. And we want to rename the images to abc-docker-release-loc/backend:latest, abc-docker-release-loc/frontend:latest. We'll need a parameter for that(such as "--source-project").
  2. As stated in previous example, we also have some infra images such as product-abc/nginx:latest, product-abc/redis:latest. After the migration, we want it to be contained in another subfolder such as abc-docker-release-loc/infra/nginx:latest, abc-docker-release-loc/infra/redis:latest. We'll need a parameter for that (such as "--target-subfolder").

The catch is that many small organizations did not think it through when they first use light-weight image management system such as harbor. So their previous project structure might itself be a mess. It needs cleaning up before migrated to artifactory. By adding these params, this tool can enable admin to clean up while migrate; that helps admin migrate more smoothly.

c4fun commented 4 years ago

I've written the code for it as mentioned in PR #21 . Please help close this issue if the PR is accepted.