fix(app): fix capitalisation typos and match EE codebase [EE-6480] (#11002)

Co-authored-by: testa113 <testa113>
pull/8156/merge
Ali 2024-01-23 16:28:00 +13:00 committed by GitHub
parent d5080b6884
commit 4a19871fcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -345,7 +345,7 @@ class KubernetesApplicationConverter {
(claims.length === 0 || (claims.length > 0 && formValues.DataAccessPolicy === KubernetesApplicationDataAccessPolicies.Shared && rwx))) || (claims.length === 0 || (claims.length > 0 && formValues.DataAccessPolicy === KubernetesApplicationDataAccessPolicies.Shared && rwx))) ||
formValues.ApplicationType === KubernetesApplicationTypes.DaemonSet; formValues.ApplicationType === KubernetesApplicationTypes.DaemonSet;
const pod = formValues.ApplicationType === KubernetesApplicationTypes.POD; const pod = formValues.ApplicationType === KubernetesApplicationTypes.Pod;
let app; let app;
if (deployment) { if (deployment) {

View File

@ -2,6 +2,7 @@ import _ from 'lodash-es';
import angular from 'angular'; import angular from 'angular';
import PortainerError from 'Portainer/error'; import PortainerError from 'Portainer/error';
import { KubernetesApplicationDeploymentTypes, KubernetesApplicationTypes } from 'Kubernetes/models/application/models/appConstants';
import KubernetesApplicationHelper from 'Kubernetes/helpers/application'; import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
import KubernetesApplicationConverter from 'Kubernetes/converters/application'; import KubernetesApplicationConverter from 'Kubernetes/converters/application';
import { KubernetesStatefulSet } from 'Kubernetes/models/stateful-set/models'; import { KubernetesStatefulSet } from 'Kubernetes/models/stateful-set/models';
@ -12,7 +13,8 @@ import KubernetesPodConverter from 'Kubernetes/pod/converter';
import { notifyError } from '@/portainer/services/notifications'; import { notifyError } from '@/portainer/services/notifications';
import { KubernetesIngressConverter } from 'Kubernetes/ingress/converter'; import { KubernetesIngressConverter } from 'Kubernetes/ingress/converter';
import { generateNewIngressesFromFormPaths } from '@/react/kubernetes/applications/CreateView/application-services/utils'; import { generateNewIngressesFromFormPaths } from '@/react/kubernetes/applications/CreateView/application-services/utils';
import { KubernetesApplicationDeploymentTypes, KubernetesApplicationTypes } from 'Kubernetes/models/application/models/appConstants'; import { KubernetesPod } from '../pod/models';
import { KubernetesApplication } from '../models/application/models';
class KubernetesApplicationService { class KubernetesApplicationService {
/* #region CONSTRUCTOR */ /* #region CONSTRUCTOR */
@ -62,7 +64,7 @@ class KubernetesApplicationService {
apiService = this.KubernetesDaemonSetService; apiService = this.KubernetesDaemonSetService;
} else if (app.ApplicationType === KubernetesApplicationTypes.StatefulSet) { } else if (app.ApplicationType === KubernetesApplicationTypes.StatefulSet) {
apiService = this.KubernetesStatefulSetService; apiService = this.KubernetesStatefulSetService;
} else if (app.ApplicationType === KubernetesApplicationTypes.Pod) { } else if (app instanceof KubernetesPod || (app instanceof KubernetesApplication && app.ApplicationType === KubernetesApplicationTypes.Pod)) {
apiService = this.KubernetesPodService; apiService = this.KubernetesPodService;
} else { } else {
throw new PortainerError('Unable to determine which association to use to retrieve API Service'); throw new PortainerError('Unable to determine which association to use to retrieve API Service');

View File

@ -203,7 +203,8 @@ class KubernetesCreateApplicationController {
if (this.formValues.DeploymentType === this.ApplicationDeploymentTypes.Global) { if (this.formValues.DeploymentType === this.ApplicationDeploymentTypes.Global) {
return this.ApplicationTypes.DaemonSet; return this.ApplicationTypes.DaemonSet;
} }
if (this.formValues.PersistedFolders && this.formValues.PersistedFolders.length && this.formValues.DataAccessPolicy === this.ApplicationDataAccessPolicies.Isolated) { const persistedFolders = this.formValues.PersistedFolders && this.formValues.PersistedFolders.filter((pf) => !pf.NeedsDeletion);
if (persistedFolders && persistedFolders.length && this.formValues.DataAccessPolicy === this.ApplicationDataAccessPolicies.Isolated) {
return this.ApplicationTypes.StatefulSet; return this.ApplicationTypes.StatefulSet;
} }
return this.ApplicationTypes.Deployment; return this.ApplicationTypes.Deployment;