fix(networks): handle windows specific system networks [EE-2594] (#6922)

pull/6708/head
itsconquest 3 years ago committed by GitHub
parent 0e257c200f
commit 668d526604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,7 +86,7 @@ func findSystemNetworkResourceControl(networkObject map[string]interface{}) *por
networkID := networkObject[networkObjectIdentifier].(string) networkID := networkObject[networkObjectIdentifier].(string)
networkName := networkObject[networkObjectName].(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) return authorization.NewSystemResourceControl(networkID, portainer.NetworkResourceControl)
} }

@ -25,7 +25,7 @@ export const DEFAULT_TEMPLATES_URL = 'https://raw.githubusercontent.com/portaine
export const PAGINATION_MAX_ITEMS = 10; export const PAGINATION_MAX_ITEMS = 10;
export const APPLICATION_CACHE_VALIDITY = 3600; export const APPLICATION_CACHE_VALIDITY = 3600;
export const CONSOLE_COMMANDS_LABEL_PREFIX = 'io.portainer.commands.'; 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_DEFAULT_NAMESPACE = 'default';
export const KUBERNETES_SYSTEM_NAMESPACES = ['kube-system', 'kube-public', 'kube-node-lease', 'portainer']; export const KUBERNETES_SYSTEM_NAMESPACES = ['kube-system', 'kube-public', 'kube-node-lease', 'portainer'];
export const PORTAINER_FADEOUT = 1500; export const PORTAINER_FADEOUT = 1500;

@ -1,4 +1,4 @@
const systemNetworks = ['host', 'bridge', 'none']; const systemNetworks = ['host', 'bridge', 'ingress', 'nat', 'none'];
export function isSystemNetwork(networkName: string) { export function isSystemNetwork(networkName: string) {
return systemNetworks.includes(networkName); return systemNetworks.includes(networkName);

Loading…
Cancel
Save