forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
优先级
🟡 中优先级
问题描述
OpenAPI schema 未指定 vni-id 字段必须大于 0。API 消费者可能尝试设置 VNI 为 0,但会被后端拒绝,导致混淆和错误。
影响范围
API 使用体验:
- API 文档不完整
- 客户端无法在发送前验证
- 错误反馈延迟到运行时
相关代码位置
- 文件:
api/v1/openapi.yaml:1252 - 后端验证:
pkg/endpoint/api/endpoint_api_manager.go:589(检查 VNI != 0) - PR: 7niu v1.19.0 rc.1 #6
当前状态
- Review 状态: @zbb88888 确认 "后续优化"
- 来源: PR 7niu v1.19.0 rc.1 #6 代码审查反馈
建议的解决方案
在 OpenAPI schema 中添加验证约束:
vni-id:
type: integer
format: int64
minimum: 1 # 添加此行
maximum: 16777215 # 可选:24-bit VXLAN 上限
description: |
Virtual Network Identifier for native VPC mode. Must be a positive
non-zero integer. When set, IP conflict detection will consider both
VNI and IP address together, allowing endpoints with overlapping IPs
in different VPCs.相关文件
api/v1/models/endpoint_change_request.goapi/v1/server/embedded_spec.go
相关链接
- PR 7niu v1.19.0 rc.1 #6: 7niu v1.19.0 rc.1
此 issue 由 PR #6 code review 自动生成
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels