Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
fixup! fixup! fixup! rh-che #541: Login to user project using oc CLI …
Browse files Browse the repository at this point in the history
…in workspace containers
  • Loading branch information
Oleksandr Garagatyi committed Mar 1, 2018
1 parent 0554047 commit bc4e6ea
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.eclipse.che.api.core.model.workspace.runtime.MachineStatus;
import org.eclipse.che.api.core.notification.EventService;
import org.eclipse.che.api.core.notification.EventSubscriber;
import org.eclipse.che.api.workspace.server.WorkspaceManager;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.api.workspace.shared.dto.event.MachineStatusEvent;
import org.eclipse.che.commons.subject.Subject;
Expand All @@ -39,15 +40,18 @@ public class OsoUserTokenInjector implements EventSubscriber<MachineStatusEvent>
private final OpenshiftUserTokenProvider openshiftUserTokenProvider;
private final TenantDataProvider tenantDataProvider;
private final WorkspaceSubjectsRegistry subjectsRegistry;
private final WorkspaceManager workspaceManager;

@Inject
public OsoUserTokenInjector(
OpenshiftUserTokenProvider openshiftUserTokenProvider,
TenantDataProvider tenantDataProvider,
WorkspaceSubjectsRegistry subjectsRegistry) {
OpenshiftUserTokenProvider openshiftUserTokenProvider,
TenantDataProvider tenantDataProvider,
WorkspaceSubjectsRegistry subjectsRegistry,
WorkspaceManager workspaceManager) {
this.openshiftUserTokenProvider = openshiftUserTokenProvider;
this.tenantDataProvider = tenantDataProvider;
this.subjectsRegistry = subjectsRegistry;
this.workspaceManager = workspaceManager;
}

@Inject
Expand Down Expand Up @@ -83,6 +87,8 @@ public void onEvent(MachineStatusEvent event) {

// 3. Execute oc login against all the containers (or just the dev one)
// 4. Execute oc project <namespace>
workspaceManager.getWorkspace(event.getIdentity().getWorkspaceId())

}

private String getOsoToken(Subject subject) {
Expand Down

0 comments on commit bc4e6ea

Please sign in to comment.