argocd-image-updater
argocd-image-updater copied to clipboard
feat: push new commit to pushBranch when newer image is found
If pushBranch is designated like :target_branch, image updater continues to emit error messages like below after pushing a branch initially.
time="2022-03-29T11:03:47Z" level=error msg="Could not update application spec: could not push image-updater-katainaka0503/argocd-image-updater-test-app-0.0.4 to origin: `git push origin image-updater-katainaka0503/argocd-image-updater-test-app-0.0.4` failed exit status 1: To https://github.com/katainaka0503/argocd-image-updater-test.git\n ! [rejected] image-updater-katainaka0503/argocd-image-updater-test-app-0.0.4 -> image-updater-katainaka0503/argocd-image-updater-test-app-0.0.4 (non-fast-forward)\nerror: failed to push some refs to 'https://github.com/katainaka0503/argocd-image-updater-test.git'\nhint: Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart. Integrate the remote changes (e.g.\nhint: 'git pull ...') before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details." application=test
This PR allows the image updater to update the branch if designated branch is found on the remote repository.
Related: https://github.com/argoproj-labs/argocd-image-updater/pull/304, https://github.com/argoproj-labs/argocd-image-updater/pull/384
@jannfis Hi! Is there anything I can to help you review this PR?
Codecov Report
Merging #410 (760bc66) into master (ccb749f) will increase coverage by
0.01%. The diff coverage is75.00%.
@@ Coverage Diff @@
## master #410 +/- ##
==========================================
+ Coverage 65.70% 65.72% +0.01%
==========================================
Files 21 21
Lines 2041 2048 +7
==========================================
+ Hits 1341 1346 +5
- Misses 571 572 +1
- Partials 129 130 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/argocd/git.go | 65.04% <75.00%> (+0.20%) |
:arrow_up: |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more