From 1722257d68f4f9d61d7fa7e6da045f5219353223 Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:13:56 +1300 Subject: [PATCH] fix(cluster): fix cluster setup no ingress develop EE-4352 (#7776) * fix(cluster) update cluster wo controllers EE-4352 * fix(ing): stop errors in ns EE-4352 --- app/kubernetes/react/components/index.ts | 1 + app/kubernetes/views/configure/configure.html | 1 + .../views/configure/configureController.js | 18 ++++-------------- .../create/createResourcePoolController.js | 2 +- .../edit/resourcePoolController.js | 2 +- .../IngressClassDatatable.tsx | 4 +++- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/kubernetes/react/components/index.ts b/app/kubernetes/react/components/index.ts index 82fbe2ac8..bf0613ea2 100644 --- a/app/kubernetes/react/components/index.ts +++ b/app/kubernetes/react/components/index.ts @@ -15,6 +15,7 @@ export const componentsModule = angular 'onChangeAvailability', 'description', 'ingressControllers', + 'isLoading', 'noIngressControllerLabel', 'view', ]) diff --git a/app/kubernetes/views/configure/configure.html b/app/kubernetes/views/configure/configure.html index 7a5a16415..879a034cf 100644 --- a/app/kubernetes/views/configure/configure.html +++ b/app/kubernetes/views/configure/configure.html @@ -44,6 +44,7 @@ { const oldStorageClass = _.find(this.oldStorageClasses, { Name: storageClass.Name }); @@ -224,19 +224,7 @@ class KubernetesConfigureController { } configure() { - const toDel = _.filter(this.formValues.IngressClasses, { NeedsDeletion: true }); - if (toDel.length) { - this.ModalService.confirmUpdate( - `Removing ingress controllers may cause applications to be unaccessible. All ingress configurations from affected applications will be removed.

Do you wish to continue?`, - (confirmed) => { - if (confirmed) { - return this.$async(this.configureAsync); - } - } - ); - } else { - return this.$async(this.configureAsync); - } + return this.$async(this.configureAsync); } /* #endregion */ @@ -292,6 +280,7 @@ class KubernetesConfigureController { IngressAvailabilityPerNamespace: false, }; + this.isIngressControllersLoading = true; try { this.availableAccessModes = new KubernetesStorageClassAccessPolicies(); @@ -332,6 +321,7 @@ class KubernetesConfigureController { this.Notifications.error('Failure', err, 'Unable to retrieve environment configuration'); } finally { this.state.viewReady = true; + this.isIngressControllersLoading = false; } window.addEventListener('beforeunload', this.onBeforeOnload); diff --git a/app/kubernetes/views/resource-pools/create/createResourcePoolController.js b/app/kubernetes/views/resource-pools/create/createResourcePoolController.js index 319c66e74..ae139bd3a 100644 --- a/app/kubernetes/views/resource-pools/create/createResourcePoolController.js +++ b/app/kubernetes/views/resource-pools/create/createResourcePoolController.js @@ -109,7 +109,7 @@ class KubernetesCreateResourcePoolController { this.checkDefaults(); this.formValues.Owner = this.Authentication.getUserDetails().username; await this.KubernetesResourcePoolService.create(this.formValues); - await updateIngressControllerClassMap(this.endpoint.Id, this.ingressControllers, this.formValues.Name); + await updateIngressControllerClassMap(this.endpoint.Id, this.ingressControllers || [], this.formValues.Name); this.Notifications.success('Namespace successfully created', this.formValues.Name); this.$state.go('kubernetes.resourcePools'); } catch (err) { diff --git a/app/kubernetes/views/resource-pools/edit/resourcePoolController.js b/app/kubernetes/views/resource-pools/edit/resourcePoolController.js index 444c688fb..331082811 100644 --- a/app/kubernetes/views/resource-pools/edit/resourcePoolController.js +++ b/app/kubernetes/views/resource-pools/edit/resourcePoolController.js @@ -144,7 +144,7 @@ class KubernetesResourcePoolController { try { this.checkDefaults(); await this.KubernetesResourcePoolService.patch(oldFormValues, newFormValues); - await updateIngressControllerClassMap(this.endpoint.Id, this.ingressControllers, this.formValues.Name); + await updateIngressControllerClassMap(this.endpoint.Id, this.ingressControllers || [], this.formValues.Name); this.Notifications.success('Namespace successfully updated', this.pool.Namespace.Name); this.$state.reload(this.$state.current); } catch (err) { diff --git a/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/IngressClassDatatable.tsx b/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/IngressClassDatatable.tsx index 2d33de173..2412e0c29 100644 --- a/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/IngressClassDatatable.tsx +++ b/app/react/kubernetes/cluster/ingressClass/IngressClassDatatable/IngressClassDatatable.tsx @@ -19,6 +19,7 @@ interface Props { ) => void; // angular function to save the ingress class list description: string; ingressControllers: IngressControllerClassMap[] | undefined; + isLoading: boolean; noIngressControllerLabel: string; view: string; } @@ -27,6 +28,7 @@ export function IngressClassDatatable({ onChangeAvailability, description, ingressControllers, + isLoading, noIngressControllerLabel, view, }: Props) { @@ -42,7 +44,7 @@ export function IngressClassDatatable({ storageKey="ingressClasses" columns={columns} settingsStore={settings} - isLoading={!ingControllerFormValues} + isLoading={isLoading} emptyContentLabel={noIngressControllerLabel} titleOptions={{ icon: 'database',