Commit 8b6d391f authored by 智勇's avatar 智勇

lanIp

parent 521350a7
...@@ -14,11 +14,11 @@ router.get('/', async (ctx) => { ...@@ -14,11 +14,11 @@ router.get('/', async (ctx) => {
// 取节点列表的第一个作为服务的访问ip // 取节点列表的第一个作为服务的访问ip
const cacheKey = 'k8s.nodes.first' const cacheKey = 'k8s.nodes.first'
const c = lruCache.get(cacheKey) const c = lruCache.get(cacheKey)
let wanIp = lruCache.get(cacheKey) let lanIp = lruCache.get(cacheKey)
if (!c) { if (!c) {
const res = await ctx.cluster.node_list() const res = await ctx.cluster.node_list()
wanIp = _.get(res, 'nodes[0].wanIp', '') lanIp = _.get(res, 'nodes[0].lanIp', '')
lruCache.set(cacheKey, wanIp) lruCache.set(cacheKey, lanIp)
} }
const data = await ctx.cluster.service_list(ctx.query.namespace) const data = await ctx.cluster.service_list(ctx.query.namespace)
...@@ -27,7 +27,7 @@ router.get('/', async (ctx) => { ...@@ -27,7 +27,7 @@ router.get('/', async (ctx) => {
item.image = resData.service.containers[0].image item.image = resData.service.containers[0].image
if (item.userLabels.type === 'base') { if (item.userLabels.type === 'base') {
item.portMappings = resData.service.portMappings item.portMappings = resData.service.portMappings
item.wanIp = wanIp item.lanIp = lanIp
} }
} }
const task = [] const task = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment