From 46d7ea8fc414a3b3371d37a03eb8a2ef55f6a3ed Mon Sep 17 00:00:00 2001 From: Abdallah Chatila Date: Fri, 3 Apr 2020 16:05:22 -0400 Subject: [PATCH] use the network interface name from CNI_IFNAME env. variable if networkName is not present in the delegate map Signed-off-by: Abdallah Chatila --- kactus/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kactus/main.go b/kactus/main.go index 54f52d3f..2422dd99 100644 --- a/kactus/main.go +++ b/kactus/main.go @@ -297,7 +297,7 @@ func clearPlugins(lastOkIdx int, idx int, argIfName string, delegates []map[stri return } - kc.LogDebug("clearPlugins: lastOkIdx=%d, idx=%d, argIfName=%s, networks=%v\n", lastOkIdx, idx, argIfName) + kc.LogDebug("clearPlugins: lastOkIdx=%d, idx=%d, argIfName=%s\n", lastOkIdx, idx, argIfName) for i := lastOkIdx + 1; i <= idx; i++ { delegateDel(argIfName, delegates[i]) } @@ -506,7 +506,7 @@ func validatePodNetworksConfig(networks []kc.NetworkConfig) (bool, error) { func getIfName(argsIfName string, delegate map[string]interface{}) string { var ifName string - if isMasterplugin(delegate) { + if isMasterplugin(delegate) || !isString(delegate["networkName"]) { ifName = argsIfName } else { ifName = kc.GetNetworkIfname(delegate["networkName"].(string))