Restart the container if it fails to setup the network on the desire interface.
This should probably be done on a liveness probe which checks if wlan0 has an inet4 address - although it could be possible to check for specific failures like the one below.
kubectl log -n turnkey <wifi-container>
+ getopts h flag
+ trap down SIGTERM
+ trap reset SIGUSR1
+ up
+ ip_up
+ ip link set wlan0 up
+ ip addr flush dev wlan0
+ /sbin/wpa_supplicant -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
rfkill: Cannot open RFKILL control device
rfkill: Cannot get wiphy information
nl80211: Failed to open /proc/sys/net/ipv4/conf/wlan0/drop_unicast_in_l2_multicast: Read-only file system
nl80211: Failed to set IPv4 unicast in multicast filter
nl80211: Failed to open /proc/sys/net/ipv4/conf/wlan0/drop_unicast_in_l2_multicast: Read-only file system
nl80211: Failed to set IPv4 unicast in multicast filter
wlan0: Trying to associate with SSID 'GL-AR750S-af8'
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
wlan0: CTRL-EVENT-DISCONNECTED bssid=e4:95:6e:49:9a:f8 reason=3 locally_generated=1
nl80211: Failed to open /proc/sys/net/ipv4/conf/wlan0/drop_unicast_in_l2_multicast: Read-only file system
nl80211: Failed to set IPv4 unicast in multicast filter
wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Restart the container if it fails to setup the network on the desire interface.
This should probably be done on a liveness probe which checks if wlan0 has an inet4 address - although it could be possible to check for specific failures like the one below.
kubectl log -n turnkey <wifi-container>