Skip to content

Commit

Permalink
Don't use default:
Browse files Browse the repository at this point in the history
Helm recommends setting the default value
in the values.yaml.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Mar 30, 2024
1 parent c089a97 commit aa9ae1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tinkerbell/stack/templates/nginx.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if .Values.stack.enabled }}
{{- $sourceInterface := .Values.stack.relay.sourceInterface -}}
{{- $ifaceModes := dict "ipvlan" "" "macvlan" "" -}}
{{- $dhcpInterfaceType := default "macvlan" .Values.stack.relay.interfaceMode -}}
{{- $dhcpInterfaceType := .Values.stack.relay.interfaceMode -}}
{{- if not (hasKey $ifaceModes $dhcpInterfaceType) -}}
{{- fail "invalid value at .stack.relay.interfaceMode: valid modes include ipvlan and macvlan" -}}
{{- end -}}
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
{{- end }}
{{- if $listenBroadcast }}
initContainers:
- name: relay-macvlan-interface
- name: relay-broadcast-interface
command:
- /bin/sh
- -c
Expand All @@ -131,7 +131,7 @@ spec:
if [ -z "$srcInterface" ]; then
srcInterface=$(nsenter -t1 -n ip route | awk '/default/ {print $5}' | head -n1)
fi
# Create a macvlan interface. TODO: If this fails, try again with a different name?
# Create the interface. TODO: If this fails, try again with a different name?
{{- if eq $dhcpInterfaceType "ipvlan" }}
nsenter -t1 -n ip link add {{ $dhcpInterfaceName }} link ${srcInterface} type ipvlan mode l2
{{- else }}
Expand All @@ -140,7 +140,7 @@ spec:
# Move the interface into the POD.
pid=$(echo $$)
nsenter -t1 -n ip link set {{ $dhcpInterfaceName }} netns ${pid} || nsenter -t1 -n ip link delete {{ $dhcpInterfaceName }}
# Set the macvlan interface up
# Set the interface up
ip link set {{ $dhcpInterfaceName }} up
# Set the IP address
ip addr add 127.1.1.1/32 dev {{ $dhcpInterfaceName }} noprefixroute
Expand Down
2 changes: 1 addition & 1 deletion tinkerbell/stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ stack:
listenBroadcastTraffic: true
# interfaceMode determines how we create the interface needed to listen for DHCP broadcast traffic.
# by default macvlan is used. ipvlan is the only other option.
# interfaceMode: ipvlan
interfaceMode: macvlan

# -- Overrides
# The values defined here override those in the individual charts. Some of them require tweaking
Expand Down

0 comments on commit aa9ae1c

Please sign in to comment.