feat(xo-server,xo-web/smart backup): exclude XO Proxy VMs by default (#5128)

This commit is contained in:
Pierre Donias 2020-07-02 15:06:47 +02:00 committed by GitHub
parent 34b5962eac
commit 1c042778b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 3 deletions

View File

@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Home] Remove 'tags' filter from the filter selector since tags have their own selector (PR [#5121](https://github.com/vatesfr/xen-orchestra/pull/5121))
- [Backup/New] Add "XOA Proxy" to the excluded tags by default (PR [#5128](https://github.com/vatesfr/xen-orchestra/pull/5128))
### Bug fixes
@ -30,4 +31,5 @@
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server minor
- xo-web minor

View File

@ -48,6 +48,15 @@ createJob.params = {
},
}
export function getSuggestedExcludedTags() {
return [
'Continuous Replication',
'Disaster Recovery',
'XOSAN',
this._config['xo-proxy'].vmTag,
]
}
export function migrateLegacyJob({ id }) {
return this.migrateLegacyBackupJob(id)
}

View File

@ -2101,6 +2101,9 @@ export const subscribeMetadataBackupJobs = createSubscription(() =>
export const createBackupNgJob = props =>
_call('backupNg.createJob', props)::tap(subscribeBackupNgJobs.forceRefresh)
export const getSuggestedExcludedTags = () =>
_call('backupNg.getSuggestedExcludedTags')
export const deleteBackupJobs = async ({
backupIds = [],
metadataBackupIds = [],

View File

@ -36,6 +36,7 @@ import {
deleteSchedule,
editBackupNgJob,
editSchedule,
getSuggestedExcludedTags,
isSrWritable,
subscribeRemotes,
} from 'xo'
@ -235,9 +236,7 @@ const getInitialState = ({ preSelectedVmIds, setHomeVmIdsSelection }) => {
smartMode: false,
snapshotMode: false,
srs: [],
tags: {
notValues: ['Continuous Replication', 'Disaster Recovery', 'XOSAN'],
},
tags: {},
vms: preSelectedVmIds,
}
}
@ -301,6 +300,9 @@ export default decorate([
provideState({
initialState: getInitialState,
effects: {
initialize: async function () {
this.state.tags = { notValues: await getSuggestedExcludedTags() }
},
createJob: () => async state => {
if (state.isJobInvalid) {
return {