luci-app-dockerman: check for existing IPAM config
authorDaniel Nilsson <daniel.nilsson94@outlook.com>
Sun, 17 Mar 2024 21:14:34 +0000 (22:14 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 26 Mar 2024 08:56:13 +0000 (09:56 +0100)
This was added in upstream with https://github.com/lisaac/luci-app-dockerman/commit/7292955a1b415bb60fa2e403bb3a437b4b7f7846 so should be fine for us to add it.

Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
(cherry picked from commit a5d7ce06f96436dcf02970d5df8c68b65968e37c)

applications/luci-app-dockerman/Makefile
applications/luci-app-dockerman/luasrc/model/cbi/dockerman/networks.lua

index f4d103086026c6a84471a40ebf67732a4c6b2fc0..5556ea590e434b40d318d6a8f3ce3b41b57cf0ed 100644 (file)
@@ -12,7 +12,7 @@ PKG_LICENSE:=AGPL-3.0
 PKG_MAINTAINER:=lisaac <lisaac.cn@gmail.com> \
                Florian Eckert <fe@dev.tdt.de>
 
-PKG_VERSION:=v0.5.13-20230114
+PKG_VERSION:=v0.5.13-20240317
 
 include ../../luci.mk
 
index 007e087424ee325c6885d9c8bc8aafbbd2277145..f54acbd16d31af3bfb2edf675d734b05c0e281ed 100644 (file)
@@ -38,8 +38,8 @@ local get_networks = function ()
                        data[index]["_interface"] = v.Options.parent
                end
 
-               data[index]["_subnet"] = v.IPAM and v.IPAM.Config[1] and v.IPAM.Config[1].Subnet or nil
-               data[index]["_gateway"] = v.IPAM and v.IPAM.Config[1] and v.IPAM.Config[1].Gateway or nil
+               data[index]["_subnet"] = v.IPAM and v.IPAM.Config and v.IPAM.Config[1] and v.IPAM.Config[1].Subnet or nil
+               data[index]["_gateway"] = v.IPAM and v.IPAM.Config and v.IPAM.Config[1] and v.IPAM.Config[1].Gateway or nil
        end
 
        return data