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

Add support for values write back in combination with Argocd-Vault-Plugin #637

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

Conversation

fivetran-arnaudvangelder
Copy link

@fivetran-arnaudvangelder fivetran-arnaudvangelder commented Oct 31, 2023

argocd-image-updater doesn't support the use of plugins. This is problematic when integrations like argocd-vault-plugins are used for secrets management solutions.

This PR enables the use of ArgoCD-Vault-Plugin in combination with Helm Charts, by explicitly checking if two conditions are met:

  • the type of the application should be Plugin and
  • the git-write-back annotation should be set to Helm

If both are true, this PR assumes a plugin is used which can process Helm charts. And as helm charts like to use values.yaml files (even when targetting more than 1 destination-clusters) this PR makes sure that changes are written back to a single values.yaml file. The downside of this approach is that when multiple destinations-clusters are present (so multiple Argo-Applications) there may be write-errors to git for the applications which are processed later. This is not an issue perse, as these applications will use the same (shared) values-file for deployment. If this is considered non-desired behaviour nonetheless, this can be changed into writing to application-specific values-files (like default for non-plugin write-back).

@fivetran-arnaudvangelder fivetran-arnaudvangelder changed the title Add support for values write back with avp Add support for values write back in combination with Argocd-Vault-Plugin Oct 31, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2023

Codecov Report

Merging #637 (3536859) into master (82d59ef) will decrease coverage by 1.25%.
The diff coverage is 4.76%.

@@            Coverage Diff             @@
##           master     #637      +/-   ##
==========================================
- Coverage   65.35%   64.11%   -1.25%     
==========================================
  Files          22       22              
  Lines        2084     2126      +42     
==========================================
+ Hits         1362     1363       +1     
- Misses        588      625      +37     
- Partials      134      138       +4     
Files Coverage Δ
pkg/argocd/argocd.go 65.71% <50.00%> (-0.68%) ⬇️
pkg/argocd/update.go 64.21% <0.00%> (-2.34%) ⬇️
pkg/argocd/git.go 59.18% <0.00%> (-7.64%) ⬇️

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

@fivetran-arnaudvangelder fivetran-arnaudvangelder force-pushed the add-support-for-values-write-back-with-avp branch from 2706123 to b6393d5 Compare October 31, 2023 13:44
@villisco
Copy link

villisco commented Nov 4, 2023

Wow, this would be an huge improvement! Great work! :)

Thank you! helm works now with vault plugin! :)

Example:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  ...
  annotations:
    # update strategy
    argocd-image-updater.argoproj.io/image-list: dev=<image_path>
    argocd-image-updater.argoproj.io/dev.update-strategy: newest-build
    argocd-image-updater.argoproj.io/dev.ignore-tags: latest
    argocd-image-updater.argoproj.io/dev.force-update: "true"
    # git commit settings
    argocd-image-updater.argoproj.io/git-branch: main
    argocd-image-updater.argoproj.io/write-back-method: git:secret:argocd/repo-creds-testrepos
    argocd-image-updater.argoproj.io/write-back-target: "helm:/helm-chart/dev.values.yaml"
    argocd-image-updater.argoproj.io/dev.helm.image-spec: image.url
spec:
  source:
    path: helm-chart
    plugin:
      name: argocd-vault-plugin-helm
      env:
        - name: HELM_ARGS
          value: -f dev.values.yaml
        - name: HELM_CHART_NAME
          value: my-testapp
    repoURL: https://<repo_path>/testapp.git
    targetRevision: HEAD

@baohuynh09-lxp
Copy link

great works, hope it will be merged soon.

@virtualb0x
Copy link

Can it be merged plz?

@spedou
Copy link

spedou commented Jan 31, 2024

Hello!
Im having this same issues between image updater and vault plugin, cant wait for this to be merged! :)

@mikeisraelit
Copy link

Also waiting for this feature, have the same problem

@bat9r
Copy link

bat9r commented Feb 19, 2024

+1
I need same feature

@r3dmar
Copy link

r3dmar commented Feb 19, 2024

It would be great to have a feature like this. W8 for this so long)
+1

@SerhiiPodlesnyi
Copy link

Ohh, I'm really wanting for this feature, it'll make my file easier 👍
+1

@apaykush
Copy link

  • 1 Need it to

@Affanmir
Copy link

Can this be merged asap? Really need this feature

@matiasr2503
Copy link

matiasr2503 commented Apr 2, 2024

+1 we need this feature
@fivetran-arnaudvangelder Could you add documentation and examples on the use of this feature?

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.