Skip to content

Commit

Permalink
Add missing infrastructure registration
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Zhukovskyi <vzhukovs@redhat.com>
  • Loading branch information
vzhukovs committed Sep 9, 2019
1 parent 06a24a7 commit 3a423fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.che.workspace.infrastructure.kubernetes.KubernetesEnvironmentProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.WorkspaceVolumesStrategy;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.CertificateProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.GitUserProfileProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.ImagePullSecretProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.InstallerServersPortProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.LogsVolumeMachineProvisioner;
Expand Down Expand Up @@ -68,6 +69,7 @@ public class OpenShiftEnvironmentProvisioner
private final ServiceAccountProvisioner serviceAccountProvisioner;
private final CertificateProvisioner certificateProvisioner;
private final VcsSshKeysProvisioner vcsSshKeysProvisioner;
private final GitUserProfileProvisioner gitUserProfileProvisioner;

@Inject
public OpenShiftEnvironmentProvisioner(
Expand All @@ -86,7 +88,8 @@ public OpenShiftEnvironmentProvisioner(
ProxySettingsProvisioner proxySettingsProvisioner,
ServiceAccountProvisioner serviceAccountProvisioner,
CertificateProvisioner certificateProvisioner,
VcsSshKeysProvisioner vcsSshKeysProvisioner) {
VcsSshKeysProvisioner vcsSshKeysProvisioner,
GitUserProfileProvisioner gitUserProfileProvisioner) {
this.pvcEnabled = pvcEnabled;
this.volumesStrategy = volumesStrategy;
this.uniqueNamesProvisioner = uniqueNamesProvisioner;
Expand All @@ -103,6 +106,7 @@ public OpenShiftEnvironmentProvisioner(
this.serviceAccountProvisioner = serviceAccountProvisioner;
this.certificateProvisioner = certificateProvisioner;
this.vcsSshKeysProvisioner = vcsSshKeysProvisioner;
this.gitUserProfileProvisioner = gitUserProfileProvisioner;
}

@Override
Expand Down Expand Up @@ -138,6 +142,7 @@ public void provision(OpenShiftEnvironment osEnv, RuntimeIdentity identity)
serviceAccountProvisioner.provision(osEnv, identity);
certificateProvisioner.provision(osEnv, identity);
vcsSshKeysProvisioner.provision(osEnv, identity);
gitUserProfileProvisioner.provision(osEnv, identity);
LOG.debug(
"Provisioning OpenShift environment done for workspace '{}'", identity.getWorkspaceId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.WorkspaceVolumesStrategy;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.CertificateProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.GitUserProfileProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.ImagePullSecretProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.InstallerServersPortProvisioner;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.LogsVolumeMachineProvisioner;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class OpenShiftEnvironmentProvisionerTest {
@Mock private ServiceAccountProvisioner serviceAccountProvisioner;
@Mock private CertificateProvisioner certificateProvisioner;
@Mock private VcsSshKeysProvisioner vcsSshKeysProvisioner;
@Mock private GitUserProfileProvisioner gitUserProfileProvisioner;

private OpenShiftEnvironmentProvisioner osInfraProvisioner;

Expand All @@ -87,7 +89,8 @@ public void setUp() {
proxySettingsProvisioner,
serviceAccountProvisioner,
certificateProvisioner,
vcsSshKeysProvisioner);
vcsSshKeysProvisioner,
gitUserProfileProvisioner);
provisionOrder =
inOrder(
installerServersPortProvisioner,
Expand All @@ -104,7 +107,8 @@ public void setUp() {
proxySettingsProvisioner,
serviceAccountProvisioner,
certificateProvisioner,
vcsSshKeysProvisioner);
vcsSshKeysProvisioner,
gitUserProfileProvisioner);
}

@Test
Expand All @@ -130,6 +134,7 @@ public void performsOrderedProvisioning() throws Exception {
provisionOrder.verify(serviceAccountProvisioner).provision(eq(osEnv), eq(runtimeIdentity));
provisionOrder.verify(certificateProvisioner).provision(eq(osEnv), eq(runtimeIdentity));
provisionOrder.verify(vcsSshKeysProvisioner).provision(eq(osEnv), eq(runtimeIdentity));
provisionOrder.verify(gitUserProfileProvisioner).provision(eq(osEnv), eq(runtimeIdentity));
provisionOrder.verifyNoMoreInteractions();
}
}

0 comments on commit 3a423fa

Please sign in to comment.