-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use che.infrastructure.kubernetes.namespace.default during workspace namespace resolution #14828
Use che.infrastructure.kubernetes.namespace.default during workspace namespace resolution #14828
Conversation
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, is OK for me.
Let me know when it is not WIP anymore, will do final review and test/play with changes locally.
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Outdated
Show resolved
Hide resolved
...java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactory.java
Outdated
Show resolved
Hide resolved
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
ci-build |
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
crw-ci-test |
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM
Approve will come after local testing of the changes
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
& isCreatingNamespaces -> isCreatingNamespace. Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
…-props-for-wrkspc-namespace Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
… fails Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
.../java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespace.java
Outdated
Show resolved
Hide resolved
...a/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/pvc/WorkspacePVCCleaner.java
Show resolved
Hide resolved
...c/main/java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProject.java
Show resolved
Hide resolved
...-core-api-workspace-shared/src/main/java/org/eclipse/che/api/workspace/shared/Constants.java
Outdated
Show resolved
Hide resolved
...-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java
Outdated
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
A lot of changes happened after my latest approval. I wish redo review and test
...java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactory.java
Show resolved
Hide resolved
...java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactory.java
Outdated
Show resolved
Hide resolved
...java/org/eclipse/che/workspace/infrastructure/openshift/project/OpenShiftProjectFactory.java
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
...rg/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java
Show resolved
Hide resolved
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
ci-test |
// if it doesn't, we're using the new logic. | ||
return checkNamespaceExists( | ||
resolveLegacyNamespaceName(EnvironmentContext.getCurrent().getSubject(), workspaceId)) | ||
|| newLogic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use || and it means that is newLogic is true - then it does not matter if namespace exists or not.
It makes me thinking that something is wrong. Please double check that it's correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we can override it in the following way:
public boolean isManagingNamespace(String workspaceId) throws InfrastructureException {
// the new logic is quite simple.
boolean isNewNamespaceManaged =
defaultNamespaceName != null && defaultNamespaceName.contains(WORKSPACEID_PLACEHOLDER);
if (isNewNamespaceManaged) {
return true;
}
boolean legacyHasWorkspacePlaceholder = isNullOrEmpty(legacyNamespaceName) || legacyNamespaceName.contains(WORKSPACEID_PLACEHOLDER);
return legacyHasWorkspacePlaceholder && checkNamespaceExists(resolveLegacyNamespaceName(EnvironmentContext.getCurrent().getSubject(), workspaceId));
}
Not sure if it's simpler for understanding but at least conditions seem clearer.
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What does this PR do?
This PR implements a quick and dirty way of implementing the namespace resolution according to the following rules specified in #14376 (comment).
This is a very minimal implementation that is (hopefully) going to change drastically in the near future once we add the ability for the user to actually select the namespace for a workspace.
Because the implementation tries to be very localized and minimal if mightily hacky, it deviates from the proposed solution in some minor details. Namely:
allow_user_defined
is true, because we actually don't support that functionality yet. There's a warning emitted at start up time about that.che.infra.kubernetes.namespace
orche.infra.openshift.project
properties exists, the new propertyche.infra.kubernetes.namespace.default
is completely ignored and even the new workspaces are deployed into the namespace/project specified by the legacy properties. This is the consequence of the minimal amount of change we wanted in this PR and this restriction will only be lifted once we implement user-defined target namespace of workspaces. At the same time, we think that introducing this kind of change at this point in time will enable smoother upgrade as we progress with the 7.x releases and people start to adopt Che 7.What issues does this PR fix or reference?
#14376