akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.75k stars 145 forks source link

Credentials secret with regex incompatible with container registry on custom port #2928

Open Gio-R opened 1 week ago

Gio-R commented 1 week ago

Description

I created a Warehouse pointing to an image on a private registry, exposed on a custom port. The image url was my.registry.url:10000/path/to/image. I created a generic credentials Secret with repoURLIsRegex: "true" and repoURL: "my.registry.url:10000/.*", expecting Kargo to associate the credentials to the image, but it was not so.

I temporarily solved the problem by changing the regex to "my.registry.url.10000/.*", as I suspect that the normalizations done here change the examined image url to my.registry.url/10000/path/to/image, causing the original regex to not match.

Steps to Reproduce

  1. Set Kargo log level to debug
  2. Create, in a Kargo Project, a Warehouse with a subscription to an image with url my.registry.url:10000/path/to/image
  3. Create a credentials Secret for such Warehouse with repoURLIsRegex: "true" and repoURL: "my.registry.url:10000/.*"
  4. See how Kargo logs "found no credentials for image repo" when refreshing the Warehouse
  5. Change the repo url in the Secret to repoURL: "my.registry.url.10000/.*"
  6. See how Kargo correctly refreshes the Warehouse

Version

Kargo v1.0.3