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
fix: git write back Helm value files #663
base: master
Are you sure you want to change the base?
Conversation
Oh I'm cheering for this. |
Signed-off-by: Cyril MARIN <marin.cyril@gmail.com> Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #663 +/- ##
==========================================
+ Coverage 66.27% 66.36% +0.08%
==========================================
Files 22 22
Lines 2150 2179 +29
==========================================
+ Hits 1425 1446 +21
- Misses 591 598 +7
- Partials 134 135 +1 ☔ View full report in Codecov by Sentry. |
Hi @burnb - I really appreciate your work on this. I tried this out this morning and unfortunately still ran into the error |
Hi @devopsidiot could you show me what kind of annotation did you try to execute? |
Hi @burnb - Here you go (and thanks for responding):
|
helm.image-name and helm.image-tag are the paths to the values which will be generated by updater in the helmvalues file, in your case in the values-rnd.yaml
and it will be represented in values-rnd.yaml after updater refresh like image:
name: <accountid>.dkr.ecr.us-east-1.amazonaws.com/daily-worship
tag: develop-v0.20.0-33 |
So I did the things correctly, but it's still not updating the application:
Annotations:
Relevant values:
|
in your case annotation should be
|
Thanks so much for responding: I did these things:
And the only error that I got was Since these argo applications are in the argo namespace and not the argocd namespace, am I just SoL for the time being? |
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
It's just a warning that it can't send event to the k8s. And at this step it successfully sent git update. |
You literally made me cry with relief. Thank you so much for all your hard work. This needs to get adopted. This makes it work. |
@burnb you are a hero! Finally ArgoCD somewhat resembles the power of Flux |
Hey, I have been using this and it works great. I am cheering for this too. I can attest that it works when using aliases in the image list. It writes to a specified file as long as the directory of the file exists. The one piece that seemed to be missing is the ability to write to a directory that does not exist yet. I opened a separate PR for it since it does not directly relate to your PR, but if the maintainers prefer, they can combine our PRs. |
@burnb Could you take a minute and give me a hint too? Could not update application spec: could not find an image-name annotation for image emm/arm Annotations: argocd-image-updater.argoproj.io/image-list: arm=docker-registry.<name>/emm/arm
argocd-image-updater.argoproj.io/arm.helm.image-name: deployment.arm.image.repository
argocd-image-updater.argoproj.io/arm.helm.image-tag: deployment.arm.image.tag
argocd-image-updater.argoproj.io/write-back-method: git
argocd-image-updater.argoproj.io/write-back-target: "helmvalues:values_dev.yaml" Values: ...
.
deployment:
arm:
image:
repository: docker-registry.<name>/emm/arm
tag: "9.0-1" If I remove the helm:
parameters:
- name: deployment.arm.image.repository
value: docker-registry.<name>/emm/arm
forcestring: true
- name: deployment.arm.image.tag
value: 9.0-57
forcestring: true If I add the Just in case, tree looks like this: helm/
├── emm-helm
│ ├── values.yaml
│ ├── values_dev.yaml
│ ├── ... I will be eternally grateful if you have time to help with this! |
@s-ledyakhov I guess the problem is with parsing of your image link by this function: func ParseNormalizedNamed(s string) (Named, error) {
if ok := anchoredIdentifierRegexp.MatchString(s); ok {
return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s)
}
domain, remainder := splitDockerDomain(s)
var remote string
if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 {
remote = remainder[:tagSep]
} else {
remote = remainder
}
if strings.ToLower(remote) != remote {
return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remote)
}
ref, err := Parse(domain + "/" + remainder)
if err != nil {
return nil, err
}
named, isNamed := ref.(Named)
if !isNamed {
return nil, fmt.Errorf("reference %s has no name", ref.String())
}
return named, nil
} from the "github.com/distribution/distribution/v3/reference" package, coz this error doesn't go to the logs and in that case, it parses image a bit differently, so alias doesn't go anywhere, and this is the root of the problem - it operates with the image name. |
Thanks for the answer |
I think the problem is with your |
No, I checked this point |
I can confirm this PR fixes the issues with nested image parameters, however, it does rewrite the value file to sort all yaml/helm keys alphabetically. was this introduced in this PR or in #636? Can we avoid re-arranging helm parameters? |
… file order Signed-off-by: Aleksandr Petrov <burnb83@gmail.com>
@mubarak-j fixed, but I'm not quite sure about why linter alerting, I can't reproduce it locally and all the messages not about the PR code. |
Hi, can the fix be moved forward to be merged? |
@burnb looks like there were lint fixes merged recently, so perhaps rebasing with the main branch might fix these issues? We had the build of this PR running in production for over a month now, and working as expected, thank you! @pasha-codefresh @chengfang @jannfis Can you please review this PR? |
@burnb thanks for the fix. Can you rebase to pull in recent fixed in master, squash, and leave out changes that are not required to fix this issue? Dependency updates should be done via separate PRs. |
@@ -28,4 +28,4 @@ COPY hack/git-ask-pass.sh /usr/local/bin/git-ask-pass.sh | |||
|
|||
USER 1000 | |||
|
|||
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-image-updater"] | |||
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/argocd-image-updater"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile has already been fixed recently in master. So no need to change it in this PR.
3900089
to
e1646e4
Compare
@mubarak-j could you please resolve conflicts ? |
@burnb can you please do the honor? 🙏🏼 IMHO I think it's worth adding an example in the docs for using |
Related: #650
Fixes for #636
Based on PR #651