mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-21 16:22:08 +08:00
ui: add Upgrade Storage Class selector for v1.10+ upgrade flows (#1249)
Add a StorageClass selector to online and air-gapped upgrade pages when the repositoryStorageClass feature is enabled (v1.10+). - Online: stores selection in harvesterhci.io/upgrade-storage-class annotation - Air-gapped: stores selection in image spec.targetStorageClassName - Selector locked while uploaded image exists; unlocked on switch to URL - Hidden on pre-v1.10 clusters Signed-off-by: pohanhuang <pohan.huang@suse.com>
This commit is contained in:
1 parent
6a20578424
commit
aa5a501c29
10 files changed
+475
-12
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import UpgradeRepositoryStorageClass, { getUpgradeRepositoryStorageClassDefault } from '../UpgradeRepositoryStorageClass.vue';
|
||||
|
||||
const storageClasses = [
|
||||
{ name: 'fast', isDefault: true },
|
||||
{ name: 'image-cache', parameters: { backingImage: 'image' } },
|
||||
{ name: 'lvm-local', provisioner: 'lvm.driver.harvesterhci.io' },
|
||||
{ name: 'longhorn-static' },
|
||||
{ name: 'slow' }
|
||||
];
|
||||
|
||||
describe('component: UpgradeRepositoryStorageClass', () => {
|
||||
it('omits backing-image and LVM StorageClasses while disabling internal classes', () => {
|
||||
const form = {
|
||||
storageClasses,
|
||||
$store: { getters: { 'i18n/t': (key) => key } }
|
||||
};
|
||||
|
||||
expect(UpgradeRepositoryStorageClass.computed.storageClassOptions.call(form)).toStrictEqual([
|
||||
{
|
||||
label: 'fast (generic.default)', value: 'fast', disabled: false
|
||||
},
|
||||
{
|
||||
label: 'longhorn-static (harvester.storage.internal.label)', value: 'longhorn-static', disabled: true
|
||||
},
|
||||
{
|
||||
label: 'slow', value: 'slow', disabled: false
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('does not use an unavailable StorageClass as the default', () => {
|
||||
expect(getUpgradeRepositoryStorageClassDefault([
|
||||
{
|
||||
name: 'lvm-local', isDefault: true, provisioner: 'lvm.driver.harvesterhci.io'
|
||||
},
|
||||
{ name: 'longhorn-static' },
|
||||
{ name: 'fast' }
|
||||
])).toBe('');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user