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

Using a timestamp on objects makes it hard to patch the helm chart #223

Closed
alfredopalhares opened this issue Nov 25, 2024 · 4 comments
Closed
Labels
question Further information is requested

Comments

@alfredopalhares
Copy link

Hello,

First of all, thank you for writing this helm chart, its very complete and its for sure helpful on deploying erpnext.

I am having an hard time patching the jobs because of the name having the date https://github.com/frappe/helm/blob/525ace58f629f1281f2f1c1aaa51462e2f4ff187/erpnext/templates/job-create-site.yaml#L5C2-L5C87 in the name makes it hard to do something like:

---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: erpnext
  namespace: flux-system
spec:
  interval: 10m
  timeout: 5m
  chart:
    spec:
      chart: erpnext
      version: "8.1.0"
      sourceRef:
        kind: HelmRepository
        name: frappe-charts
  releaseName: erpnext
  targetNamespace: erpnext
  install:
    createNamespace: true
    disableWait: false
    remediation:
      retries: 3
  upgrade:
    remediation:
      retries: 3
      strategy: rollback
  test:
    enable: true
  # https://github.com/frappe/helm/blob/main/erpnext/values.yaml
  values:
    persistence:
      worker:
        enabled: true
        size: 80Gi
        storageClass: openebs-hostpath
        accessModes:
          - ReadWriteMany
    mariadb:
      enabled: false
    postRenderers:
      - kustomize:
          patchesStrategicMerge:
            - kind: Job
              apiVersion: batch/v1
              metadata:
                name: erp-next-new-site-date
              spec:
                template:
                  initContainers:
                    - name: validate-config
                      env:
                        - name: "DB_HOST"
                          valueFrom:
                            secretKeyRef:
                              name: erpnext
                              key: PG_HOST
                        - name: "DB_PORT"
                          valueFrom:
                            secretKeyRef:
                              name: erpnext
                              key: PG_PORT
                  containers:
                    - name: create-site
                      env:
                        - name: "DB_HOST"
                          valueFrom:
                            secretKeyRef:
                              name: erpnext
                              key: PG_HOST
                        - name: "DB_PORT"
                          valueFrom:
                            secretKeyRef:
                              name: erpnext
                              key: PG_PORT

What do you suggest in this case? Is there a way to change the name to a fixed position ?

@alfredopalhares alfredopalhares added the question Further information is requested label Nov 25, 2024
@revant
Copy link
Collaborator

revant commented Nov 26, 2024

check .Values.jobs.custom.jobName

name: {{ .Values.jobs.custom.jobName }}

You can use that.

If you are willing to send a PR, add .Values.jobs.createSite.jobName and/or .Values.jobs.migrate.jobName, if that is set use it instead of auto generated name. Let the chart work as is if nothing is set. (no migration or backward compatibility overhead for others).

@revant
Copy link
Collaborator

revant commented Nov 29, 2024

@alfredopalhares

#224

will this solve your problem?

@alfredopalhares
Copy link
Author

Hello @revant , yes, that would be exactly what I need !

@revant revant closed this as completed Dec 1, 2024
@revant
Copy link
Collaborator

revant commented Dec 1, 2024

The chart will be released this week along with ERPNext version bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants