mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
fix: fallback default value (#454)
Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
parent
4a456ac07d
commit
e8d63da1eb
@ -44,6 +44,12 @@ export default {
|
||||
};
|
||||
|
||||
await allHash(hash);
|
||||
|
||||
if (this.mode === _CREATE ) {
|
||||
this.setDefaultVolumeSnapshotClass();
|
||||
} else {
|
||||
this.initCDISettingsFromAnnotations();
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
@ -59,14 +65,6 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.mode === _CREATE ) {
|
||||
this.setDefaultVolumeSnapshotClass();
|
||||
} else {
|
||||
this.initCDISettingsFromAnnotations();
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
inStore() {
|
||||
return this.$store.getters['currentProduct'].inStore;
|
||||
@ -148,7 +146,7 @@ export default {
|
||||
setDefaultVolumeSnapshotClass() {
|
||||
try {
|
||||
const setting = this.$store.getters[`${ this.inStore }/byId`](HCI.SETTING, HCI_SETTING.CSI_DRIVER_CONFIG);
|
||||
const config = JSON.parse(setting?.value || '{}');
|
||||
const config = JSON.parse(setting?.value || setting?.default || '{}');
|
||||
const defaultClass = config?.[this.provisioner]?.volumeSnapshotClassName || null;
|
||||
|
||||
const allClasses = this.$store.getters[`${ this.inStore }/all`](VOLUME_SNAPSHOT_CLASS) || [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user