mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
feat/ee-1991/validate-k8s-workload (#6302)
This commit is contained in:
parent
118809a9c0
commit
24893573aa
4 changed files with 19 additions and 13 deletions
|
@ -102,11 +102,18 @@ class KubernetesCreateResourcePoolController {
|
|||
/* #endregion */
|
||||
|
||||
isCreateButtonDisabled() {
|
||||
return this.state.actionInProgress || (this.formValues.HasQuota && !this.isQuotaValid()) || this.state.isAlreadyExist || this.state.duplicates.ingressHosts.hasRefs;
|
||||
return (
|
||||
this.state.actionInProgress ||
|
||||
(this.formValues.HasQuota && !this.isQuotaValid()) ||
|
||||
this.state.isAlreadyExist ||
|
||||
this.state.hasPrefixKube ||
|
||||
this.state.duplicates.ingressHosts.hasRefs
|
||||
);
|
||||
}
|
||||
|
||||
onChangeName() {
|
||||
this.state.isAlreadyExist = _.find(this.resourcePools, (resourcePool) => resourcePool.Namespace.Name === this.formValues.Name) !== undefined;
|
||||
this.state.hasPrefixKube = /^kube-/.test(this.formValues.Name);
|
||||
}
|
||||
|
||||
isQuotaValid() {
|
||||
|
@ -200,6 +207,7 @@ class KubernetesCreateResourcePoolController {
|
|||
sliderMaxCpu: 0,
|
||||
viewReady: false,
|
||||
isAlreadyExist: false,
|
||||
hasPrefixKube: false,
|
||||
canUseIngress: endpoint.Kubernetes.Configuration.IngressClasses.length,
|
||||
duplicates: {
|
||||
ingressHosts: new KubernetesFormValidationReferences(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue