diff --git a/src/resources/cinder/volume.jsx b/src/resources/cinder/volume.jsx index af8552c5..03edcc18 100644 --- a/src/resources/cinder/volume.jsx +++ b/src/resources/cinder/volume.jsx @@ -401,6 +401,11 @@ export const getQuota = (cinderQuota) => { }; const getErrorMessage = ({ name, left, input }) => { + if (left === 0) { + return t('Quota: Insufficient { name } quota to create resources.', { + name, + }); + } const error = t( 'Quota: Insufficient { name } quota to create resources, please adjust resource quantity or quota(left { left }, input { input }).', { @@ -444,7 +449,7 @@ export const getAdd = (cinderQuota, withCountCheck = true) => { }); return { ...zero, error }; } - if (sizeLimit !== -1 && sizeLeft < totalSize) { + if ((sizeLimit !== -1 && sizeLeft < totalSize) || sizeLeft === 0) { const error = getErrorMessage({ name: t('gigabytes'), left: sizeLeft, @@ -463,7 +468,10 @@ export const getAdd = (cinderQuota, withCountCheck = true) => { }); return { ...zero, error }; } - if (typeSizeLimit !== -1 && typeSizeLeft < totalSize) { + if ( + (typeSizeLimit !== -1 && typeSizeLeft < totalSize) || + typeSizeLeft === 0 + ) { const error = getErrorMessage({ name: t('{name} type gigabytes', { name: type }), left: typeSizeLeft, diff --git a/test/e2e/integration/pages/storage/volume.spec.js b/test/e2e/integration/pages/storage/volume.spec.js index aad94d8c..2e85162d 100644 --- a/test/e2e/integration/pages/storage/volume.spec.js +++ b/test/e2e/integration/pages/storage/volume.spec.js @@ -13,7 +13,11 @@ // limitations under the License. import { onlyOn } from '@cypress/skip-test'; -import { volumeListUrl, volumeTypeListUrl } from '../../../support/constants'; +import { + volumeListUrl, + volumeTypeListUrl, + imageListUrl, +} from '../../../support/constants'; describe('The Volume Page', () => { const listUrl = volumeListUrl; @@ -157,6 +161,9 @@ describe('The Volume Page', () => { .formInput('image_name', imageName) .clickModalActionSubmitButton(); cy.tableSearchText(name).waitStatusActiveByRefresh(); + cy.visit(imageListUrl) + .tableSearchText(imageName) + .checkTableFirstRow(imageName); }); it('successfully extend volume', () => {