Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions internal/tools/template/helm_passthrough_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package template

import "testing"

func TestHelmChartPassesThroughVerbatim(t *testing.T) {
// The file that failed on krateo-057: publish-sock-shop-003 / microservices.yaml
// "create failed: unable to copy files: template: template:61: function \"toYaml\" not defined"
body := `resources:
{{- toYaml .Values.resources | nindent 4 }}
{{- include "chart.labels" . }}
{{/* a helpers.tpl header */}}
value: {{ .Values.name }}
`
got, err := Template(body).Render(map[string]any{})
if err != nil {
t.Fatalf("a Helm chart must commit verbatim, got render error: %v", err)
}
if string(got) != body {
t.Errorf("content was altered.\n--- want ---\n%s\n--- got ---\n%s", body, got)
}
}
Loading