Commit d2aec30b authored by 智勇's avatar 智勇

兼容更新镜像

parent 4cf235a9
......@@ -104,12 +104,16 @@ router.post('/delete', async (ctx) => {
})
router.post('/modifyImage', async (ctx) => {
let list = await getPods(ctx.client, ctx.request.body.namespace)
const data = ctx.request.body
let list = await getPods(ctx.client, data.namespace)
list = list.body.items.map(item => (item.metadata.labels && item.metadata.labels['qcloud-app']) || item.metadata.name)
if (list.includes(ctx.request.body.serviceName)) {
if (list.includes(data.serviceName)) {
// await imageUpdate(ctx.client, ctx.request.body)
await deployUpdate(ctx.cluterParams, ctx.client, ctx.request.body)
if (!data.label) {
data.label = data.type
}
await deployUpdate(ctx.cluterParams, ctx.client, data)
} else {
await createService(ctx)
}
......
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