Skip to content

🟡 [Medium Priority] IP 冲突错误上下文不足 #11

@xgopilot

Description

@xgopilot

优先级

🟡 中优先级

问题描述

当 IP 冲突检测失败时,错误消息仅显示 "IP X is already in use",没有提供当前占用该 IP 的 endpoint 的详细信息(endpoint ID, namespace, pod name 等),导致生产环境调试困难。

影响范围

运维体验:

  • 故障排查困难
  • 无法快速定位冲突的 endpoint
  • 需要额外的命令和工具才能找到冲突源

相关代码位置

当前状态

建议的解决方案

改进错误消息,包含更多上下文信息:

for _, id := range checkIDs {
    oldEp, err := m.endpointManager.Lookup(id)
    if err != nil {
        return invalidDataError(ep, err)
    } else if oldEp != nil {
        return invalidDataError(ep, fmt.Errorf(
            "IP %s is already in use by endpoint %d (namespace: %s, pod: %s, VNI: %d)",
            id,
            oldEp.ID,
            oldEp.GetK8sNamespace(),
            oldEp.GetK8sPodName(),
            oldEp.VNIID,
        ))
    }
}

额外改进建议

  • 添加创建时间信息以识别"僵尸" endpoint
  • 在日志中记录完整的 endpoint 标识信息
  • 考虑添加建议操作(如删除旧 endpoint 的命令)

相关链接


此 issue 由 PR #6 code review 自动生成

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions