Skip to content

Commit

Permalink
fix(backups/_cleanVm): fixes for aliases cleaning (#6094)
Browse files Browse the repository at this point in the history
Introduced in 249f638
  • Loading branch information
fbeauchamp authored Jan 18, 2022
1 parent b465a91 commit e15be7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 4 additions & 8 deletions @xen-orchestra/backups/_cleanVm.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const listVhds = async (handler, vmDir) => {
const list = await handler.list(vdiDir, {
filter: file => isVhdFile(file) || INTERRUPTED_VHDS_REG.test(file),
})
aliases[vdiDir] = list.filter(vhd => isVhdAlias(vhd))
aliases[vdiDir] = list.filter(vhd => isVhdAlias(vhd)).map(file => `${vdiDir}/${file}`)
list.forEach(file => {
const res = INTERRUPTED_VHDS_REG.exec(file)
if (res === null) {
Expand Down Expand Up @@ -249,15 +249,11 @@ exports.cleanVm = async function cleanVm(
}
}

// 2022-01-17 - FBP & JFT - Temporary disable aliases checking as it appears problematic
//
// check if alias are correct
// check if all vhd in data subfolder have a corresponding alias
// await asyncMap(Object.keys(aliases), async dir => {
// await checkAliases(aliases[dir], `${dir}/data`, { handler, onLog, remove })
// })
// Avoid a ESLint unused variable
noop(aliases)
await asyncMap(Object.keys(aliases), async dir => {
await checkAliases(aliases[dir], `${dir}/data`, { handler, onLog, remove })
})

// remove VHDs with missing ancestors
{
Expand Down
3 changes: 3 additions & 0 deletions packages/vhd-lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ exports.VhdDirectory = require('./Vhd/VhdDirectory').VhdDirectory
exports.VhdFile = require('./Vhd/VhdFile').VhdFile
exports.VhdSynthetic = require('./Vhd/VhdSynthetic').VhdSynthetic
exports.Constants = require('./_constants')
const {isVhdAlias, resolveAlias} = require('./_resolveAlias')
exports.isVhdAlias = isVhdAlias
exports.resolveAlias = resolveAlias

0 comments on commit e15be7e

Please sign in to comment.