Skip to content

Commit

Permalink
Merge pull request #61 from houhoucoop/fix/issue-7230
Browse files Browse the repository at this point in the history
fix: failed to display storage class key/value pairs when edit config on Rancher managed Harvester
  • Loading branch information
houhoucoop authored Jan 6, 2025
2 parents 28e4991 + 81f1a56 commit a8cf6f5
Showing 1 changed file with 20 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ import { clone } from '@shell/utils/object';
import { uniq } from '@shell/utils/array';
import { DATA_ENGINE_V1 } from '../../../models/harvester/persistentvolumeclaim';
// UI components for Longhorn storage class parameters
const DEFAULT_PARAMETERS = [
'numberOfReplicas',
'staleReplicaTimeout',
'diskSelector',
'nodeSelector',
'migratable',
'encrypted',
'dataEngine',
];
const {
CSI_PROVISIONER_SECRET_NAME,
CSI_PROVISIONER_SECRET_NAMESPACE,
Expand Down Expand Up @@ -141,11 +130,17 @@ export default {
get() {
const parameters = clone(this.value?.parameters) || {};
DEFAULT_PARAMETERS.forEach((key) => {
delete parameters[key];
});
Object.values(CSI_SECRETS).forEach((key) => {
// UI components for Longhorn storage class parameters
const defaultParameters = [
'numberOfReplicas',
'staleReplicaTimeout',
'diskSelector',
'nodeSelector',
'migratable',
...(this.value.volumeEncryptionFeatureEnabled ? ['encrypted', 'dataEngine'] : []),
];
[...defaultParameters, ...Object.values(CSI_SECRETS)].forEach((key) => {
delete parameters[key];
});
Expand Down Expand Up @@ -311,16 +306,16 @@ export default {
</LabeledSelect>
</div>
</div>
<div class="row mt-20">
<RadioGroup
v-model:value="value.parameters.migratable"
name="layer3NetworkMode"
:label="t('harvester.storage.parameters.migratable.label')"
:mode="mode"
:options="migratableOptions"
/>
</div>
<template v-if="value.volumeEncryptionFeatureEnabled">
<div class="row mt-20">
<RadioGroup
v-model:value="value.parameters.migratable"
name="layer3NetworkMode"
:label="t('harvester.storage.parameters.migratable.label')"
:mode="mode"
:options="migratableOptions"
/>
</div>
<div class="row mt-20">
<RadioGroup
v-model:value="volumeEncryption"
Expand Down

0 comments on commit a8cf6f5

Please sign in to comment.