mirror of https://github.com/portainer/portainer
fix(app): persisted volume fixes [EE-6554] (#10975)
Co-authored-by: testa113 <testa113>pull/10981/head
parent
fa63432695
commit
59f642ea56
|
@ -372,6 +372,10 @@ class KubernetesCreateApplicationController {
|
||||||
|
|
||||||
onChangePersistedFolder(values) {
|
onChangePersistedFolder(values) {
|
||||||
this.$scope.$evalAsync(() => {
|
this.$scope.$evalAsync(() => {
|
||||||
|
this.state.persistedFoldersUseExistingVolumes = values.some((pf) => pf.existingVolume);
|
||||||
|
if (!this.state.isEdit && this.state.persistedFoldersUseExistingVolumes) {
|
||||||
|
this.formValues.DataAccessPolicy = this.ApplicationDataAccessPolicies.Shared;
|
||||||
|
}
|
||||||
this.formValues.PersistedFolders = values;
|
this.formValues.PersistedFolders = values;
|
||||||
if (values && values.length && !this.supportGlobalDeployment()) {
|
if (values && values.length && !this.supportGlobalDeployment()) {
|
||||||
this.onChangeDeploymentType(this.ApplicationDeploymentTypes.Replicated);
|
this.onChangeDeploymentType(this.ApplicationDeploymentTypes.Replicated);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { Box, Boxes } from 'lucide-react';
|
import { Box, Boxes } from 'lucide-react';
|
||||||
|
|
||||||
import { BoxSelector, BoxSelectorOption } from '@@/BoxSelector';
|
import { BoxSelector, BoxSelectorOption } from '@@/BoxSelector';
|
||||||
|
import { FormSection } from '@@/form-components/FormSection';
|
||||||
|
import { TextTip } from '@@/Tip/TextTip';
|
||||||
|
|
||||||
import { AppDataAccessPolicy } from '../types';
|
import { AppDataAccessPolicy } from '../types';
|
||||||
|
|
||||||
|
@ -20,6 +22,10 @@ export function DataAccessPolicyFormSection({
|
||||||
const options = getOptions(value, isEdit, persistedFoldersUseExistingVolumes);
|
const options = getOptions(value, isEdit, persistedFoldersUseExistingVolumes);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<FormSection title="Data access policy" titleSize="sm">
|
||||||
|
<TextTip color="blue">
|
||||||
|
Specify how the data will be used across instances.
|
||||||
|
</TextTip>
|
||||||
<BoxSelector
|
<BoxSelector
|
||||||
slim
|
slim
|
||||||
options={options}
|
options={options}
|
||||||
|
@ -27,6 +33,7 @@ export function DataAccessPolicyFormSection({
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
radioName="data_access_policy"
|
radioName="data_access_policy"
|
||||||
/>
|
/>
|
||||||
|
</FormSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +72,7 @@ function getOptions(
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
disabled: () => persistedFoldersUseExistingVolumes,
|
disabled: () => isEdit && value !== 'Shared',
|
||||||
},
|
},
|
||||||
] as const;
|
] as const;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ export function PersistedFolderItem({
|
||||||
isDisabled={
|
isDisabled={
|
||||||
(isEdit && isExistingPersistedFolder()) ||
|
(isEdit && isExistingPersistedFolder()) ||
|
||||||
applicationValues.Containers.length > 1 ||
|
applicationValues.Containers.length > 1 ||
|
||||||
availableVolumes.length <= 1
|
availableVolumes.length < 1
|
||||||
}
|
}
|
||||||
data-cy={`k8sAppCreate-pvcSelect_${index}`}
|
data-cy={`k8sAppCreate-pvcSelect_${index}`}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -103,8 +103,8 @@ function existingVolumeValidation(): SchemaOf<ExistingVolume> {
|
||||||
Storage: string().required(),
|
Storage: string().required(),
|
||||||
storageClass: storageClassValidation(),
|
storageClass: storageClassValidation(),
|
||||||
CreationDate: string().required(),
|
CreationDate: string().required(),
|
||||||
ApplicationOwner: string().required(),
|
ApplicationOwner: string(),
|
||||||
ApplicationName: string().required(),
|
ApplicationName: string(),
|
||||||
PreviousName: string(),
|
PreviousName: string(),
|
||||||
MountPath: string(),
|
MountPath: string(),
|
||||||
Yaml: string(),
|
Yaml: string(),
|
||||||
|
|
|
@ -19,8 +19,8 @@ export type ExistingVolume = {
|
||||||
Storage: string;
|
Storage: string;
|
||||||
storageClass: StorageClass;
|
storageClass: StorageClass;
|
||||||
CreationDate: string;
|
CreationDate: string;
|
||||||
ApplicationOwner: string;
|
ApplicationOwner?: string;
|
||||||
ApplicationName: string;
|
ApplicationName?: string;
|
||||||
PreviousName?: string;
|
PreviousName?: string;
|
||||||
MountPath?: string;
|
MountPath?: string;
|
||||||
Yaml?: string;
|
Yaml?: string;
|
||||||
|
|
Loading…
Reference in New Issue