1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

fix(app): allow editing pod services [EE-6480] (#10875)

* fix(app): allow editing pod services [EE-6480]
* address review comment

---------

Co-authored-by: testa113 <testa113>
Co-authored-by: prabhat khera <prabhat.khera@portainer.io>
This commit is contained in:
Ali 2024-01-23 10:10:16 +13:00 committed by GitHub
parent 7cba02226e
commit 4c0049edbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 11 deletions

View file

@ -199,13 +199,6 @@ class KubernetesCreateApplicationController {
this.updateApplicationType();
}
updateApplicationType() {
return this.$scope.$evalAsync(() => {
this.formValues.ApplicationType = this.getAppType();
this.validatePersistedFolders();
});
}
getAppType() {
if (this.formValues.DeploymentType === this.ApplicationDeploymentTypes.Global) {
return this.ApplicationTypes.DaemonSet;
@ -216,6 +209,14 @@ class KubernetesCreateApplicationController {
return this.ApplicationTypes.Deployment;
}
// keep the application type up to date
updateApplicationType() {
return this.$scope.$evalAsync(() => {
this.formValues.ApplicationType = this.getAppType();
this.validatePersistedFolders();
});
}
onChangeFileContent(value) {
this.$scope.$evalAsync(() => {
if (this.oldStackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== value.replace(/(\r\n|\n|\r)/gm, '')) {
@ -273,7 +274,9 @@ class KubernetesCreateApplicationController {
}
imageValidityIsValid() {
return this.state.pullImageValidity || (this.formValues.registryDetails && this.formValues.registryDetails.Registry.Type !== RegistryTypes.DOCKERHUB);
return (
this.isExternalApplication() || this.state.pullImageValidity || (this.formValues.registryDetails && this.formValues.registryDetails.Registry.Type !== RegistryTypes.DOCKERHUB)
);
}
onChangeAppName(appName) {
@ -349,6 +352,7 @@ class KubernetesCreateApplicationController {
persistedFolder.useNewVolume = true;
});
this.validatePersistedFolders();
this.updateApplicationType();
}
/* #endregion */