Skip to content
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

Fix the update validation error while stopping an idling workspace. #15689

Merged
merged 4 commits into from
Jan 17, 2020

Conversation

metlos
Copy link
Contributor

@metlos metlos commented Jan 14, 2020

What does this PR do?

Do not perform the workspace namespace validation if the current user is anonymous.
This will skip the check in the scheduled jobs, where we are
in control of the data and will not affect the user initiated creations
or updates where an anonymous user would be rejected anyway.

What issues does this PR fix or reference?

#15667

is anonymous. This will skip the check in the scheduled jobs, where we are
in control of the data and will not affect the user initiated creations
or updates where an anonymous user would be rejected anyway.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@@ -76,7 +77,14 @@ public void validate(Map<String, String> attributes) throws ValidationException
+ "')");
}

namespaceFactoryProvider.get().checkIfNamespaceIsAllowed(namespace);
Copy link
Member

@ibuziuk ibuziuk Jan 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be wrong, but according to the comment below it looks like idling is broken in the upstream also, no ? (anonymous subject for scheduled jobs like idling is used in the similar manner in the upstream)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is the case it is just not clear for me why this error was not caught by the pre-release tests..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmytro-ndp @rhopp could you please take a look? would be great to understand if the pre-release testing actually run the idling tests or this use-case is not tested atm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this and as far as I understood, this bug doesn't exhibit itself because in the pre-release tests, we use a namespace default that doesn't have <username> or <userid> placeholder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@metlos could you point me to the code which checks the namespace part and placeholders / ? For now I do not fully understand how idling works and it looks like it works differently depending on the namespace strategies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the method used during workspace update to check that the namespace contained in the attributes is valid: https://github.com/eclipse/che/blob/b2b6f5f488ea523bac0a9313f0f65a23ac98a16a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/namespace/KubernetesNamespaceFactory.java#L139

Note that the current version of code in this branch calls this during the update only during a situation that I am not sure can happen even.

…idling

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
based on the suggestion by @sleshche. Also updated the javadocs to clarify
the responsibilities of the validation methods.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@centos-ci
Copy link

Can one of the admins verify this patch?

@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/bug Outline of a bug - must adhere to the bug report template. labels Jan 16, 2020
@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

E2E tests of Eclipse Che Multiuser on OCP has failed:

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

⚠️ https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

ℹ️ Use comment "crw-ci-test" to rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

✅ E2E Happy path tests succeed 🎉

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

@che-bot
Copy link
Contributor

che-bot commented Jan 16, 2020

E2E tests of Eclipse Che Multiuser on OCP has been successful:

@ibuziuk ibuziuk mentioned this pull request Jan 16, 2020
21 tasks
@metlos metlos merged commit 17d88e4 into eclipse-che:master Jan 17, 2020
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Jan 17, 2020
@che-bot che-bot added this to the 7.8.0 milestone Jan 17, 2020
vparfonov pushed a commit that referenced this pull request Jan 17, 2020
…15689)

Rework the namespace validation based on the suggestion by @sleshche. We now don't do full validation of update using the `validate` method but rather rely on `validateUpdate` to do the equivalent job.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
musienko-maxim pushed a commit that referenced this pull request Jan 21, 2020
…15689)

Rework the namespace validation based on the suggestion by @sleshche. We now don't do full validation of update using the `validate` method but rather rely on `validateUpdate` to do the equivalent job.

Signed-off-by: Lukas Krejci <lkrejci@redhat.com>

[TS_SELENIUM] Create a method for expanding project tree according to the provided path (#15754)
Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>

merge with upstream

change echo message

put commands into functions increase load page timeout

add necessary function

reduce timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants