-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: Removing dependency on usr, accout, profile db entries #398
feat: Removing dependency on usr, accout, profile db entries #398
Conversation
582fee5
to
e6ef88f
Compare
17e050a
to
7b0e802
Compare
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 looks good. Some small nitpicks in the comments.
* @return true if the namespace can be created, false if the namespace is expected to already | ||
* exist | ||
* @throws InfrastructureException on failure | ||
*/ | ||
protected boolean canCreateNamespace(RuntimeIdentity identity) throws InfrastructureException { | ||
protected boolean canCreateNamespace(RuntimeIdentity identity, String userName) |
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.
When I look at canCreateNamespace
and getOrCreate
I would consider
- Add username to both methods
- Or add username/ownerName to RuntimeIdentity
Since RuntimeIdentity has already ownerId I think second option is better
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.
I also thought about that, but this would require quite a few changes in the obsolete classes like PluginBrokerManager which are planned to be removed completely in Phase 2 of the db removal procedure. The goal of this PR is to make all the stored data in Postgres irrelevant. In the future PR, major cleanup / refactoring is going to happen when the whole DAO layer will be removed completely (currently targeted for 7.61)
@@ -320,14 +309,14 @@ public KubernetesNamespace getOrCreate(RuntimeIdentity identity) throws Infrastr | |||
KubernetesNamespace namespace = get(identity); | |||
|
|||
var subject = EnvironmentContext.getCurrent().getSubject(); | |||
var userName = subject.getUserName(); |
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.
See my comment to canCreateNamespace
method
.endMetadata() | ||
.build(); | ||
} | ||
throws InfrastructureException {} |
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.
consider adding some descriptive message to the exception.
@@ -106,14 +106,14 @@ public OpenShiftProject getOrCreate(RuntimeIdentity identity) throws Infrastruct | |||
OpenShiftProject osProject = get(identity); | |||
|
|||
var subject = EnvironmentContext.getCurrent().getSubject(); | |||
var userName = subject.getUserName(); |
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.
see my comment to canCreateNamespace
method
@@ -51,7 +52,6 @@ public AccountManager(AccountDao accountDao, EventService eventService) { | |||
*/ | |||
public void create(Account account) throws ConflictException, ServerException { | |||
requireNonNull(account, "Required non-null account"); | |||
accountDao.create(new AccountImpl(account)); |
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.
Since you don't expect that someone will call this method. What about throwing an exception?
throw new ServerException("account creation are not expected to be invoked")
Something like that.
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.
fixed
7b0e802
to
4a03f9a
Compare
4a03f9a
to
696b097
Compare
eclipse-che/che#21846 has been resolved |
Signed-off-by: Ilya Buziuk <[email protected]>
Signed-off-by: Ilya Buziuk <[email protected]>
696b097
to
05fe6f5
Compare
Build 3.5 :: server_3.x/105: Console, Changes, Git Data |
Build 3.5 :: sync-to-downstream_3.x/1998: Console, Changes, Git Data |
Build 3.5 :: get-sources-rhpkg-container-build_3.x/1919: server : 3.x :: Failed in 50072228 : BREW:BUILD/STATUS:UNKNOWN |
NOTE: PR should be merged only once operands like dashboard do not fall back on retrieving any information from db e.g. workspace API dependency eclipse-che/che#21846
What does this PR do?
@che
which is done for backward compatibility with UD that still reads 3 properties from the secret (id / name / email)Issue Refernce
Part of eclipse-che/che#21374
How to test this PR?
Image -
quay.io/ibuziuk/che-server:pr-398
user1
on RHPDS) and start a few workspacesuser2
on RHPDS) and start a few workspacesuser1
- check that old and new workspaces are started correctlyuser1
on RHPDS) persisted, and no entries for the second user (user2
on RHPDS)PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.