chore(xo-web/xosan): prevent installing XOSAN on XCP-ng pools (#4953)

This commit is contained in:
Pierre Donias 2020-04-28 14:17:02 +02:00 committed by GitHub
parent 0ed5c8f0ae
commit 94b1cc2bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View File

@ -2173,6 +2173,8 @@ const messages = {
xosanState_configuringGluster: 'Configuring gluster…',
xosanState_creatingSr: 'Creating SR…',
xosanState_scanningSr: 'Scanning SR…',
xosanXcpngWarning:
'XOSAN cannot be installed on XCP-ng yet. Incoming XOSANv2 will be compatible with XCP-ng: {link}.',
// Pack download modal
xosanInstallCloudPlugin: 'Install XOA plugin first',
xosanLoadCloudPlugin: 'Load XOA plugin first',

View File

@ -275,8 +275,12 @@ const XOSAN_INDIVIDUAL_ACTIONS = [
}
)
const getPoolPredicate = createSelector(getXosanSrs, srs => pool =>
every(srs, sr => sr.$pool !== pool.id)
const getPoolPredicate = createSelector(
getXosanSrs,
getHosts,
(srs, hosts) => pool =>
hosts[pool.master].productBrand !== 'XCP-ng' &&
every(srs, sr => sr.$pool !== pool.id)
)
return {

View File

@ -111,6 +111,11 @@ export default class NewXosan extends Component {
suggestion: 0,
}
_hasXcpng = createSelector(
() => this.props.hosts,
hosts => Object.values(hosts).some(host => host.productBrand === 'XCP-ng')
)
_checkPacks = pool =>
getResourceCatalog().then(
catalog => {
@ -347,6 +352,24 @@ export default class NewXosan extends Component {
return (
<Container>
{this._hasXcpng() && (
<Row className='mb-1'>
<span className='text-muted'>
<Icon icon='info' />{' '}
{_('xosanXcpngWarning', {
link: (
<a
href='https://xcp-ng.org/docs/storage.html#xosanv2'
rel='noopener noreferrer'
target='_blank'
>
https://xcp-ng.org/docs/storage.html
</a>
),
})}
</span>
</Row>
)}
<Row className='mb-1'>
<Col size={4}>
<SelectPool