argocd-notifications icon indicating copy to clipboard operation
argocd-notifications copied to clipboard

fix: repo.GetAppDetails().Helm.parameters not get argocd override value

Open ss75710541 opened this issue 2 years ago • 14 comments

…erride value

ss75710541 avatar Mar 15 '22 07:03 ss75710541

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 15 '22 07:03 CLAassistant

Is there a way to use this already? How can I help push this forward?

joaogl avatar Mar 24 '22 18:03 joaogl

@joaogl I made a Docker image based on my code branch

code branch: https://github.com/paradeum-team/argocd-notifications/tree/jyliu

image: quay.io/netwarps/argocd-notifications:v1.2.1.1

ss75710541 avatar Mar 25 '22 02:03 ss75710541

hi, @ss75710541 i tested your version because im very interesting by this feature and im still faced same issues i receive default value and not override values Regards

tyki6 avatar Apr 06 '22 12:04 tyki6

my notification:

templates: 
  template.app-deployed: |
    webhook:
      alpha:
        method: POST
        body: |
          {
            "attachments": [{
              "title": "{{ .app.metadata.name}}",
              "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
              "color": "#18be52",
              "fields": [
              {
                "title": "Git TAG",
                "value": "{{(call .repo.GetAppDetails).Helm.GetParameterValueByName "image.tag"}}",
                "short": true
              }
              ]
            }]
          }

my application:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: test
  namespace: argocd
  annotations:
    argocd.argoproj.io/sync-wave: "3"
    notifications.argoproj.io/subscribe.on-deployed.alpha: ""
spec:
  source:
    path: golang
    repoURL: {{ .Values.apps_repo }}
    targetRevision: aws
    helm:
      releaseName: test
      values:         |
        nameOverride: test
        fullnameOverride: test
        imagePullSecrets:
        - name: regcred
        image:
          repository: my-img
          tag: 2.0.13
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
  destination:
    name: {{ .Values.cluster }}
    namespace: test
  project: default

tyki6 avatar Apr 06 '22 12:04 tyki6

@mBouamama Did you test with the Docker image I typed? Or docker image yourself building to the code? Is jyliu branch not selected?

ss75710541 avatar Apr 06 '22 12:04 ss75710541

@mBouamama git clone https://github.com/paradeum-team/argocd-notifications.git cd argocd-notifications git checkout jyliu

ss75710541 avatar Apr 06 '22 12:04 ss75710541

@ss75710541 i tested with our image quay.io/netwarps/argocd-notifications:v1.2.1.1

tyki6 avatar Apr 06 '22 12:04 tyki6

@mBouamama Well, I solved helm. Parameters values, not helm.values

ss75710541 avatar Apr 06 '22 12:04 ss75710541

ah ok do you will fix .Helm.GetParameterValueByName too or i need to do that by my self? Regards

tyki6 avatar Apr 06 '22 13:04 tyki6

@mBouamama You can try to fix it out yourself first. I've been busy lately.

ss75710541 avatar Apr 06 '22 13:04 ss75710541

ok thx have good day @ss75710541 thx for your work!

tyki6 avatar Apr 06 '22 13:04 tyki6

@tyki6 I changed the code to add get helm.values Priority values helm.values > helm.parameters > default helm.parameters test image quay.io/netwarps/argocd-notifications:v1.2.1.4

ss75710541 avatar Apr 27 '22 08:04 ss75710541

@ss75710541 i tested and my problem is solved thx a lot(s you did an amazing job. Regards

tyki6 avatar Apr 27 '22 15:04 tyki6