fix(xo-server/patching): always pass xsCredentials to installPatches on XS (#7089)

Fixes Zammad#18284

Introduced by a30d962b1d
This commit is contained in:
Pierre Donias 2023-10-13 11:45:17 +02:00 committed by GitHub
parent 6afb87def1
commit 77d53d2abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed” > Users must be able to say: “I had this issue, happy to know it's fixed”
- [Rolling Pool Update] After the update, when migrating VMs back to their host, do not migrate VMs that are already on the right host [Forum#7802](https://xcp-ng.org/forum/topic/7802) (PR [#7071](https://github.com/vatesfr/xen-orchestra/pull/7071)) - [Rolling Pool Update] After the update, when migrating VMs back to their host, do not migrate VMs that are already on the right host [Forum#7802](https://xcp-ng.org/forum/topic/7802) (PR [#7071](https://github.com/vatesfr/xen-orchestra/pull/7071))
- [RPU] Fix "XenServer credentials not found" when running a Rolling Pool Update on a XenServer pool (PR [#7089](https://github.com/vatesfr/xen-orchestra/pull/7089))
### Packages to release ### Packages to release

View File

@ -493,7 +493,7 @@ export default {
}, },
@decorateWith(deferrable) @decorateWith(deferrable)
async rollingPoolUpdate($defer) { async rollingPoolUpdate($defer, { xsCredentials } = {}) {
const isXcp = _isXcp(this.pool.$master) const isXcp = _isXcp(this.pool.$master)
if (this.pool.ha_enabled) { if (this.pool.ha_enabled) {
@ -530,7 +530,7 @@ export default {
// On XS/CH, start by installing patches on all hosts // On XS/CH, start by installing patches on all hosts
if (!isXcp) { if (!isXcp) {
log.debug('Install patches') log.debug('Install patches')
await this.installPatches() await this.installPatches({ xsCredentials })
} }
// Remember on which hosts the running VMs are // Remember on which hosts the running VMs are

View File

@ -62,11 +62,14 @@ export default class Pools {
} }
const patchesName = await Promise.all([targetXapi.findPatches(targetRequiredPatches), ...findPatchesPromises]) const patchesName = await Promise.all([targetXapi.findPatches(targetRequiredPatches), ...findPatchesPromises])
const { xsCredentials } = _app.apiContext.user.preferences
// Install patches in parallel. // Install patches in parallel.
const installPatchesPromises = [] const installPatchesPromises = []
installPatchesPromises.push( installPatchesPromises.push(
targetXapi.installPatches({ targetXapi.installPatches({
patches: patchesName[0], patches: patchesName[0],
xsCredentials,
}) })
) )
let i = 1 let i = 1
@ -74,6 +77,7 @@ export default class Pools {
installPatchesPromises.push( installPatchesPromises.push(
sourceXapis[sourceId].installPatches({ sourceXapis[sourceId].installPatches({
patches: patchesName[i++], patches: patchesName[i++],
xsCredentials,
}) })
) )
} }

View File

@ -686,7 +686,7 @@ export default class XenServers {
$defer(() => app.loadPlugin('load-balancer')) $defer(() => app.loadPlugin('load-balancer'))
} }
await this.getXapi(pool).rollingPoolUpdate() await this.getXapi(pool).rollingPoolUpdate({ xsCredentials: app.apiContext.user.preferences.xsCredentials })
} }
} }