diff --git a/examples/app/templates/batch-job.yaml b/examples/app/templates/batch-job.yaml index d85dbbde..c5aeb49c 100644 --- a/examples/app/templates/batch-job.yaml +++ b/examples/app/templates/batch-job.yaml @@ -21,4 +21,4 @@ spec: | default .Chart.AppVersion }} name: pi resources: {} - restartPolicy: Never \ No newline at end of file + restartPolicy: Never diff --git a/examples/app/templates/cron-job.yaml b/examples/app/templates/cron-job.yaml index 453b05a2..bd0f073a 100644 --- a/examples/app/templates/cron-job.yaml +++ b/examples/app/templates/cron-job.yaml @@ -23,4 +23,4 @@ spec: name: hello resources: {} restartPolicy: OnFailure - schedule: {{ .Values.cronJob.schedule | quote }} \ No newline at end of file + schedule: {{ .Values.cronJob.schedule | quote }} diff --git a/examples/app/templates/daemonset.yaml b/examples/app/templates/daemonset.yaml index d1e1c39b..e26e64b8 100644 --- a/examples/app/templates/daemonset.yaml +++ b/examples/app/templates/daemonset.yaml @@ -43,4 +43,4 @@ spec: name: varlog - hostPath: path: /var/lib/docker/containers - name: varlibdockercontainers \ No newline at end of file + name: varlibdockercontainers diff --git a/examples/app/templates/deployment.yaml b/examples/app/templates/deployment.yaml index e8a456c5..4d691eb3 100644 --- a/examples/app/templates/deployment.yaml +++ b/examples/app/templates/deployment.yaml @@ -109,4 +109,4 @@ spec: secretName: {{ include "app.fullname" . }}-my-secret-ca - name: sample-pv-storage persistentVolumeClaim: - claimName: {{ include "app.fullname" . }}-my-sample-pv-claim \ No newline at end of file + claimName: {{ include "app.fullname" . }}-my-sample-pv-claim diff --git a/examples/app/templates/my-config-props.yaml b/examples/app/templates/my-config-props.yaml index 7ad1ed91..af3564c4 100644 --- a/examples/app/templates/my-config-props.yaml +++ b/examples/app/templates/my-config-props.yaml @@ -8,4 +8,4 @@ data: my.prop1: {{ .Values.myConfigProps.myProp1 | quote }} my.prop2: {{ .Values.myConfigProps.myProp2 | quote }} my.prop3: {{ .Values.myConfigProps.myProp3 | quote }} - myval.yaml: {{ .Values.myConfigProps.myvalYaml | toYaml | indent 1 }} \ No newline at end of file + myval.yaml: {{ .Values.myConfigProps.myvalYaml | toYaml | indent 1 }} diff --git a/examples/app/templates/my-config.yaml b/examples/app/templates/my-config.yaml index 47ddd6c3..8fcb2257 100644 --- a/examples/app/templates/my-config.yaml +++ b/examples/app/templates/my-config.yaml @@ -9,4 +9,4 @@ data: dummyconfigmapkey: {{ .Values.myConfig.dummyconfigmapkey | quote }} my_config.properties: | health.healthProbeBindAddress={{ .Values.myConfig.myConfigProperties.health.healthProbeBindAddress | quote }} - metrics.bindAddress={{ .Values.myConfig.myConfigProperties.metrics.bindAddress | quote }} \ No newline at end of file + metrics.bindAddress={{ .Values.myConfig.myConfigProperties.metrics.bindAddress | quote }} diff --git a/examples/app/templates/my-sample-pv-claim.yaml b/examples/app/templates/my-sample-pv-claim.yaml index b48ddd7b..4f52287f 100644 --- a/examples/app/templates/my-sample-pv-claim.yaml +++ b/examples/app/templates/my-sample-pv-claim.yaml @@ -12,4 +12,4 @@ spec: storage: {{ .Values.pvc.mySamplePvClaim.storageLimit | quote }} requests: storage: {{ .Values.pvc.mySamplePvClaim.storageRequest | quote }} - storageClassName: {{ .Values.pvc.mySamplePvClaim.storageClass | quote }} \ No newline at end of file + storageClassName: {{ .Values.pvc.mySamplePvClaim.storageClass | quote }} diff --git a/examples/app/templates/my-secret-ca.yaml b/examples/app/templates/my-secret-ca.yaml index 19ee3fb2..285c5e57 100644 --- a/examples/app/templates/my-secret-ca.yaml +++ b/examples/app/templates/my-secret-ca.yaml @@ -7,4 +7,4 @@ metadata: data: ca.crt: {{ required "mySecretCa.caCrt is required" .Values.mySecretCa.caCrt | b64enc | quote }} -type: opaque \ No newline at end of file +type: opaque diff --git a/examples/app/templates/my-secret-vars.yaml b/examples/app/templates/my-secret-vars.yaml index aec5b231..df350e51 100644 --- a/examples/app/templates/my-secret-vars.yaml +++ b/examples/app/templates/my-secret-vars.yaml @@ -14,4 +14,4 @@ data: stringData: str: {{ required "mySecretVars.str is required" .Values.mySecretVars.str | quote }} -type: opaque \ No newline at end of file +type: opaque diff --git a/examples/app/templates/myapp-ingress.yaml b/examples/app/templates/myapp-ingress.yaml index 2c7975dd..826912d3 100644 --- a/examples/app/templates/myapp-ingress.yaml +++ b/examples/app/templates/myapp-ingress.yaml @@ -16,4 +16,4 @@ spec: port: number: 8443 path: /testpath - pathType: Prefix \ No newline at end of file + pathType: Prefix diff --git a/examples/app/templates/myapp-lb-service.yaml b/examples/app/templates/myapp-lb-service.yaml index 3968414e..5a8b9bbb 100644 --- a/examples/app/templates/myapp-lb-service.yaml +++ b/examples/app/templates/myapp-lb-service.yaml @@ -13,4 +13,4 @@ spec: ports: {{- .Values.myappLbService.ports | toYaml | nindent 2 }} loadBalancerSourceRanges: - {{- .Values.myappLbService.loadBalancerSourceRanges | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.myappLbService.loadBalancerSourceRanges | toYaml | nindent 2 }} diff --git a/examples/app/templates/myapp-pdb.yaml b/examples/app/templates/myapp-pdb.yaml index f28250da..cc17f21b 100644 --- a/examples/app/templates/myapp-pdb.yaml +++ b/examples/app/templates/myapp-pdb.yaml @@ -11,4 +11,4 @@ spec: selector: matchLabels: app: nginx - {{- include "app.selectorLabels" . | nindent 6 }} \ No newline at end of file + {{- include "app.selectorLabels" . | nindent 6 }} diff --git a/examples/app/templates/myapp-service.yaml b/examples/app/templates/myapp-service.yaml index 4642995f..1370ab26 100644 --- a/examples/app/templates/myapp-service.yaml +++ b/examples/app/templates/myapp-service.yaml @@ -11,4 +11,4 @@ spec: app: myapp {{- include "app.selectorLabels" . | nindent 4 }} ports: - {{- .Values.myappService.ports | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.myappService.ports | toYaml | nindent 2 }} diff --git a/examples/app/templates/nginx.yaml b/examples/app/templates/nginx.yaml index 63f84b98..6dec9d93 100644 --- a/examples/app/templates/nginx.yaml +++ b/examples/app/templates/nginx.yaml @@ -11,4 +11,4 @@ spec: app: nginx {{- include "app.selectorLabels" . | nindent 4 }} ports: - {{- .Values.nginx.ports | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.nginx.ports | toYaml | nindent 2 }} diff --git a/examples/app/templates/statefulset.yaml b/examples/app/templates/statefulset.yaml index 02f33e8f..418c0d28 100644 --- a/examples/app/templates/statefulset.yaml +++ b/examples/app/templates/statefulset.yaml @@ -37,4 +37,4 @@ spec: spec: accessModes: - ReadWriteOnce - resources: {{ .Values.web.volumeClaims.www | toYaml | nindent 8 }} \ No newline at end of file + resources: {{ .Values.web.volumeClaims.www | toYaml | nindent 8 }} diff --git a/examples/operator/templates/cephvolume-crd.yaml b/examples/operator/templates/cephvolume-crd.yaml index 4b187e37..4f17b6bc 100644 --- a/examples/operator/templates/cephvolume-crd.yaml +++ b/examples/operator/templates/cephvolume-crd.yaml @@ -219,4 +219,4 @@ status: kind: "" plural: "" conditions: [] - storedVersions: [] \ No newline at end of file + storedVersions: [] diff --git a/examples/operator/templates/configmap-vars.yaml b/examples/operator/templates/configmap-vars.yaml index d6adbc53..94f4e5f4 100644 --- a/examples/operator/templates/configmap-vars.yaml +++ b/examples/operator/templates/configmap-vars.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "operator.labels" . | nindent 4 }} data: - VAR4: {{ .Values.configmapVars.var4 | quote }} \ No newline at end of file + VAR4: {{ .Values.configmapVars.var4 | quote }} diff --git a/examples/operator/templates/deployment.yaml b/examples/operator/templates/deployment.yaml index e74a7dca..67400bb0 100644 --- a/examples/operator/templates/deployment.yaml +++ b/examples/operator/templates/deployment.yaml @@ -111,4 +111,4 @@ spec: name: manager-config - name: secret-volume secret: - secretName: {{ include "operator.fullname" . }}-secret-ca \ No newline at end of file + secretName: {{ include "operator.fullname" . }}-secret-ca diff --git a/examples/operator/templates/leader-election-rbac.yaml b/examples/operator/templates/leader-election-rbac.yaml index 2d2b7aba..2f1ed8f9 100644 --- a/examples/operator/templates/leader-election-rbac.yaml +++ b/examples/operator/templates/leader-election-rbac.yaml @@ -50,4 +50,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "operator.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file + namespace: '{{ .Release.Namespace }}' diff --git a/examples/operator/templates/manager-aggregated-rbac.yaml b/examples/operator/templates/manager-aggregated-rbac.yaml index 12c21374..a870372c 100644 --- a/examples/operator/templates/manager-aggregated-rbac.yaml +++ b/examples/operator/templates/manager-aggregated-rbac.yaml @@ -11,4 +11,4 @@ aggregationRule: operator: In values: - my-operator -rules: [] \ No newline at end of file +rules: [] diff --git a/examples/operator/templates/manager-config.yaml b/examples/operator/templates/manager-config.yaml index 6a6674c9..dfc1bb02 100644 --- a/examples/operator/templates/manager-config.yaml +++ b/examples/operator/templates/manager-config.yaml @@ -7,4 +7,4 @@ metadata: data: controller_manager_config.yaml: {{ .Values.managerConfig.controllerManagerConfigYaml | toYaml | indent 1 }} - dummyconfigmapkey: {{ .Values.managerConfig.dummyconfigmapkey | quote }} \ No newline at end of file + dummyconfigmapkey: {{ .Values.managerConfig.dummyconfigmapkey | quote }} diff --git a/examples/operator/templates/manager-rbac.yaml b/examples/operator/templates/manager-rbac.yaml index 56110574..8a59b24d 100644 --- a/examples/operator/templates/manager-rbac.yaml +++ b/examples/operator/templates/manager-rbac.yaml @@ -99,4 +99,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "operator.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file + namespace: '{{ .Release.Namespace }}' diff --git a/examples/operator/templates/manifestcephvolume-crd.yaml b/examples/operator/templates/manifestcephvolume-crd.yaml index 64abcc41..3a5fcb50 100644 --- a/examples/operator/templates/manifestcephvolume-crd.yaml +++ b/examples/operator/templates/manifestcephvolume-crd.yaml @@ -89,4 +89,4 @@ status: kind: "" plural: "" conditions: [] - storedVersions: [] \ No newline at end of file + storedVersions: [] diff --git a/examples/operator/templates/metrics-reader-rbac.yaml b/examples/operator/templates/metrics-reader-rbac.yaml index 46700439..99aaa4b7 100644 --- a/examples/operator/templates/metrics-reader-rbac.yaml +++ b/examples/operator/templates/metrics-reader-rbac.yaml @@ -8,4 +8,4 @@ rules: - nonResourceURLs: - /metrics verbs: - - get \ No newline at end of file + - get diff --git a/examples/operator/templates/metrics-service.yaml b/examples/operator/templates/metrics-service.yaml index c3738d1d..80206e9d 100644 --- a/examples/operator/templates/metrics-service.yaml +++ b/examples/operator/templates/metrics-service.yaml @@ -11,4 +11,4 @@ spec: control-plane: controller-manager {{- include "operator.selectorLabels" . | nindent 4 }} ports: - {{- .Values.metricsService.ports | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.metricsService.ports | toYaml | nindent 2 }} diff --git a/examples/operator/templates/mutating-webhook-configuration.yaml b/examples/operator/templates/mutating-webhook-configuration.yaml index d140c5f6..a639bd8c 100644 --- a/examples/operator/templates/mutating-webhook-configuration.yaml +++ b/examples/operator/templates/mutating-webhook-configuration.yaml @@ -26,4 +26,4 @@ webhooks: - UPDATE resources: - myclusters - sideEffects: None \ No newline at end of file + sideEffects: None diff --git a/examples/operator/templates/proxy-rbac.yaml b/examples/operator/templates/proxy-rbac.yaml index bf27bfbf..6bc9aa81 100644 --- a/examples/operator/templates/proxy-rbac.yaml +++ b/examples/operator/templates/proxy-rbac.yaml @@ -31,4 +31,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "operator.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file + namespace: '{{ .Release.Namespace }}' diff --git a/examples/operator/templates/pvc-lim.yaml b/examples/operator/templates/pvc-lim.yaml index c3f63404..6e06655e 100644 --- a/examples/operator/templates/pvc-lim.yaml +++ b/examples/operator/templates/pvc-lim.yaml @@ -10,4 +10,4 @@ spec: resources: requests: storage: {{ .Values.pvc.pvcLim.storageRequest | quote }} - storageClassName: {{ .Values.pvc.pvcLim.storageClass | quote }} \ No newline at end of file + storageClassName: {{ .Values.pvc.pvcLim.storageClass | quote }} diff --git a/examples/operator/templates/secret-ca.yaml b/examples/operator/templates/secret-ca.yaml index ddacf08a..3b145582 100644 --- a/examples/operator/templates/secret-ca.yaml +++ b/examples/operator/templates/secret-ca.yaml @@ -7,4 +7,4 @@ metadata: data: ca.crt: {{ required "secretCa.caCrt is required" .Values.secretCa.caCrt | b64enc | quote }} -type: opaque \ No newline at end of file +type: opaque diff --git a/examples/operator/templates/secret-registry-credentials.yaml b/examples/operator/templates/secret-registry-credentials.yaml index ef4fdad7..b3873613 100644 --- a/examples/operator/templates/secret-registry-credentials.yaml +++ b/examples/operator/templates/secret-registry-credentials.yaml @@ -7,4 +7,4 @@ metadata: data: .dockerconfigjson: {{ required "secretRegistryCredentials.dockerconfigjson is required" .Values.secretRegistryCredentials.dockerconfigjson | b64enc | quote }} -type: kubernetes.io/dockerconfigjson \ No newline at end of file +type: kubernetes.io/dockerconfigjson diff --git a/examples/operator/templates/secret-vars.yaml b/examples/operator/templates/secret-vars.yaml index f77878a2..afd03f4c 100644 --- a/examples/operator/templates/secret-vars.yaml +++ b/examples/operator/templates/secret-vars.yaml @@ -9,4 +9,4 @@ data: | quote }} VAR2: {{ required "secretVars.var2 is required" .Values.secretVars.var2 | b64enc | quote }} -type: opaque \ No newline at end of file +type: opaque diff --git a/examples/operator/templates/selfsigned-issuer.yaml b/examples/operator/templates/selfsigned-issuer.yaml index 39762061..6cfab8dc 100644 --- a/examples/operator/templates/selfsigned-issuer.yaml +++ b/examples/operator/templates/selfsigned-issuer.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "operator.labels" . | nindent 4 }} spec: - selfSigned: {} \ No newline at end of file + selfSigned: {} diff --git a/examples/operator/templates/serviceaccount.yaml b/examples/operator/templates/serviceaccount.yaml index 6496f72c..c06f9ead 100644 --- a/examples/operator/templates/serviceaccount.yaml +++ b/examples/operator/templates/serviceaccount.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "operator.labels" . | nindent 4 }} annotations: - {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} \ No newline at end of file + {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} diff --git a/examples/operator/templates/serving-cert.yaml b/examples/operator/templates/serving-cert.yaml index 8f10d150..8ea54abc 100644 --- a/examples/operator/templates/serving-cert.yaml +++ b/examples/operator/templates/serving-cert.yaml @@ -12,4 +12,4 @@ spec: issuerRef: kind: Issuer name: '{{ include "operator.fullname" . }}-selfsigned-issuer' - secretName: webhook-server-cert \ No newline at end of file + secretName: webhook-server-cert diff --git a/examples/operator/templates/validating-webhook-configuration.yaml b/examples/operator/templates/validating-webhook-configuration.yaml index e9f88d5d..6710ba7e 100644 --- a/examples/operator/templates/validating-webhook-configuration.yaml +++ b/examples/operator/templates/validating-webhook-configuration.yaml @@ -27,4 +27,4 @@ webhooks: - UPDATE resources: - volumes - sideEffects: None \ No newline at end of file + sideEffects: None diff --git a/examples/operator/templates/webhook-service.yaml b/examples/operator/templates/webhook-service.yaml index 57c90055..147b5eca 100644 --- a/examples/operator/templates/webhook-service.yaml +++ b/examples/operator/templates/webhook-service.yaml @@ -10,4 +10,4 @@ spec: control-plane: controller-manager {{- include "operator.selectorLabels" . | nindent 4 }} ports: - {{- .Values.webhookService.ports | toYaml | nindent 2 }} \ No newline at end of file + {{- .Values.webhookService.ports | toYaml | nindent 2 }} diff --git a/pkg/helm/chart.go b/pkg/helm/chart.go index 8d80eb9a..47a12fdb 100644 --- a/pkg/helm/chart.go +++ b/pkg/helm/chart.go @@ -97,6 +97,12 @@ func overwriteTemplateFile(filename, chartDir string, crd bool, templates []helm } } } + if len(templates) != 0 { + _, err = f.Write([]byte("\n")) + if err != nil { + return fmt.Errorf("%w: unable to write newline into %s", err, file) + } + } logrus.WithField("file", file).Info("overwritten") return nil }