Namespace normalization does not work with namespace.allow_user_defined=false
#18178
Closed
5 tasks done
Labels
area/che-server
kind/bug
Outline of a bug - must adhere to the bug report template.
severity/P1
Has a major impact to usage or development of the system.
Describe the bug
having
che.infra.kubernetes.namespace.allow_user_defined=false
, which is default, breaks workspace creation when we need to normalize the namespace name. We do so when for example username contains invalid characters, like an email address.Issue is in this condition https://github.com/eclipse/che/blob/master/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java#L180 where we're checking if already normalized namespace is matching with only placeholder evaluated namespace. It of course does not. To match this, we would need to normalize it again, which is not possible as we're doing some randomization there.
Proposed solution
I believe we should be able to store the normalized namespace in every normalization process to user's properties rather than do it only when we actually create it. It should not consume much time, because next time, we only get it from user properties. In condition mentioned above, we then check if proposed namespace is stored in user properties and if yes, we allow that, regardless
allow_user_defined=false
.❗ I think it's quite possible we will need to backport this to 7.20.
Che version
Steps to reproduce
❗ there's another issue that fails sooner than this - #18176. It was introduced by PR #18090. If it is isn't already fixed, use some version before that, like
7.20
. Or use this nasty patch on latest master https://gist.githubusercontent.com/sparkoo/a1d67817a9847a3f5919e18a187d3486/raw/e78897f9be4bb2e35b2a6cdbf69789c437099ee5/fix.diffUser defined namespaces are not allowed. Only the default namespace 'che-ws-' is available.
Expected behavior
normalized namespace must work with
namespace.allow_user_defined=false
Runtime
oc version
)Screenshots
Installation method
Environment
Eclipse Che Logs
Additional context
#17841
#17892
#18090
The text was updated successfully, but these errors were encountered: