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

Need to consider if bridgeConfig changed the bridgeName #1

Open
tjjh89017 opened this issue Jul 16, 2023 · 2 comments
Open

Need to consider if bridgeConfig changed the bridgeName #1

tjjh89017 opened this issue Jul 16, 2023 · 2 comments

Comments

@tjjh89017
Copy link
Owner

https://github.com/tjjh89017/kvnet/blob/main/controllers/bridgeconfig_controller.go#L129-L134

bridgeConfig & UplinkConfig & VxlanConfig

easy way to deal with it
After findBridge, compare the brName and remove the Bridge before checking the add/update/delete

@tjjh89017
Copy link
Owner Author

delete Bridge CR and remove element from BridgeList after findBridge

@tjjh89017
Copy link
Owner Author

	for _, bridge := range bridges.Items {
		// get node name
		name := strings.Split(bridge.Name, ".")[0]
		// already have bridge
		nodeMap[name] |= 2
	}

to

	for _, bridge := range bridges.Items {
		// get node name
		name := strings.Split(bridge.Name, ".")[0]
		brName := strings.Split(bridge.Name, ".")[1]
		// already have bridge
		if brName == bridgeConfig.Spec.BridgeName {
			nodeMap[name] |= 2
		} else {
			// remove this bridge because bridge name is changed.
			// and don't mark it.
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant