argocd-image-updater icon indicating copy to clipboard operation
argocd-image-updater copied to clipboard

Improve repository selection, based on prefixes in config and full image name

Open vsychov opened this issue 2 years ago • 6 comments

Hello everyone,

This code solves a problem that occurs with DigitalOcean repositories when you have multiple repositories in different projects with different credentials.

For example:

registries:
  - api_url: https://registry.digitalocean.com
    credentials: pullsecret:infra/registry-project1
    name: Project 1
    ping: false
    prefix: registry.digitalocean.com/project1
  - api_url: https://registry.digitalocean.com
    credentials: pullsecret:infra/registry-project2
    name: Project 2
    ping: false
    prefix: registry.digitalocean.com/project2

Previously, image-updater ignored this configuration and only used "https://registry.digitalocean.com" because it could not find an exact repository match. This PR fixes this problem so that the above configuration will work.

vsychov avatar Mar 28 '23 21:03 vsychov

Codecov Report

Merging #547 (7d33223) into master (49825ec) will increase coverage by 0.20%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
+ Coverage   65.76%   65.96%   +0.20%     
==========================================
  Files          21       21              
  Lines        2039     2051      +12     
==========================================
+ Hits         1341     1353      +12     
  Misses        569      569              
  Partials      129      129              
Impacted Files Coverage Δ
pkg/argocd/update.go 69.79% <100.00%> (ø)
pkg/registry/endpoints.go 75.53% <100.00%> (+2.31%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Mar 28 '23 21:03 codecov-commenter

Also in this PR I fixed pipeline (linter didn't works), @jannfis can you review pls?

vsychov avatar Mar 29 '23 10:03 vsychov

Thanks @vsychov - this change is reasonable to me, and I'd like it to go in! I'll try to carve out some time for review really soon.

jannfis avatar Mar 31 '23 23:03 jannfis

Hello @jannfis, is it ok to be merged?

vsychov avatar Jun 03 '23 21:06 vsychov

Hello @jannfis , any updates on that?

vsychov avatar Jul 30 '23 17:07 vsychov

Hi guys, can it be merged?

vsychov avatar Dec 18 '23 17:12 vsychov