Skip to content

Commit

Permalink
Fix: always specify disk, even if system_disk not found
Browse files Browse the repository at this point in the history
fixes #4

Signed-off-by: Andrei Kvapil <[email protected]>
  • Loading branch information
kvaps committed May 30, 2024
1 parent 5651f91 commit e799168
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion charts/talm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{{- define "talm.discovered.system_disk_name" }}
{{- $disk := "" }}
{{- range .Disks }}
{{- if eq $disk "" }}
{{- $disk = .device_name }}
{{- end }}
{{- if .system_disk }}
{{- .device_name }}
{{- $disk = .device_name }}
{{- end }}
{{- end }}
{{- $disk }}
{{- end }}

{{- define "talm.discovered.machinetype" }}
Expand Down
7 changes: 6 additions & 1 deletion pkg/generated/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,16 @@ version: %s
description: A library Talm chart for Talos Linux
`,
"talm/templates/_helpers.tpl": `{{- define "talm.discovered.system_disk_name" }}
{{- $disk := "" }}
{{- range .Disks }}
{{- if eq $disk "" }}
{{- $disk = .device_name }}
{{- end }}
{{- if .system_disk }}
{{- .device_name }}
{{- $disk = .device_name }}
{{- end }}
{{- end }}
{{- $disk }}
{{- end }}
{{- define "talm.discovered.machinetype" }}
Expand Down

0 comments on commit e799168

Please sign in to comment.