Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconcile existing images table records when adding a new container registry to prevent duplicates #3018

Open
achimnol opened this issue Nov 4, 2024 · 0 comments
Labels
comp:manager Related to Manager component
Milestone

Comments

@achimnol
Copy link
Member

achimnol commented Nov 4, 2024

This is a follow-up to #1907 (its #1917 and related stack PRs).

After etcd-to-postgres container registry migration, all existing image records belong to either:

  • a "local" registry when there is no corresponding container registry config, or
  • a designated container registry instance migrated from the etcd config.

What if the admin adds a new container registry that has the already-migrated image records when rescanned?

For example:
Image
index.docker.io/nvcr.io/nvidia/nvhpc:24.3-runtime-cuda12.3-ubuntu22.04 is actually not an index.docker.io image but nvcr.io's image. This result is because there is no matching nvcr.io container registry configuration and this record has been migrated to become a "local" image.
Later, the admin adds the nvcr.io container registry configuration. Then, this entry should be converted to use that container registry instance.

There could be two ways to reconcile the potentially duplicate entries (existing vs. rescanned) in the database:

  • (Option 1) When adding a new container registry record, enumerate all local images records and update any record matching with the new registry's hostname and project.
  • (Option 2) When rescanning after adding the container registry, check if there are any duplicate record matching with the new image item based on the reference string value.
  • When such reconciliation happens, it should be explicitly logged in the console output and the log stream.
  • Let's expose this reconciliation procedure as an admin CLI command so that we could rerun it when needed.
@achimnol achimnol added the comp:manager Related to Manager component label Nov 4, 2024
@achimnol achimnol added this to the 25Q1 milestone Nov 4, 2024
@achimnol achimnol changed the title Retrofit existing images table records when adding a new container registry Reconcile existing images table records when adding a new container registry to prevent duplicates Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:manager Related to Manager component
Projects
None yet
Development

No branches or pull requests

1 participant