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

Add possibility to specify write-back GIT repository as annotation.

Open flozzone opened this issue 2 years ago • 3 comments

Addressing #423

This PR does the following:

  • Get the repository URL either from app.Spec.Source.RepoURL or from argocd-image-updater.argoproj.io/git-repository if specified and store it into the WriteBackConfig struct as GitRepo.
  • Write a test to show git-repository annotation functionality
  • Update relevant documentation
  • Fix GitHub workflow linting tests by upgrading golangci-lint to its latest version

flozzone avatar Apr 22 '22 12:04 flozzone

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 22 '22 12:04 CLAassistant

Do we need to update something in order to pass linting tests? #413 #410 seem to have a similar problem.

flozzone avatar Apr 22 '22 12:04 flozzone

Do we need to update something in order to pass linting tests? #413 #410 seem to have a similar problem.

Updating to latest version v1.45.2 for the golangci/golangci-lint-action@v2 action fixed linting tests.

flozzone avatar Apr 22 '22 13:04 flozzone

@flozzone Any updates on this resolution to the issue? Is it going to be merged? Anyone fancies a review?

nikodemjedynak-dnv avatar Dec 20 '22 10:12 nikodemjedynak-dnv

Codecov Report

Merging #424 (79d7ab9) into master (49825ec) will increase coverage by 0.06%. The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master     #424      +/-   ##
==========================================
+ Coverage   65.76%   65.83%   +0.06%     
==========================================
  Files          21       21              
  Lines        2039     2043       +4     
==========================================
+ Hits         1341     1345       +4     
  Misses        569      569              
  Partials      129      129              
Impacted Files Coverage Δ
pkg/argocd/git.go 64.84% <0.00%> (ø)
pkg/argocd/gitcreds.go 76.19% <83.33%> (ø)
pkg/argocd/update.go 70.28% <83.33%> (+0.48%) :arrow_up:

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

codecov-commenter avatar May 13 '23 18:05 codecov-commenter

To fix golangci-lint issues I needed to:

Update golangci-lint to 1.52.2

  • Replace deprecated linters, deadcode, ,varcheck, structcheck by the newer unused linter. See relevant golangci-lint PR at https://github.com/golangci/golangci-lint/issues/1841
  • Run goimports -w -local github.com/argoproj-labs/argocd-image-updater . to fix
    • comment indentation
    • order of imports

flozzone avatar May 13 '23 19:05 flozzone

@jannfis bump for this. I know you're probably super busy, but thanks for taking a look

bn-cforkner avatar Jun 09 '23 22:06 bn-cforkner

Thanks for bumping this @bn-cforkner , I'm currently going through the backlog of PRs and issues. I'm really sorry to have been undercover for a while.

Couple of the changes in this PR have been merged recently (i.e. lint update), @flozzone could you please rebase this PR to what's in master? Thanks!

jannfis avatar Jun 10 '23 19:06 jannfis

@jannfis @flozzone Hoping to get another look before this gets anymore stale. Would definitely provide some useful function we’re excited to get our hands on.

rwc avatar Jul 21 '23 09:07 rwc

@flozzone I'm interested in the use case for this. As far as I can tell, the override files would not be used by Argo CD when rendering the manifests so why write the files to a separate git repository?

LS80 avatar Sep 06 '23 07:09 LS80

@flozzone I'm interested in the use case for this. As far as I can tell, the override files would not be used by Argo CD when rendering the manifests so why write the files to a separate git repository?

@LS80 I know a use case it could be handy for is when you want git write back method and are using an OCI storage for your charts.

joshbrgs avatar Sep 06 '23 11:09 joshbrgs

@LS80 I know a use case it could be handy for is when you want git write back method and are using an OCI storage for your charts.

Yes but I'm not sure what use the git write back method has if the override files created/updated in git will not actually be used by Argo CD. If an Argo CD application could be configured to use override files from a repo other than the one specified as source.repoURL then it would be really useful. I've just remembered that we can now have multiple sources so maybe that would work. One repoURL for the parameter override files in git and another referencing the helm repo...

LS80 avatar Sep 06 '23 11:09 LS80

@LS80 We use it as a record of deployment in environments where the origin of what’s running must be certified/tracked for compliance reasons.

rwc avatar Sep 07 '23 04:09 rwc