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

fix: get_job_instance_ip_log 返回的 bk_host_id 字段为 null #2129

Closed
wangyu096 opened this issue Jun 13, 2023 · 1 comment
Closed

fix: get_job_instance_ip_log 返回的 bk_host_id 字段为 null #2129

wangyu096 opened this issue Jun 13, 2023 · 1 comment
Assignees
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/bug 程序故障Bug,漏洞

Comments

@wangyu096
Copy link
Collaborator

Version / Branch / tag
3.7.x

出了什么问题?(What Happened?)
get_job_instance_ip_log 返回的 bk_host_id 字段为 null
image

调用 API 传入的参数:
image

如何复现?(How to reproduce?)

见问题描述
预期结果(What you expect?)
返回的 bk_host_id 不为空

@wangyu096 wangyu096 added kind/bug 程序故障Bug,漏洞 backlog 需求初始状态,等待产品进行评估 labels Jun 13, 2023
@wangyu096 wangyu096 self-assigned this Jun 13, 2023
@wangyu096
Copy link
Collaborator Author

问题分析:

image 返回的 bk_host_id 是API 请求传入的 bk_host_id 参数;如果 API 使用 bk_cloud_id+ip 的方式(bk_host_id=null)来调用,那么这里返回的bk_host_id 就是 null

解决方案

  1. 如果用户传入了 hostId, 那么这个参数就是用户传入的 hostId 的值
  2. 如果用户传入的是 ip,那么根据 ip 查询 hostId,并返回查询到的 hostId 的值;如果根据 ip 查询到 hostID 为空,那么返回 null

@wangyu096 wangyu096 added the todo 进入开发排期的状态,纳入了最近的迭代 label Jun 13, 2023
jsonwan added a commit that referenced this issue Jun 13, 2023
fix: get_job_instance_ip_log 返回的 bk_host_id 字段为 null #2129
@bkjob-bot bkjob-bot added for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 done 已上线到正式环境并验收通过 and removed backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 labels Jun 15, 2023
@bkjob-bot bkjob-bot added the for test 可以在测试环境进行验收 label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/bug 程序故障Bug,漏洞
Projects
None yet
Development

No branches or pull requests

2 participants