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

[feat] Manipulate image destination based on source #115

Open
Woudan opened this issue Oct 15, 2024 · 3 comments
Open

[feat] Manipulate image destination based on source #115

Woudan opened this issue Oct 15, 2024 · 3 comments

Comments

@Woudan
Copy link

Woudan commented Oct 15, 2024

It would be useful to manipulate the image destination based on the source.

For example:

  • source: docker.io
    destination: registry.local/repo/dockerhub
  • source quay.io
    destination: registry.local/repo/quay

For quay.io/argoproj/argocd:v2.9.2 this would result in:
registry.local/repo/argoproj/argocd to registry.local/repo/quay/argoproj/argocd

This way we can keep the context of the registry from which the image originates from.

@ChristofferNissen
Copy link
Owner

Hey Woudan,

Can the example at https://github.com/ChristofferNissen/helmper/blob/main/example/helmper.yaml help answer your question?
I have an example there specifically for Argocd

- name: argo-cd
  version: 5.51.4
  repo:
    name: argo
    url: https://argoproj.github.io/argo-helm/
  images:
    exclude:
    - ref: ghcr.io/dexidp/dex
    excludeCopacetic:
    - ref: quay.io/argoproj/argocd
    modify: 
    - from: quay.io/argoproj/argocd
      to: quay.io/argoproj/argocd
    - fromValuePath: global.image.repository
      to: quay.io/argoproj/argocd

@Woudan
Copy link
Author

Woudan commented Oct 16, 2024

Hi ChristofferNissen,

Correct that with this feature we can manipulate the source right?

What I would like to do is change the destination based on which registry is resides from. What I would like to do per helm chart or as general configuration is change a the destination registry slightly.

This way we could push dynamically based on registry that we receive images from. In our destination registry I would like to be able to distinguish from what registry the images are received.

For quay.io/argoproj/argocd:v2.9.2 the destionation would change from: registry.local/repo/argoproj/argocd -> registry.local/repo/quay/argoproj/argocd based on the quay source.

Hope that makes sense.

@ChristofferNissen
Copy link
Owner

I think i got it. This is not currently supported, but i see the value in adding it.

I am leaving a few links to places the code needs to be modified if you want to take on the job, otherwise i will look at it once i am done with my current feature.

registries:
- name: registry
  url: localhost:5000
  insecure: true
  plainHTTP: true
- name: registry
  url: localhost:5001
  insecure: true
  plainHTTP: true
  appendImageSourceToDestination: true
  appendChartSourceToDestination: true
  1. Add image source to image ref before pushing here
  2. Use parent helm chart name after "charts/" prefix, e.g., here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants