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: Add possibility to specify write-back GIT repository as annotation #424

Merged
merged 4 commits into from
Aug 15, 2023

Conversation

flozzone
Copy link
Contributor

@flozzone flozzone commented Apr 22, 2022

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

@CLAassistant
Copy link

CLAassistant commented Apr 22, 2022

CLA assistant check
All committers have signed the CLA.

@flozzone
Copy link
Contributor Author

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

@flozzone flozzone force-pushed the fix-423 branch 2 times, most recently from 6097d45 to 7b5df83 Compare April 22, 2022 12:51
@flozzone
Copy link
Contributor Author

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 flozzone force-pushed the fix-423 branch 4 times, most recently from 70b79ea to 039ec92 Compare April 25, 2022 07:57
@nikodemjedynak-dnv
Copy link

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

Copy link

@joshbrgs joshbrgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is solid work, the only merge conflict is the ci-tests golangci-lint-action version. I tested it locally and the tests still pass. I would approve but not sure what the rules around that look like (if a more frequent contributer is required to approve). @flozzone @chathumal-nad

.github/workflows/ci-tests.yaml Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2023

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%) ⬆️

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

@flozzone
Copy link
Contributor Author

flozzone commented May 13, 2023

To fix golangci-lint issues I needed to:

Update golangci-lint to 1.52.2

@bn-cforkner
Copy link

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

@jannfis
Copy link
Contributor

jannfis commented Jun 10, 2023

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!

@rwc
Copy link

rwc commented Jul 21, 2023

@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.

Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you, and sorry for the delay.

@jannfis jannfis changed the title Add possibility to specify write-back GIT repository as annotation. feat: Add possibility to specify write-back GIT repository as annotation Aug 15, 2023
@jannfis jannfis merged commit 202f6bf into argoproj-labs:master Aug 15, 2023
jwhy89 pushed a commit to jwhy89/argocd-image-updater that referenced this pull request Aug 17, 2023
…ion (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
Signed-off-by: Jarvis Yang <[email protected]>
jessebye pushed a commit to jessebye/argocd-image-updater that referenced this pull request Sep 1, 2023
…ion (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>
jessebye pushed a commit to jessebye/argocd-image-updater that referenced this pull request Sep 1, 2023
Signed-off-by: satoru <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

docs: Fixed typo (argoproj-labs#589)

Signed-off-by: Jesse Bye <[email protected]>

chore: Preallocate space for slices with known size (argoproj-labs#575)

Signed-off-by: satoru <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

ci: Fix codegen and update kustomize to post-2.0 (argoproj-labs#590)

* ci: Fix codegen

Signed-off-by: jannfis <[email protected]>

* Fix tar call

Signed-off-by: jannfis <[email protected]>

---------

Signed-off-by: jannfis <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

feat: Respect original parameter overrides with git write-back (argoproj-labs#573)

* Fix original override not respected

Signed-off-by: KS. Yim <[email protected]>

* Add writeOverrides unittest

Signed-off-by: KS. Yim <[email protected]>

* Add helm override commit test

Signed-off-by: KS. Yim <[email protected]>

* lint

Signed-off-by: KS. Yim <[email protected]>

* fix shadowed err

Signed-off-by: KS. Yim <[email protected]>

---------

Signed-off-by: KS. Yim <[email protected]>
Co-authored-by: KS. Yim <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

chore: Update to newer argocd version for better API compatibility (argoproj-labs#594)

* fix: update go mods to use newer argocd app definition

Signed-off-by: Jesse Bye <[email protected]>

* fix deps and tests

Signed-off-by: Jesse Bye <[email protected]>

* fix spelling

Signed-off-by: Jesse Bye <[email protected]>

---------

Signed-off-by: Jesse Bye <[email protected]>

chore(deps): upgrade dependencies for fix vulnerabilities (argoproj-labs#599)

Signed-off-by: Viacheslav Sychov <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

fix: tighten securityContext to comply with restricted PSS (argoproj-labs#600)

makes argocd-image-updater compatible with restricted Pod Security Standard

Signed-off-by: Takeo Sawada <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

feat: Add possibility to specify write-back GIT repository as annotation (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
Signed-off-by: Jesse Bye <[email protected]>

fix: support ocischema.DeserializedImageIndex in registry client

Signed-off-by: Jesse Bye <[email protected]>

fix test

Signed-off-by: Jesse Bye <[email protected]>

fix: update go mods to use newer argocd app definition

Signed-off-by: Jesse Bye <[email protected]>

fix deps and tests

Signed-off-by: Jesse Bye <[email protected]>

merge master

Signed-off-by: Jesse Bye <[email protected]>

fix go mods

Signed-off-by: Jesse Bye <[email protected]>

refactor: use shared function to reduce duplication

Signed-off-by: Jesse Bye <[email protected]>

fix: update go mods to use newer argocd app definition

Signed-off-by: Jesse Bye <[email protected]>

fix deps and tests

Signed-off-by: Jesse Bye <[email protected]>

merge master

Signed-off-by: Jesse Bye <[email protected]>

fix go mods

Signed-off-by: Jesse Bye <[email protected]>

Fix after rebase

Signed-off-by: Jesse Bye <[email protected]>

chore: Fix spell checking config (argoproj-labs#577)

Signed-off-by: satoru <[email protected]>

docs: Fixed typo (argoproj-labs#589)

chore: Preallocate space for slices with known size (argoproj-labs#575)

Signed-off-by: satoru <[email protected]>

ci: Fix codegen and update kustomize to post-2.0 (argoproj-labs#590)

* ci: Fix codegen

Signed-off-by: jannfis <[email protected]>

* Fix tar call

Signed-off-by: jannfis <[email protected]>

---------

Signed-off-by: jannfis <[email protected]>

feat: Respect original parameter overrides with git write-back (argoproj-labs#573)

* Fix original override not respected

Signed-off-by: KS. Yim <[email protected]>

* Add writeOverrides unittest

Signed-off-by: KS. Yim <[email protected]>

* Add helm override commit test

Signed-off-by: KS. Yim <[email protected]>

* lint

Signed-off-by: KS. Yim <[email protected]>

* fix shadowed err

Signed-off-by: KS. Yim <[email protected]>

---------

Signed-off-by: KS. Yim <[email protected]>
Co-authored-by: KS. Yim <[email protected]>

chore: Update to newer argocd version for better API compatibility (argoproj-labs#594)

* fix: update go mods to use newer argocd app definition

Signed-off-by: Jesse Bye <[email protected]>

* fix deps and tests

Signed-off-by: Jesse Bye <[email protected]>

* fix spelling

Signed-off-by: Jesse Bye <[email protected]>

---------

Signed-off-by: Jesse Bye <[email protected]>

chore(deps): upgrade dependencies for fix vulnerabilities (argoproj-labs#599)

Signed-off-by: Viacheslav Sychov <[email protected]>

fix: tighten securityContext to comply with restricted PSS (argoproj-labs#600)

makes argocd-image-updater compatible with restricted Pod Security Standard

Signed-off-by: Takeo Sawada <[email protected]>
@LS80
Copy link

LS80 commented Sep 6, 2023

@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?

@joshbrgs
Copy link

joshbrgs commented Sep 6, 2023

@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.

@LS80
Copy link

LS80 commented Sep 6, 2023

@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...

@rwc
Copy link

rwc commented Sep 7, 2023

@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.

xescab pushed a commit to xescab/argocd-image-updater that referenced this pull request Sep 8, 2023
…ion (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
Signed-off-by: Francesc Arbona <[email protected]>
dlactin pushed a commit to dlactin/argocd-image-updater that referenced this pull request May 9, 2024
…ion (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
sribiere-jellysmack pushed a commit to sribiere-jellysmack/argocd-image-updater that referenced this pull request Aug 13, 2024
…ion (argoproj-labs#424)

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

Signed-off-by: flozzone <[email protected]>

* Update golangci-lint to 1.52.2.

Signed-off-by: flozzone <[email protected]>

* Replace deprecated golangci linters with 'unused' linter.

Signed-off-by: flozzone <[email protected]>

* Fix Goimport issues.

Signed-off-by: flozzone <[email protected]>

---------

Signed-off-by: flozzone <[email protected]>
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

Successfully merging this pull request may close these issues.

10 participants