mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 05:19:39 +02:00
fix(k8s): fix error handling for namespace restricted user EE-1703 (#5692)
* fix error handler for user has no namespace access
This commit is contained in:
parent
b876f2d17d
commit
e1f725d01a
5 changed files with 1446 additions and 1432 deletions
|
@ -107,7 +107,9 @@ class KubernetesDeployController {
|
|||
this.state.BuildMethod === KubernetesDeployBuildMethods.WEB_EDITOR && _.isEmpty(this.formValues.EditorContent) && _.isEmpty(this.formValues.Namespace);
|
||||
const isURLFormInvalid = this.state.BuildMethod == KubernetesDeployBuildMethods.WEB_EDITOR.URL && _.isEmpty(this.formValues.ManifestURL);
|
||||
|
||||
return isGitFormInvalid || isWebEditorInvalid || isURLFormInvalid || this.state.actionInProgress;
|
||||
const isNamespaceInvalid = _.isEmpty(this.formValues.Namespace);
|
||||
|
||||
return isGitFormInvalid || isWebEditorInvalid || isURLFormInvalid || this.state.actionInProgress || isNamespaceInvalid;
|
||||
}
|
||||
|
||||
onChangeFormValues(values) {
|
||||
|
@ -230,7 +232,9 @@ class KubernetesDeployController {
|
|||
});
|
||||
|
||||
this.namespaces = namespaces;
|
||||
this.formValues.Namespace = this.namespaces[0].Name;
|
||||
if (this.namespaces.length > 0) {
|
||||
this.formValues.Namespace = this.namespaces[0].Name;
|
||||
}
|
||||
} catch (err) {
|
||||
this.Notifications.error('Failure', err, 'Unable to load namespaces data');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue