Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the logic for getting local networks in network-manager #9330

Closed
niusmallnan opened this issue Jul 13, 2017 · 1 comment
Closed

Fix the logic for getting local networks in network-manager #9330

niusmallnan opened this issue Jul 13, 2017 · 1 comment
Assignees
Labels
area/networking internal kind/enhancement Issues that improve or augment existing functionality

Comments

@niusmallnan
Copy link
Contributor

network/local.go in network-manager:

func LocalNetworks(mc metadata.Client) ([]metadata.Network, map[string]metadata.Container, error) {
...
...
	for _, service := range services {
		// Trick to select the primary service of the network plugin
		// stack
		// TODO: Need to check if it's needed for Calico?
		if !(service.Kind == "networkDriverService" &&
			service.Name == service.PrimaryServiceName) {
			continue
		}

		for _, aContainer := range service.Containers {
			if aContainer.HostUUID == host.UUID {
				routers[aContainer.NetworkUUID] = aContainer
				localNetworks[aContainer.NetworkUUID] = true
			}
		}
	}

	if len(localNetworks) == 0 {
		return nil, nil, nil
	}

	ret := []metadata.Network{}
	for _, aNetwork := range networks {
		if _, ok := localNetworks[aNetwork.UUID]; ok {
			ret = append(ret, aNetwork)
		}
	}
}

Here, sometimes we can not get the right localNetworks when using l2-flat or l3-routing netwoking.

@yasker
Copy link
Member

yasker commented Jul 18, 2017

Fixed by rancher/plugin-manager#78

@yasker yasker closed this as completed Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking internal kind/enhancement Issues that improve or augment existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants