From 668d526604b56059f9647e5f2226b09a2fed485b Mon Sep 17 00:00:00 2001 From: itsconquest Date: Tue, 17 May 2022 14:45:30 +1200 Subject: [PATCH] fix(networks): handle windows specific system networks [EE-2594] (#6922) --- api/http/proxy/factory/docker/networks.go | 2 +- app/constants.js | 2 +- app/docker/networks/network.helper.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/http/proxy/factory/docker/networks.go b/api/http/proxy/factory/docker/networks.go index 05df57589..2a49347b6 100644 --- a/api/http/proxy/factory/docker/networks.go +++ b/api/http/proxy/factory/docker/networks.go @@ -86,7 +86,7 @@ func findSystemNetworkResourceControl(networkObject map[string]interface{}) *por networkID := networkObject[networkObjectIdentifier].(string) networkName := networkObject[networkObjectName].(string) - if networkName == "bridge" || networkName == "host" || networkName == "none" { + if networkName == "bridge" || networkName == "host" || networkName == "ingress" || networkName == "nat" || networkName == "none" { return authorization.NewSystemResourceControl(networkID, portainer.NetworkResourceControl) } diff --git a/app/constants.js b/app/constants.js index 21e805eeb..0ff897a57 100644 --- a/app/constants.js +++ b/app/constants.js @@ -25,7 +25,7 @@ export const DEFAULT_TEMPLATES_URL = 'https://raw.githubusercontent.com/portaine export const PAGINATION_MAX_ITEMS = 10; export const APPLICATION_CACHE_VALIDITY = 3600; export const CONSOLE_COMMANDS_LABEL_PREFIX = 'io.portainer.commands.'; -export const PREDEFINED_NETWORKS = ['host', 'bridge', 'none']; +export const PREDEFINED_NETWORKS = ['host', 'bridge', 'ingress', 'nat', 'none']; export const KUBERNETES_DEFAULT_NAMESPACE = 'default'; export const KUBERNETES_SYSTEM_NAMESPACES = ['kube-system', 'kube-public', 'kube-node-lease', 'portainer']; export const PORTAINER_FADEOUT = 1500; diff --git a/app/docker/networks/network.helper.ts b/app/docker/networks/network.helper.ts index cba6b323d..761ab5320 100644 --- a/app/docker/networks/network.helper.ts +++ b/app/docker/networks/network.helper.ts @@ -1,4 +1,4 @@ -const systemNetworks = ['host', 'bridge', 'none']; +const systemNetworks = ['host', 'bridge', 'ingress', 'nat', 'none']; export function isSystemNetwork(networkName: string) { return systemNetworks.includes(networkName);