opf / helm-charts

OPF helm chart repository
https://charts.openproject.org
GNU General Public License v3.0
11 stars 23 forks source link

Seeder job incompatible with ArgoCD #30

Closed djerfy closed 1 year ago

djerfy commented 1 year ago

Hi,

I've a problem with the seeder job due to the random name:

https://github.com/opf/helm-charts/blob/d5292d681ce7dec7b517de5c669f5ce11c37c86d/charts/openproject/templates/seeder-job.yaml#L4

And in ArgoCD my application is always OutOfSync. Also the seeder job doesn't support annotation. This random name is mandatory?

Else can you implement seeder.annotations: {} option?

Thanks

machisuji commented 1 year ago

Hi @djerfy,

we have the dynamic name so that a new seeder job is run with every deployment. This is to make sure that the database has the correct schema and the latest seed data is installed.

I have found other ways of achieving this using hooks but found the solution a lot more complicated so I've opted for the simple solution. I'm open to suggestions, though.

In the meantime @oliverguenther was so kind as to add annotations for the seeder job as you suggested.

djerfy commented 1 year ago

Hi @djerfy,

we have the dynamic name so that a new seeder job is run with every deployment. This is to make sure that the database has the correct schema and the latest seed data is installed.

I have found other ways of achieving this using hooks but found the solution a lot more complicated so I've opted for the simple solution. I'm open to suggestions, though.

In the meantime @oliverguenther was so kind as to add annotations for the seeder job as you suggested.

Hi @machisuji,

Thank you for changes, good for me 👍

My configuration in ArgoCD:

seederJob:
  annotations:
    argocd.argoproj.io/hook: PreSync
    argocd.argoproj.io/hook-delete-policy: HookSucceeded