Commit 055a4386 authored by 智勇's avatar 智勇

增加仓库不存在的异常捕获

parent 7ae296ce
......@@ -18,7 +18,7 @@ const deploy = async (cluster) => {
const summary = {}
// // for test
// const testNamespace = ['test']
// const testNamespace = ['fe']
// const nsTest = ns.namespaces && ns.namespaces.filter(item => testNamespace.includes(item.name))
// for (const namespace of nsTest) {
for (const namespace of ns.namespaces) {
......@@ -30,14 +30,18 @@ const deploy = async (cluster) => {
const svcs = await getServicesFormat(client.clientInfo, namespace.name)
for (const svc of svcs) {
// 重启latest
if (~svc.image.indexOf('latest')) {
if (~svc.image.indexOf('latest') && svc.serviceName === 'admin') {
logger.info('检查项目', namespace.name, svc.serviceName)
const latest = await container.getTagByName(`qa-test/${svc.serviceName}`, 'latest')
const latestImageID = _.get(latest.tagInfo, '[0].tagId', '')
if (latestImageID && latestImageID !== svc.imageID.split('@')[1]) {
logger.info('latest不一致,部署项目', namespace.name, svc.podName)
summary[namespace.name].latestArray.push(svc.serviceName)
await serviceRestart(client.clientInfo, namespace.name, svc.podName)
try {
const latest = await container.getTagByName(`qa-test/${svc.serviceName}`, 'latest')
const latestImageID = _.get(latest.tagInfo, '[0].tagId', '')
if (latestImageID && latestImageID !== svc.imageID.split('@')[1]) {
logger.info('latest不一致,部署项目', namespace.name, svc.podName)
summary[namespace.name].latestArray.push(svc.serviceName)
await serviceRestart(client.clientInfo, namespace.name, svc.podName)
}
} catch (error) {
logger.warn(svc.serviceName, error)
}
await sleep(5 * 1000)
}
......
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