<fix>[vrouter]: ZSTAC-85527 select callback IP for VR#4119
Closed
ZStack-Robot wants to merge 1 commit into
Closed
Conversation
Use a callback URL in the same IP family as the virtual router management NIC. This keeps IPv4-only vrouter agents reachable when MN is dual-stack and its default management IP is IPv6. Resolves: ZSTAC-85527 Change-Id: Iaa630fc59d30c2675db7bbe47cb1b7c8d58bb023
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
总体介绍本 PR 为虚拟路由器代理的异步 REST 调用引入了显式的回调 URL 请求头构建机制,新增了两个关键方法:RESTFacade 的 变更Virtual Router Agent Callback URL Headers
🎯 2 (Simple) | ⏱️ ~12 分钟
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix vrouter agent callbacks on dual-stack management networks when the vrouter
management NIC is IPv4 but MN default management IP is IPv6.
Root Cause
Cloud used the default REST callback URL for vrouter agent calls. In a dual-stack
MN environment this could send an IPv6 callback URL to an IPv4-only vrouter
management path, so the agent could not route callback traffic correctly.
Changes
RESTFacade.buildCallbackUrl(hostName)to build callback URLs for aselected management IP.
VirtualRouterManager.buildAgentCallbackUrlHeaders(mgmtNicIp)to selectthe callback IP family from the vrouter management NIC IP.
command paths.
Verification
mvn -pl utils,header,core,plugin/virtualRouterProvider -DskipTests compileGOWORK=off GOCACHE=/tmp/go-build GOMODCACHE=/tmp/go-mod GOFLAGS=-mod=mod PATH=/usr/local/go/bin:$PATH /usr/local/go/bin/go test . -run 'Test.*Route|Test.*Mgmt|Test.*Callback' -count=1inzstack-vyos/utils172.24.246.247:Running/ConnectedRunning/ConnectedResolves: ZSTAC-85527
sync from gitlab !10018