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: update several path for image.tag #793

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Tchoupinax
Copy link

Hello folks!

I made this improvement to handle a case we have at work. Let's explain it.

In the current case, we provide a path for the image tag with the annotation .helm.image-tag. It says where to update the tag for this argoCD application.

Now, I have one ArgoCD application with two deployements, different with a suffix. Let's call them a and b. So my helm-chart values are prefixed by the alias of each app.

a:
  image:
    tag: v1.0.0

b:
  image:
    tag: v1.0.0

I want to update both at the same time, the lifecycle is identical. This merge request allows to do it, by adding several paths as value separated by a comma. Then, I can provide

xxxx.helm.image-tag=a.image.tag,b.image.tag

A unit test has been added about tag and name and moreover, I handled every space to ensure it won't have any bug for a mistype.

Finally, I build the customized image and tested, all is OK for me.
I hope all is clear!

Thank you for your work, I love this project.
Cheers!

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.00%. Comparing base (e370a64) to head (810a4a5).

Files with missing lines Patch % Lines
pkg/argocd/argocd.go 88.88% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #793      +/-   ##
==========================================
+ Coverage   74.82%   75.00%   +0.17%     
==========================================
  Files          31       31              
  Lines        3912     3940      +28     
==========================================
+ Hits         2927     2955      +28     
- Misses        850      852       +2     
+ Partials      135      133       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chengfang
Copy link
Collaborator

@Tchoupinax thanks for proposing it. I'll look into it.

@Tchoupinax
Copy link
Author

Hello @chengfang,
Could you have time to give a look again? 🙏

@chengfang chengfang added the enhancement New feature or request label Oct 21, 2024
pkg/argocd/argocd.go Outdated Show resolved Hide resolved
@chengfang
Copy link
Collaborator

Some other places assume that image.name and image.spec represent single-path value, and we should think about if it makes sense for those places to also take multi-path values. For instance,

helmAnnotationParamName, helmAnnotationParamVersion := getHelmParamNamesFromAnnotation(app.Annotations, c)

helmParamName := getHelmParam(appSource.Helm.Parameters, helmAnnotationParamName)

@Tchoupinax
Copy link
Author

I will give a look but maybe I need help on your last point (checking if having two paths is OK everywhere)

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

Successfully merging this pull request may close these issues.

3 participants