mirror of https://github.com/portainer/portainer
fix(app): fix exhaused error message [EE-6231] (#10949)
Co-authored-by: testa113 <testa113>pull/10943/head
parent
cb7efd8601
commit
d750389c67
|
@ -66,7 +66,7 @@
|
|||
<namespace-selector
|
||||
values="ctrl.formValues.ResourcePool.Namespace.Name"
|
||||
on-change="(ctrl.onChangeNamespaceName)"
|
||||
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isAdmin: ctrl.isAdmin}"
|
||||
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isEnvironmentAdmin: ctrl.state.isEnvironmentAdmin}"
|
||||
is-edit="ctrl.state.isEdit"
|
||||
></namespace-selector>
|
||||
<!-- kubernetes services options -->
|
||||
|
@ -159,7 +159,7 @@
|
|||
<namespace-selector
|
||||
values="ctrl.formValues.ResourcePool.Namespace.Name"
|
||||
on-change="(ctrl.onChangeNamespaceName)"
|
||||
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isAdmin: ctrl.isAdmin}"
|
||||
validation-data="{hasQuota: ctrl.state.resourcePoolHasQuota, isResourceQuotaCapacityExceeded: ctrl.resourceQuotaCapacityExceeded(), namespaceOptionCount: ctrl.resourcePools.length, isEnvironmentAdmin: ctrl.state.isEnvironmentAdmin}"
|
||||
is-edit="ctrl.state.isEdit"
|
||||
></namespace-selector>
|
||||
<!-- #endregion -->
|
||||
|
|
|
@ -121,6 +121,7 @@ class KubernetesCreateApplicationController {
|
|||
persistedFoldersUseExistingVolumes: false,
|
||||
pullImageValidity: false,
|
||||
nodePortServices: [],
|
||||
isEnvironmentAdmin: this.Authentication.hasAuthorizations(['K8sResourcePoolsW']),
|
||||
};
|
||||
|
||||
this.isAdmin = this.Authentication.isAdmin();
|
||||
|
|
|
@ -4,7 +4,7 @@ type ValidationData = {
|
|||
hasQuota: boolean;
|
||||
isResourceQuotaCapacityExceeded: boolean;
|
||||
namespaceOptionCount: number;
|
||||
isAdmin: boolean;
|
||||
isEnvironmentAdmin: boolean;
|
||||
};
|
||||
|
||||
const emptyValue =
|
||||
|
@ -17,7 +17,7 @@ export function namespaceSelectorValidation(
|
|||
hasQuota,
|
||||
isResourceQuotaCapacityExceeded,
|
||||
namespaceOptionCount,
|
||||
isAdmin,
|
||||
isEnvironmentAdmin,
|
||||
} = validationData || {};
|
||||
return string()
|
||||
.required(emptyValue)
|
||||
|
@ -25,7 +25,7 @@ export function namespaceSelectorValidation(
|
|||
.test(
|
||||
'resourceQuotaCapacityExceeded',
|
||||
`This namespace has exhausted its resource capacity and you will not be able to deploy the application.${
|
||||
isAdmin
|
||||
isEnvironmentAdmin
|
||||
? ''
|
||||
: ' Contact your administrator to expand the capacity of the namespace.'
|
||||
}`,
|
||||
|
|
Loading…
Reference in New Issue