Skip to content

Commit

Permalink
Merge pull request #3 from kaloom/getIfName
Browse files Browse the repository at this point in the history
make sure delegate["networkName"] is present when getting an interface name
  • Loading branch information
kmabda committed Apr 3, 2020
2 parents 238b393 + 46d7ea8 commit f18fb1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kactus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit f18fb1e

Please sign in to comment.