mirror of https://github.com/portainer/portainer
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-4352pull/7742/head
parent
7d8b037761
commit
1722257d68
|
@ -15,6 +15,7 @@ export const componentsModule = angular
|
||||||
'onChangeAvailability',
|
'onChangeAvailability',
|
||||||
'description',
|
'description',
|
||||||
'ingressControllers',
|
'ingressControllers',
|
||||||
|
'isLoading',
|
||||||
'noIngressControllerLabel',
|
'noIngressControllerLabel',
|
||||||
'view',
|
'view',
|
||||||
])
|
])
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
<ingress-class-datatable
|
<ingress-class-datatable
|
||||||
on-change-availability="(ctrl.onChangeAvailability)"
|
on-change-availability="(ctrl.onChangeAvailability)"
|
||||||
ingress-controllers="ctrl.originalIngressControllers"
|
ingress-controllers="ctrl.originalIngressControllers"
|
||||||
|
is-loading="ctrl.isIngressControllersLoading"
|
||||||
description="'Enabling ingress controllers in your cluster allows them to be available in the Portainer UI for users to publish applications over HTTP/HTTPS. A controller must have a class name for it to be included here.'"
|
description="'Enabling ingress controllers in your cluster allows them to be available in the Portainer UI for users to publish applications over HTTP/HTTPS. A controller must have a class name for it to be included here.'"
|
||||||
no-ingress-controller-label="'No supported ingress controllers found.'"
|
no-ingress-controller-label="'No supported ingress controllers found.'"
|
||||||
view="'cluster'"
|
view="'cluster'"
|
||||||
|
|
|
@ -198,7 +198,7 @@ class KubernetesConfigureController {
|
||||||
this.assignFormValuesToEndpoint(this.endpoint, storageClasses, ingressClasses);
|
this.assignFormValuesToEndpoint(this.endpoint, storageClasses, ingressClasses);
|
||||||
await this.EndpointService.updateEndpoint(this.endpoint.Id, this.endpoint);
|
await this.EndpointService.updateEndpoint(this.endpoint.Id, this.endpoint);
|
||||||
// updateIngressControllerClassMap must be done after updateEndpoint, as a hacky workaround. A better solution: saving ingresscontrollers somewhere else, is being discussed
|
// updateIngressControllerClassMap must be done after updateEndpoint, as a hacky workaround. A better solution: saving ingresscontrollers somewhere else, is being discussed
|
||||||
await updateIngressControllerClassMap(this.state.endpointId, this.ingressControllers);
|
await updateIngressControllerClassMap(this.state.endpointId, this.ingressControllers || []);
|
||||||
this.state.isSaving = true;
|
this.state.isSaving = true;
|
||||||
const storagePromises = _.map(storageClasses, (storageClass) => {
|
const storagePromises = _.map(storageClasses, (storageClass) => {
|
||||||
const oldStorageClass = _.find(this.oldStorageClasses, { Name: storageClass.Name });
|
const oldStorageClass = _.find(this.oldStorageClasses, { Name: storageClass.Name });
|
||||||
|
@ -224,19 +224,7 @@ class KubernetesConfigureController {
|
||||||
}
|
}
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
const toDel = _.filter(this.formValues.IngressClasses, { NeedsDeletion: true });
|
return this.$async(this.configureAsync);
|
||||||
if (toDel.length) {
|
|
||||||
this.ModalService.confirmUpdate(
|
|
||||||
`Removing ingress controllers may cause applications to be unaccessible. All ingress configurations from affected applications will be removed.<br/><br/>Do you wish to continue?`,
|
|
||||||
(confirmed) => {
|
|
||||||
if (confirmed) {
|
|
||||||
return this.$async(this.configureAsync);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return this.$async(this.configureAsync);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
||||||
|
@ -292,6 +280,7 @@ class KubernetesConfigureController {
|
||||||
IngressAvailabilityPerNamespace: false,
|
IngressAvailabilityPerNamespace: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.isIngressControllersLoading = true;
|
||||||
try {
|
try {
|
||||||
this.availableAccessModes = new KubernetesStorageClassAccessPolicies();
|
this.availableAccessModes = new KubernetesStorageClassAccessPolicies();
|
||||||
|
|
||||||
|
@ -332,6 +321,7 @@ class KubernetesConfigureController {
|
||||||
this.Notifications.error('Failure', err, 'Unable to retrieve environment configuration');
|
this.Notifications.error('Failure', err, 'Unable to retrieve environment configuration');
|
||||||
} finally {
|
} finally {
|
||||||
this.state.viewReady = true;
|
this.state.viewReady = true;
|
||||||
|
this.isIngressControllersLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('beforeunload', this.onBeforeOnload);
|
window.addEventListener('beforeunload', this.onBeforeOnload);
|
||||||
|
|
|
@ -109,7 +109,7 @@ class KubernetesCreateResourcePoolController {
|
||||||
this.checkDefaults();
|
this.checkDefaults();
|
||||||
this.formValues.Owner = this.Authentication.getUserDetails().username;
|
this.formValues.Owner = this.Authentication.getUserDetails().username;
|
||||||
await this.KubernetesResourcePoolService.create(this.formValues);
|
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.Notifications.success('Namespace successfully created', this.formValues.Name);
|
||||||
this.$state.go('kubernetes.resourcePools');
|
this.$state.go('kubernetes.resourcePools');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -144,7 +144,7 @@ class KubernetesResourcePoolController {
|
||||||
try {
|
try {
|
||||||
this.checkDefaults();
|
this.checkDefaults();
|
||||||
await this.KubernetesResourcePoolService.patch(oldFormValues, newFormValues);
|
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.Notifications.success('Namespace successfully updated', this.pool.Namespace.Name);
|
||||||
this.$state.reload(this.$state.current);
|
this.$state.reload(this.$state.current);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ interface Props {
|
||||||
) => void; // angular function to save the ingress class list
|
) => void; // angular function to save the ingress class list
|
||||||
description: string;
|
description: string;
|
||||||
ingressControllers: IngressControllerClassMap[] | undefined;
|
ingressControllers: IngressControllerClassMap[] | undefined;
|
||||||
|
isLoading: boolean;
|
||||||
noIngressControllerLabel: string;
|
noIngressControllerLabel: string;
|
||||||
view: string;
|
view: string;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +28,7 @@ export function IngressClassDatatable({
|
||||||
onChangeAvailability,
|
onChangeAvailability,
|
||||||
description,
|
description,
|
||||||
ingressControllers,
|
ingressControllers,
|
||||||
|
isLoading,
|
||||||
noIngressControllerLabel,
|
noIngressControllerLabel,
|
||||||
view,
|
view,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
|
@ -42,7 +44,7 @@ export function IngressClassDatatable({
|
||||||
storageKey="ingressClasses"
|
storageKey="ingressClasses"
|
||||||
columns={columns}
|
columns={columns}
|
||||||
settingsStore={settings}
|
settingsStore={settings}
|
||||||
isLoading={!ingControllerFormValues}
|
isLoading={isLoading}
|
||||||
emptyContentLabel={noIngressControllerLabel}
|
emptyContentLabel={noIngressControllerLabel}
|
||||||
titleOptions={{
|
titleOptions={{
|
||||||
icon: 'database',
|
icon: 'database',
|
||||||
|
|
Loading…
Reference in New Issue