Skip to content

Commit

Permalink
Rename longhorn version param to dataEngine
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
  • Loading branch information
torchiaf committed Sep 24, 2024
1 parent 0cecf90 commit c0eef68
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions pkg/harvester/edit/harvesterhci.io.storage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { LVM_DRIVER } from '../../models/harvester/storage.k8s.io.storageclass';
const LONGHORN_V2_DATA_ENGINE = 'longhorn-system/v2-data-engine';
export const ENGINE_VERSION_V1 = 'v1';
export const ENGINE_VERSION_V2 = 'v2';
export const DATA_ENGINE_V1 = 'v1';
export const DATA_ENGINE_V2 = 'v2';
export const LVM_TOPOLOGY_LABEL = 'topology.lvm.csi/node';
Expand Down Expand Up @@ -83,7 +83,7 @@ export default {
this.$set(this.value, 'provisioner', this.value.provisioner || LONGHORN_DRIVER);
if (this.value.provisioner === LONGHORN_DRIVER) {
this.$set(this.value.parameters, 'engineVersion', this.value.longhornVersion);
this.$set(this.value.parameters, 'dataEngine', this.value.longhornVersion);
}
this.$set(this.value, 'allowVolumeExpansion', this.value.allowVolumeExpansion || allowVolumeExpansionOptions[0].value);
Expand Down Expand Up @@ -143,14 +143,14 @@ export default {
switch (name) {
case LONGHORN_DRIVER:
out.push({
label: `harvester.storage.storageClass.longhorn.${ ENGINE_VERSION_V1 }.label`,
value: `${ name }_${ ENGINE_VERSION_V1 }`,
label: `harvester.storage.storageClass.longhorn.${ DATA_ENGINE_V1 }.label`,
value: `${ name }_${ DATA_ENGINE_V1 }`,
});
if (this.longhornSystemVersion === ENGINE_VERSION_V2 || this.value.longhornVersion === ENGINE_VERSION_V2) {
if (this.longhornSystemVersion === DATA_ENGINE_V2 || this.value.longhornVersion === DATA_ENGINE_V2) {
out.push({
label: `harvester.storage.storageClass.longhorn.${ ENGINE_VERSION_V2 }.label`,
value: `${ name }_${ ENGINE_VERSION_V2 }`,
label: `harvester.storage.storageClass.longhorn.${ DATA_ENGINE_V2 }.label`,
value: `${ name }_${ DATA_ENGINE_V2 }`,
});
}
break;
Expand All @@ -176,13 +176,13 @@ export default {
const inStore = this.$store.getters['currentProduct'].inStore;
const v2DataEngine = this.$store.getters[`${ inStore }/byId`](LONGHORN.SETTINGS, LONGHORN_V2_DATA_ENGINE) || {};
return v2DataEngine.value === 'true' ? ENGINE_VERSION_V2 : ENGINE_VERSION_V1;
return v2DataEngine.value === 'true' ? DATA_ENGINE_V2 : DATA_ENGINE_V1;
},
},
watch: {
provisioner(neu) {
const [provisioner, engineVersion] = neu?.split('_');
const [provisioner, dataEngine] = neu?.split('_');
let parameters = {};
Expand All @@ -199,7 +199,7 @@ export default {
this.$set(this.value, 'provisioner', provisioner);
if (provisioner === LONGHORN_DRIVER) {
parameters = { engineVersion };
parameters = { dataEngine };
}
this.$set(this.value, 'allowVolumeExpansion', this.value.provisioner === LONGHORN_DRIVER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { _CREATE, _VIEW } from '@shell/config/query-params';
import { CSI_SECRETS } from '@pkg/harvester/config/harvester-map';
import { clone } from '@shell/utils/object';
import { uniq } from '@shell/utils/array';
import { ENGINE_VERSION_V1 } from '../index.vue';
import { DATA_ENGINE_V1 } from '../index.vue';
// UI components for Longhorn storage class parameters
const DEFAULT_PARAMETERS = [
Expand All @@ -18,7 +18,7 @@ const DEFAULT_PARAMETERS = [
'nodeSelector',
'migratable',
'encrypted',
'engineVersion',
'dataEngine',
];
const {
Expand Down Expand Up @@ -74,7 +74,7 @@ export default {
nodeSelector: null,
encrypted: 'false',
migratable: 'true',
engineVersion: ENGINE_VERSION_V1
dataEngine: DATA_ENGINE_V1
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { _CREATE, _VIEW } from '@shell/config/query-params';
import { CSI_SECRETS } from '@pkg/harvester/config/harvester-map';
import { clone } from '@shell/utils/object';
import { uniq } from '@shell/utils/array';
import { ENGINE_VERSION_V2 } from '../index.vue';
import { DATA_ENGINE_V2 } from '../index.vue';
// UI components for Longhorn storage class parameters
const DEFAULT_PARAMETERS = [
Expand All @@ -18,7 +18,7 @@ const DEFAULT_PARAMETERS = [
'nodeSelector',
'migratable',
'encrypted',
'engineVersion',
'dataEngine',
];
const {
Expand Down Expand Up @@ -74,7 +74,7 @@ export default {
nodeSelector: null,
encrypted: 'false',
migratable: 'false',
engineVersion: ENGINE_VERSION_V2
dataEngine: DATA_ENGINE_V2
});
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/harvester/models/harvester/storage.k8s.io.storageclass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HCI } from '../../types';
import StorageClass from '@shell/models/storage.k8s.io.storageclass';
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester';
import { LONGHORN_DRIVER } from '@shell/models/persistentvolume';
import { ENGINE_VERSION_V1 } from '../../edit/harvesterhci.io.storage/index.vue';
import { DATA_ENGINE_V1 } from '../../edit/harvesterhci.io.storage/index.vue';

export const LVM_DRIVER = 'lvm.driver.harvesterhci.io';

Expand Down Expand Up @@ -38,7 +38,7 @@ export default class HciStorageClass extends StorageClass {

get longhornVersion() {
if (this.provisioner === LONGHORN_DRIVER) {
return (this.parameters || {}).engineVersion || ENGINE_VERSION_V1;
return (this.parameters || {}).dataEngine || DATA_ENGINE_V1;
}

return null;
Expand Down

0 comments on commit c0eef68

Please sign in to comment.