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 Openshift infrastructure #9366

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@
* @author Alexander Garagatyi
*/
@Singleton
public class ServersConverter implements ConfigurationProvisioner {
public class ServersConverter<T extends KubernetesEnvironment>
implements ConfigurationProvisioner<T> {

private final ExternalServerExposerStrategy<KubernetesEnvironment> externalServerExposerStrategy;
private final ExternalServerExposerStrategy<T> externalServerExposerStrategy;

@Inject
public ServersConverter(
ExternalServerExposerStrategy<KubernetesEnvironment> externalServerExposerStrategy) {
public ServersConverter(ExternalServerExposerStrategy<T> externalServerExposerStrategy) {
this.externalServerExposerStrategy = externalServerExposerStrategy;
}

@Override
public void provision(KubernetesEnvironment k8sEnv, RuntimeIdentity identity)
throws InfrastructureException {
public void provision(T k8sEnv, RuntimeIdentity identity) throws InfrastructureException {

for (Pod podConfig : k8sEnv.getPods().values()) {
final PodSpec podSpec = podConfig.getSpec();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.UniqueWorkspacePVCStrategy.UNIQUE_STRATEGY;

import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.multibindings.MapBinder;
import com.google.inject.multibindings.Multibinder;
Expand All @@ -32,6 +33,7 @@
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.WorkspaceVolumesStrategy;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.KubernetesCheApiEnvVarProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.env.LogsRootEnvVariableProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.server.ServersConverter;
import org.eclipse.che.workspace.infrastructure.kubernetes.server.ExternalServerExposerStrategy;
import org.eclipse.che.workspace.infrastructure.openshift.environment.OpenShiftEnvironment;
import org.eclipse.che.workspace.infrastructure.openshift.environment.OpenShiftEnvironmentFactory;
Expand Down Expand Up @@ -68,7 +70,9 @@ protected void configure() {
volumesStrategies.addBinding(UNIQUE_STRATEGY).to(UniqueWorkspacePVCStrategy.class);
bind(WorkspaceVolumesStrategy.class).toProvider(WorkspaceVolumeStrategyProvider.class);

bind(ExternalServerExposerStrategy.class).to(OpenShiftExternalServerExposer.class);
bind(new TypeLiteral<ExternalServerExposerStrategy<OpenShiftEnvironment>>() {})
.to(OpenShiftExternalServerExposer.class);
bind(ServersConverter.class).to(new TypeLiteral<ServersConverter<OpenShiftEnvironment>>() {});

Multibinder<EnvVarProvider> envVarProviders =
Multibinder.newSetBinder(binder(), EnvVarProvider.class);
Expand Down