crds-catalog/templates/all.json.tmpl

18 lines
616 B
Cheetah
Raw Normal View History

{
"{{ ds "type" }}": [
{{- $path := ds "source" }}
{{- $filelist := coll.Slice }}
{{- range $item := file.ReadDir $path }}
{{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }}
{{- $filelist = $filelist | coll.Append $item }}
{{- end }}
{{- $last := sub (len $filelist) 1 }}
{{- range $i, $item := $filelist | coll.Sort }}
{{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }}
{
"$ref": "https://gitea.rknet.org/infra/crds-catalog/raw/branch/catalog/{{ $path | path.Base }}/{{ $item }}"
}{{ if ne $i $last }},{{ end }}
{{- end }}
]
}