mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
refactor: fallback to longhorn if not default storage class
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
parent
b0c7b1fefe
commit
6e9350e63d
@ -61,7 +61,6 @@ export default {
|
||||
images: this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.IMAGE }),
|
||||
storageClasses: this.$store.dispatch(`${ inStore }/findAll`, { type: STORAGE_CLASS }),
|
||||
});
|
||||
|
||||
this['storageClassName'] = this.storageClassName || this.defaultStorageClassName();
|
||||
this.images = this.$store.getters[`${ inStore }/all`](HCI.IMAGE);
|
||||
|
||||
@ -253,7 +252,7 @@ export default {
|
||||
},
|
||||
'value.spec.securityParameters.cryptoOperation'() {
|
||||
if (this.value.spec?.securityParameters?.cryptoOperation === ENCRYPT) {
|
||||
this.storageClassName = this.encryptedStorageClasses[0]?.name || LONGHORN;
|
||||
this.storageClassName = this.encryptedStorageClasses[0]?.name || '';
|
||||
} else { // URL / FILE / DECRYPT should use default storage class
|
||||
this.storageClassName = this.defaultStorageClassName();
|
||||
}
|
||||
@ -410,6 +409,10 @@ export default {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find((s) => s.isDefault);
|
||||
|
||||
if (!defaultStorage) {
|
||||
return LONGHORN;
|
||||
}
|
||||
|
||||
// if default sc is encrypted, use longhorn as default
|
||||
return defaultStorage.isEncrypted ? LONGHORN : defaultStorage?.metadata?.name;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user