Skip to content

Commit

Permalink
Filters virtual interfaces and disks in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed May 15, 2024
1 parent 94a69bc commit 95562bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion charts/talm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
{{- define "talm.discovered.disks_info" }}
# -- Discovered disks:
{{- range .Disks }}
{{- if not (regexMatch "^/dev/(zd)" .device_name) }}
# {{ .device_name }}:
# model: {{ .model }}
# serial: {{ .serial }}
# wwid: {{ .wwid }}
# size: {{ include "talm.human_size" .size }}
{{- end }}
{{- end }}
{{- end }}

{{- define "talm.human_size" }}
{{- $bytes := int64 . }}
Expand Down Expand Up @@ -65,7 +67,7 @@
{{- define "talm.discovered.physical_links_info" }}
# -- Discovered interfaces:
{{- range (lookup "links" "" "").items }}
{{- if regexMatch "^(eno|eth|enp|enx|ens)" .metadata.id }}
{{- if and .spec.busPath (regexMatch "^(eno|eth|enp|enx|ens)" .metadata.id) }}
# enx{{ .spec.hardwareAddr | replace ":" "" }}:
# id: {{ .metadata.id }}
# hardwareAddr:{{ .spec.hardwareAddr }}
Expand Down
4 changes: 3 additions & 1 deletion pkg/generated/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,15 @@ description: A library Talm chart for Talos Linux
{{- define "talm.discovered.disks_info" }}
# -- Discovered disks:
{{- range .Disks }}
{{- if not (regexMatch "^/dev/(zd)" .device_name) }}
# {{ .device_name }}:
# model: {{ .model }}
# serial: {{ .serial }}
# wwid: {{ .wwid }}
# size: {{ include "talm.human_size" .size }}
{{- end }}
{{- end }}
{{- end }}
{{- define "talm.human_size" }}
{{- $bytes := int64 . }}
Expand Down Expand Up @@ -279,7 +281,7 @@ description: A library Talm chart for Talos Linux
{{- define "talm.discovered.physical_links_info" }}
# -- Discovered interfaces:
{{- range (lookup "links" "" "").items }}
{{- if regexMatch "^(eno|eth|enp|enx|ens)" .metadata.id }}
{{- if and .spec.busPath (regexMatch "^(eno|eth|enp|enx|ens)" .metadata.id) }}
# enx{{ .spec.hardwareAddr | replace ":" "" }}:
# id: {{ .metadata.id }}
# hardwareAddr:{{ .spec.hardwareAddr }}
Expand Down

0 comments on commit 95562bd

Please sign in to comment.