From 04fd72418a0150bda3888b4ec975f1694d3cc117 Mon Sep 17 00:00:00 2001 From: Akash Jain <15995028+akash-jain-10@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:44:58 +0530 Subject: [PATCH] fix: Indentation Issue for Cron Jobs (#295) * fix: Indentation Issue for Cron Jobs * fix: Helm Lint issues fixed --- .../templates/cron-deploy-pipelines.yaml | 132 ++++++++++++++ .../openmetadata/templates/cron-reindex.yaml | 166 +++++++++--------- .../templates/cron_deploy_pipeline.yaml | 133 -------------- 3 files changed, 216 insertions(+), 215 deletions(-) create mode 100644 charts/openmetadata/templates/cron-deploy-pipelines.yaml delete mode 100644 charts/openmetadata/templates/cron_deploy_pipeline.yaml diff --git a/charts/openmetadata/templates/cron-deploy-pipelines.yaml b/charts/openmetadata/templates/cron-deploy-pipelines.yaml new file mode 100644 index 0000000..f18619f --- /dev/null +++ b/charts/openmetadata/templates/cron-deploy-pipelines.yaml @@ -0,0 +1,132 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: cron-deploy-pipelines + labels: + {{- include "OpenMetadata.labels" . | nindent 4 }} + {{- with .Values.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + suspend: true + failedJobsHistoryLimit: 1 + successfulJobsHistoryLimit: 1 + jobTemplate: + metadata: + name: cron-deploy-pipelines + spec: + selector: + matchLabels: + {{- include "OpenMetadata.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 12 }} + {{- end }} + labels: + {{- include "OpenMetadata.labels" . | nindent 12 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 12 }} + {{- end }} + serviceAccountName: {{ include "OpenMetadata.serviceAccountName" . }} + {{- if not (.Values.automountServiceAccountToken) }} + automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 12 }} + volumes: + {{- include "tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 12 }} + containers: + - name: cron-deploy-pipelines + securityContext: + {{- toYaml .Values.securityContext | nindent 14 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + command: + {{ include "OpenMetadata.buildDeployPipelinesCommand" . | nindent 12 }} + env: + {{- include "OpenMetadata.configs" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + envFrom: + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-config-secret + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-omd-secret + {{- if .Values.openmetadata.config.database.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-db-secret + {{- end }} + {{- if .Values.openmetadata.config.elasticsearch.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-search-secret + {{- end }} + {{- if .Values.openmetadata.config.authorizer.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-authorizer-secret + {{- end }} + {{- if .Values.openmetadata.config.secretsManager.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-secretsmanager-secret + {{- end }} + {{- if .Values.openmetadata.config.web.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-web-secret + {{- end }} + {{- if .Values.openmetadata.config.authentication.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-authentication-secret + {{- end }} + {{- if .Values.openmetadata.config.eventMonitor.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-eventmonitor-secret + {{- end }} + {{- if .Values.openmetadata.config.pipelineServiceClientConfig.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-pipeline-secret + {{- end }} + {{- if .Values.openmetadata.config.smtpConfig.enableSmtpServer }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-smtp-secret + {{- end }} + {{- if .Values.openmetadata.config.jwtTokenConfiguration.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-jwt-secret + {{- end }} + {{- with .Values.openmetadata.config.fernetkey }} + {{- if not .secretRef }} + - secretRef: + name: {{ include "OpenMetadata.fullname" $ }}-fernetkey-secret + {{- end }} + {{- end }} + {{- with .Values.envFrom }} + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 14 }} + {{- if .Values.sidecars }} + {{- include "tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 10 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 12 }} + {{- end }} + restartPolicy: OnFailure + schedule: "0/5 * * * *" diff --git a/charts/openmetadata/templates/cron-reindex.yaml b/charts/openmetadata/templates/cron-reindex.yaml index aee1e57..e6ceb71 100644 --- a/charts/openmetadata/templates/cron-reindex.yaml +++ b/charts/openmetadata/templates/cron-reindex.yaml @@ -3,10 +3,10 @@ kind: CronJob metadata: name: cron-reindex labels: - {{- include "OpenMetadata.labels" . | indent 4 }} + {{- include "OpenMetadata.labels" . | nindent 4 }} {{- with .Values.deploymentAnnotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 8 }} {{- end }} spec: suspend: true @@ -23,108 +23,110 @@ spec: metadata: {{- with .Values.podAnnotations }} annotations: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 12 }} {{- end }} labels: - {{- include "OpenMetadata.labels" . | indent 8 }} + {{- include "OpenMetadata.labels" . | indent 12 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 12 }} {{- end }} serviceAccountName: {{ include "OpenMetadata.serviceAccountName" . }} {{- if not (.Values.automountServiceAccountToken) }} - automountServiceAccountToken: {{ .Values.automountServiceAccountToken}} + automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} + volumes: + {{- include "tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 12 }} containers: - - name: cron-reindex - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 16 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - volumeMounts: - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 10 }} + - name: cron-reindex + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 14 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + command: + {{ include "OpenMetadata.buildReindexCommand" . | nindent 12 }} + env: + {{- include "OpenMetadata.configs" . | nindent 12 }} + {{- with .Values.extraEnvs }} + {{- toYaml . | nindent 12 }} + {{- end }} + envFrom: + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-config-secret + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-omd-secret + {{- if .Values.openmetadata.config.database.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-db-secret {{- end }} - command: - {{ include "OpenMetadata.buildReindexCommand" . | nindent 16 }} - env: - {{- include "OpenMetadata.configs" . | nindent 16 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 10 }} + {{- if .Values.openmetadata.config.elasticsearch.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-search-secret {{- end }} - envFrom: - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-config-secret - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-omd-secret - {{- if .Values.openmetadata.config.database.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-db-secret - {{- end }} - {{- if .Values.openmetadata.config.elasticsearch.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-search-secret - {{- end }} - {{- if .Values.openmetadata.config.authorizer.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-authorizer-secret - {{- end }} - {{- if .Values.openmetadata.config.secretsManager.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-secretsmanager-secret - {{- end }} - {{- if .Values.openmetadata.config.web.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-web-secret - {{- end }} - {{- if .Values.openmetadata.config.authentication.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-authentication-secret - {{- end }} - {{- if .Values.openmetadata.config.eventMonitor.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-eventmonitor-secret - {{- end }} - {{- if .Values.openmetadata.config.pipelineServiceClientConfig.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-pipeline-secret - {{- end }} - {{- if .Values.openmetadata.config.smtpConfig.enableSmtpServer }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-smtp-secret - {{- end }} - {{- if .Values.openmetadata.config.jwtTokenConfiguration.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-jwt-secret - {{- end }} - {{- with .Values.openmetadata.config.fernetkey }} - {{- if not .secretRef }} - - secretRef: - name: {{ include "OpenMetadata.fullname" $ }}-fernetkey-secret - {{- end }} - {{- end }} - {{- with .Values.envFrom }} - {{- toYaml . | nindent 10 }} - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 16 }} - {{- if .Values.sidecars }} - {{- include "tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} + {{- if .Values.openmetadata.config.authorizer.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-authorizer-secret + {{- end }} + {{- if .Values.openmetadata.config.secretsManager.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-secretsmanager-secret + {{- end }} + {{- if .Values.openmetadata.config.web.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-web-secret + {{- end }} + {{- if .Values.openmetadata.config.authentication.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-authentication-secret + {{- end }} + {{- if .Values.openmetadata.config.eventMonitor.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-eventmonitor-secret + {{- end }} + {{- if .Values.openmetadata.config.pipelineServiceClientConfig.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-pipeline-secret + {{- end }} + {{- if .Values.openmetadata.config.smtpConfig.enableSmtpServer }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-smtp-secret + {{- end }} + {{- if .Values.openmetadata.config.jwtTokenConfiguration.enabled }} + - secretRef: + name: {{ include "OpenMetadata.fullname" . }}-jwt-secret + {{- end }} + {{- with .Values.openmetadata.config.fernetkey }} + {{- if not .secretRef }} + - secretRef: + name: {{ include "OpenMetadata.fullname" $ }}-fernetkey-secret + {{- end }} + {{- end }} + {{- with .Values.envFrom }} + {{- toYaml . | nindent 14 }} + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 14 }} + {{- if .Values.sidecars }} + {{- include "tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 10 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.tolerations }} tolerations: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: OnFailure schedule: "0/5 * * * *" \ No newline at end of file diff --git a/charts/openmetadata/templates/cron_deploy_pipeline.yaml b/charts/openmetadata/templates/cron_deploy_pipeline.yaml deleted file mode 100644 index d1a0e66..0000000 --- a/charts/openmetadata/templates/cron_deploy_pipeline.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: cron-deploy-pipelines - labels: - {{- include "OpenMetadata.labels" . | indent 4 }} - {{- with .Values.deploymentAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} - -spec: - suspend: true - failedJobsHistoryLimit: 1 - successfulJobsHistoryLimit: 1 - jobTemplate: - metadata: - name: cron-deploy-pipelines - spec: - selector: - matchLabels: - {{- include "OpenMetadata.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "OpenMetadata.labels" . | indent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "OpenMetadata.serviceAccountName" . }} - {{- if not (.Values.automountServiceAccountToken) }} - automountServiceAccountToken: {{ .Values.automountServiceAccountToken}} - {{- end }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - volumes: - {{- include "tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 16 }} - containers: - - name: cron-deploy-pipelines - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 16 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - volumeMounts: - {{- with .Values.extraVolumeMounts }} - {{- toYaml . | nindent 10 }} - {{- end }} - command: - {{ include "OpenMetadata.buildDeployPipelinesCommand" . | nindent 16 }} - env: - {{- include "OpenMetadata.configs" . | nindent 16 }} - {{- with .Values.extraEnvs }} - {{- toYaml . | nindent 10 }} - {{- end }} - envFrom: - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-config-secret - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-omd-secret - {{- if .Values.openmetadata.config.database.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-db-secret - {{- end }} - {{- if .Values.openmetadata.config.elasticsearch.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-search-secret - {{- end }} - {{- if .Values.openmetadata.config.authorizer.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-authorizer-secret - {{- end }} - {{- if .Values.openmetadata.config.secretsManager.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-secretsmanager-secret - {{- end }} - {{- if .Values.openmetadata.config.web.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-web-secret - {{- end }} - {{- if .Values.openmetadata.config.authentication.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-authentication-secret - {{- end }} - {{- if .Values.openmetadata.config.eventMonitor.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-eventmonitor-secret - {{- end }} - {{- if .Values.openmetadata.config.pipelineServiceClientConfig.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-pipeline-secret - {{- end }} - {{- if .Values.openmetadata.config.smtpConfig.enableSmtpServer }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-smtp-secret - {{- end }} - {{- if .Values.openmetadata.config.jwtTokenConfiguration.enabled }} - - secretRef: - name: {{ include "OpenMetadata.fullname" . }}-jwt-secret - {{- end }} - {{- with .Values.openmetadata.config.fernetkey }} - {{- if not .secretRef }} - - secretRef: - name: {{ include "OpenMetadata.fullname" $ }}-fernetkey-secret - {{- end }} - {{- end }} - {{- with .Values.envFrom }} - {{- toYaml . | nindent 10 }} - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 16 }} - {{- if .Values.sidecars }} - {{- include "tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - restartPolicy: OnFailure - schedule: "0/5 * * * *"