Skip to content

[client] Fix legacy routes when connecting to mgmt servers older than v0.30.0 #3854

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

Merged
merged 1 commit into from
May 21, 2025

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented May 21, 2025

Describe your changes

v0.40.0 switched the order of applying ACLs and routes, making setting up legacy management too late. So, we moved it to an earlier place in the network map update.

Issue ticket number and link

Fixes #3841

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 10:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes handling of legacy routes when a client connects to management servers older than v0.30.0 by centralizing the legacy flag logic in the engine and removing duplicate code in the ACL manager.

  • Add legacy management flag logic in Engine.updateNetworkMap before applying routes
  • Remove redundant legacy flag handling from DefaultManager.ApplyFiltering

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
client/internal/engine.go Added check for legacy management servers and set firewall flag before routes
client/internal/acl/manager.go Removed duplicate legacy flag logic from ACL manager
Comments suppressed due to low confidence (1)

client/internal/engine.go:965

  • Consider adding unit tests to verify that SetLegacyManagement is invoked when connecting to management servers older than v0.30.0 (i.e., when RoutesFirewallRules is empty but RoutesFirewallRulesIsEmpty is false).
isLegacy := len(networkMap.RoutesFirewallRules) == 0 && !networkMap.RoutesFirewallRulesIsEmpty

Copy link

@lixmal lixmal merged commit e806d9d into main May 21, 2025
32 checks passed
@lixmal lixmal deleted the fix-legacy-routes branch May 21, 2025 11:48
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

Successfully merging this pull request may close these issues.

Routing peer broken from 0.40.0 onwards
2 participants