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

Add internal and external API URL environment variables for workspaces #9475

Merged
merged 22 commits into from
Apr 27, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
61e2780
Provide internal and external api url into workspaces
mkuznyetsov Apr 11, 2018
3ff7e90
Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 13, 2018
4e07ca8
fixup! Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 18, 2018
5b2695c
fixup! fixup! Merge branch 'master' of github.com:eclipse/che into ch…
mkuznyetsov Apr 18, 2018
f1c129c
fixup! fixup! fixup! Merge branch 'master' of github.com:eclipse/che …
mkuznyetsov Apr 18, 2018
25133b1
fixup! fixup! fixup! fixup! Merge branch 'master' of github.com:eclip…
mkuznyetsov Apr 18, 2018
f42a5a8
fixup! fixup! fixup! fixup! fixup! Merge branch 'master' of github.co…
mkuznyetsov Apr 18, 2018
308c5a5
fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'master' of gi…
mkuznyetsov Apr 18, 2018
b8fa831
Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 18, 2018
8ddeb71
test
Apr 18, 2018
d75bc47
Update ocp.sh
Apr 18, 2018
9ee2ad7
Tets envs
Apr 18, 2018
aea61c2
Remove testing echo
Apr 19, 2018
58fffc9
Remove odd classes
mkuznyetsov Apr 24, 2018
ab94315
fixup! Remove odd classes
mkuznyetsov Apr 24, 2018
d64d787
fixup! fixup! Remove odd classes
mkuznyetsov Apr 24, 2018
fbffe2a
fixup! fixup! fixup! Remove odd classes
mkuznyetsov Apr 24, 2018
e9574ec
Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 24, 2018
5984ec0
fixup! Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 25, 2018
773de1e
fixup! fixup! Merge branch 'master' of github.com:eclipse/che into ch…
mkuznyetsov Apr 25, 2018
95da304
Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 26, 2018
08d85d9
Merge branch 'master' of github.com:eclipse/che into che-9323
mkuznyetsov Apr 27, 2018
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 @@ -50,6 +50,8 @@
import org.eclipse.che.api.workspace.server.spi.provision.ProjectsVolumeForWsAgentProvisioner;
import org.eclipse.che.api.workspace.server.spi.provision.env.AgentAuthEnableEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.EnvVarEnvironmentProvisioner;
import org.eclipse.che.api.workspace.server.spi.provision.env.EnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.JavaOptsEnvVariableProvider;
Expand Down Expand Up @@ -153,6 +155,8 @@ protected void configure() {
Multibinder<EnvVarProvider> envVarProviders =
Multibinder.newSetBinder(binder(), EnvVarProvider.class);
envVarProviders.addBinding().to(CheApiEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiInternalEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiExternalEnvVarProvider.class);
envVarProviders.addBinding().to(MachineTokenEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceIdEnvVarProvider.class);

Expand Down
3 changes: 2 additions & 1 deletion dockerfiles/init/manifests/che.env
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
#
# Browser --> Che Server
# 1. Default is 'http://localhost:${SERVER_PORT}/api'.
# 2. Else use the value of CHE_API
# 2. Else use the value of CHE_API_EXTERNAL
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we need to remove this change too.

#
# Che Server --> Docker Daemon Progression:
# 1. Use the value of CHE_INFRA_DOCKER_DAEMON__URL
Expand Down Expand Up @@ -190,6 +190,7 @@
# The location of the API end point where dashboard and IDE clients will look for
# interacting with the Che server, which we also call the workspace master.
#CHE_API=http://${CHE_HOST}:${CHE_PORT}/api

# Che Server default websocket endpoint.
# Provides basic communication endpoint where clients can get/push statuses/output.
#CHE_WEBSOCKET_ENDPOINT=ws://${CHE_HOST}:${CHE_PORT}/api/websocket
Expand Down
1 change: 1 addition & 0 deletions dockerfiles/init/modules/che/templates/che.env.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ CHE_LOGS_DIR=/logs
CHE_WORKSPACE_LOGS=/logs/machines
CHE_TEMPLATE_STORAGE=/data/templates

CHE_API_EXTERNAL=<%= scope.lookupvar('che::che_server_url') %>/api

Copy link
Contributor

Choose a reason for hiding this comment

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

remove this change if not needed

<% if ! @che_http_proxy.empty? or ! @che_https_proxy.empty? -%>
JAVA_HTTP_PROXY_SET=-Dhttp.proxySet=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public class DockerCheApiEnvVarProvider implements CheApiEnvVarProvider {
@Inject
public DockerCheApiEnvVarProvider(
@Named("che.infra.docker.master_api_endpoint") String apiEndpoint) {
String apiEndpointEnvVar = System.getenv(API_ENDPOINT_URL_VARIABLE);
String apiEndpointEnvVar = System.getenv(CHE_API_VARIABLE);
if (Strings.isNullOrEmpty(apiEndpoint) && !Strings.isNullOrEmpty(apiEndpointEnvVar)) {
apiEndpoint = apiEndpointEnvVar;
}
apiEnvVar = Pair.of(API_ENDPOINT_URL_VARIABLE, apiEndpoint);
apiEnvVar = Pair.of(CHE_API_VARIABLE, apiEndpoint);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.workspace.infrastructure.docker;

import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.commons.lang.Pair;

/**
* Provides env variable to docker machine with url of Che external API.
*
* @author Mykhailo Kuznietsov
*/
@Singleton
public class DockerCheApiExternalEnvVarProvider implements CheApiExternalEnvVarProvider {

private final Pair<String, String> apiEnvVar;

@Inject
public DockerCheApiExternalEnvVarProvider() {
apiEnvVar = Pair.of(CHE_API_EXTERNAL_VARIABLE, System.getenv(CHE_API_EXTERNAL_VARIABLE));
Copy link
Member

Choose a reason for hiding this comment

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

Please explain why do you use System.getenv(CHE_API_EXTERNAL_VARIABLE) but not injected che.api constant

}

@Override
public Pair<String, String> get(RuntimeIdentity runtimeIdentity) {
return apiEnvVar;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.workspace.infrastructure.docker;

import com.google.common.base.Strings;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.commons.lang.Pair;

/**
* Provides env variable to docker machine with url of Che API.
*
* @author Mykhailo Kuznietsov
*/
@Singleton
public class DockerCheApiInternalEnvVarProvider implements CheApiInternalEnvVarProvider {

private Pair<String, String> apiEnvVar;

@Inject
public DockerCheApiInternalEnvVarProvider(
@Named("che.infra.docker.master_api_endpoint") String apiEndpoint) {
String apiEndpointEnvVar = System.getenv(CHE_API_INTERNAL_VARIABLE);
Copy link
Member

Choose a reason for hiding this comment

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

I would say that it should be removed. If a user wants to customize this value he is able to specify CHE_INFRA_DOCKER_MASTER__API__ENDPOINT environment variable.

if (Strings.isNullOrEmpty(apiEndpoint) && !Strings.isNullOrEmpty(apiEndpointEnvVar)) {
apiEndpoint = apiEndpointEnvVar;
}
apiEnvVar = Pair.of(CHE_API_INTERNAL_VARIABLE, apiEndpoint);
}

@Override
public Pair<String, String> get(RuntimeIdentity runtimeIdentity) {
return new Pair<>(apiEnvVar.first, apiEnvVar.second);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.eclipse.che.api.workspace.server.URLRewriter;
import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.infrastructure.docker.client.DockerRegistryDynamicAuthResolver;
import org.eclipse.che.infrastructure.docker.client.NoOpDockerRegistryDynamicAuthResolverImpl;
import org.eclipse.che.workspace.infrastructure.docker.bootstrap.DockerBootstrapperFactory;
Expand Down Expand Up @@ -61,6 +63,8 @@ protected void configure() {
install(new ContainerSystemSettingsProvisioningModule());

bind(CheApiEnvVarProvider.class).to(DockerCheApiEnvVarProvider.class);
bind(CheApiInternalEnvVarProvider.class).to(DockerCheApiInternalEnvVarProvider.class);
bind(CheApiExternalEnvVarProvider.class).to(DockerCheApiExternalEnvVarProvider.class);

bind(RuntimeInfrastructure.class).to(DockerRuntimeInfrastructure.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure;
import org.eclipse.che.api.workspace.server.spi.environment.InternalEnvironmentFactory;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.EnvVarProvider;
import org.eclipse.che.workspace.infrastructure.docker.environment.dockerimage.DockerImageEnvironment;
import org.eclipse.che.workspace.infrastructure.docker.environment.dockerimage.DockerImageEnvironmentFactory;
Expand All @@ -42,6 +44,8 @@
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.WorkspaceVolumeStrategyProvider;
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.KubernetesCheApiExternalEnvVarProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.KubernetesCheApiInternalEnvVarProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.env.LogsRootEnvVariableProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.server.DefaultHostIngressExternalServerExposer;
import org.eclipse.che.workspace.infrastructure.kubernetes.server.ExternalServerExposerStrategy;
Expand Down Expand Up @@ -70,6 +74,8 @@ protected void configure() {
bind(RemoveNamespaceOnWorkspaceRemove.class).asEagerSingleton();

bind(CheApiEnvVarProvider.class).to(KubernetesCheApiEnvVarProvider.class);
bind(CheApiInternalEnvVarProvider.class).to(KubernetesCheApiInternalEnvVarProvider.class);
bind(CheApiExternalEnvVarProvider.class).to(KubernetesCheApiExternalEnvVarProvider.class);

MapBinder<String, WorkspaceVolumesStrategy> volumesStrategies =
MapBinder.newMapBinder(binder(), String.class, WorkspaceVolumesStrategy.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.commons.lang.Pair;

/**
* Provides env variable to Kubernetes machine with url of Che API.
*
* @author Sergii Leshchenko
*/
public class KubernetesCheApiEnvVarProvider implements CheApiEnvVarProvider {
public class KubernetesCheApiEnvVarProvider implements CheApiEnvVarProvider{

private final String cheServerEndpoint;

Expand All @@ -33,6 +35,6 @@ public KubernetesCheApiEnvVarProvider(@Named("che.api") String cheServerEndpoint

@Override
public Pair<String, String> get(RuntimeIdentity runtimeIdentity) throws InfrastructureException {
return Pair.of("CHE_API", cheServerEndpoint);
return Pair.of(CHE_API_VARIABLE, cheServerEndpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.workspace.infrastructure.kubernetes.provision;

import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.commons.lang.Pair;

/**
* Provides env variable to Kubernetes machine with url of Che API.
*
* @author Mykhailo Kuznietsov
*/
public class KubernetesCheApiExternalEnvVarProvider implements CheApiExternalEnvVarProvider {

private final String cheServerEndpoint;

@Inject
public KubernetesCheApiExternalEnvVarProvider(@Named("che.api") String cheServerEndpoint) {
this.cheServerEndpoint = cheServerEndpoint;
}

@Override
public Pair<String, String> get(RuntimeIdentity runtimeIdentity) throws InfrastructureException {
return Pair.of(CHE_API_EXTERNAL_VARIABLE, cheServerEndpoint);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.workspace.infrastructure.kubernetes.provision;

import javax.inject.Inject;
import javax.inject.Named;
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.commons.lang.Pair;

/**
* Provides env variable to Kubernetes machine with url of Che API.
*
* @author Mykhailo Kuznietsov
*/
public class KubernetesCheApiInternalEnvVarProvider implements CheApiInternalEnvVarProvider {

private final String cheServerEndpoint;

@Inject
public KubernetesCheApiInternalEnvVarProvider(@Named("che.api") String cheServerEndpoint) {
this.cheServerEndpoint = cheServerEndpoint;
}

@Override
public Pair<String, String> get(RuntimeIdentity runtimeIdentity) throws InfrastructureException {
return Pair.of(CHE_API_INTERNAL_VARIABLE, cheServerEndpoint);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void shouldReturnCheApiEnv() throws Exception {
Pair<String, String> cheApiEnv = kubernetesCheApiEnvVarProvider.get(null);

// then
assertEquals(cheApiEnv.first, KubernetesCheApiEnvVarProvider.API_ENDPOINT_URL_VARIABLE);
assertEquals(cheApiEnv.first, KubernetesCheApiEnvVarProvider.CHE_API_VARIABLE);
assertEquals(cheApiEnv.second, CHE_SERVER_ENDPOINT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.eclipse.che.api.workspace.server.spi.RuntimeInfrastructure;
import org.eclipse.che.api.workspace.server.spi.environment.InternalEnvironmentFactory;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiExternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.CheApiInternalEnvVarProvider;
import org.eclipse.che.api.workspace.server.spi.provision.env.EnvVarProvider;
import org.eclipse.che.workspace.infrastructure.docker.environment.dockerimage.DockerImageEnvironment;
import org.eclipse.che.workspace.infrastructure.docker.environment.dockerimage.DockerImageEnvironmentFactory;
Expand All @@ -36,6 +38,8 @@
import org.eclipse.che.workspace.infrastructure.kubernetes.namespace.pvc.WorkspaceVolumeStrategyProvider;
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.KubernetesCheApiExternalEnvVarProvider;
import org.eclipse.che.workspace.infrastructure.kubernetes.provision.KubernetesCheApiInternalEnvVarProvider;
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;
Expand Down Expand Up @@ -67,6 +71,8 @@ protected void configure() {
bind(RemoveProjectOnWorkspaceRemove.class).asEagerSingleton();

bind(CheApiEnvVarProvider.class).to(KubernetesCheApiEnvVarProvider.class);
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need CHE_API env var?
Or it wasn't removed because of backward compatibility? If yes, then maybe it would be better to ensure it on Workspace API level instead of each infrastructure?
I mean creating CheApiEnvVarProvider class that will inject CheApiInternalEnvVarProvider and provide its value as CHE_API. WDYT?

bind(CheApiInternalEnvVarProvider.class).to(KubernetesCheApiInternalEnvVarProvider.class);
bind(CheApiExternalEnvVarProvider.class).to(KubernetesCheApiExternalEnvVarProvider.class);

MapBinder<String, WorkspaceVolumesStrategy> volumesStrategies =
MapBinder.newMapBinder(binder(), String.class, WorkspaceVolumesStrategy.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public interface CheApiEnvVarProvider extends EnvVarProvider {

/** Env variable for machine that contains url of Che API */
String API_ENDPOINT_URL_VARIABLE = "CHE_API";
String CHE_API_VARIABLE = "CHE_API";

/**
* Returns Che API environment variable which should be injected into machines.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.api.workspace.server.spi.provision.env;

import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.lang.Pair;

/** @author Sergii Leshchenko */
public interface CheApiExternalEnvVarProvider extends EnvVarProvider {

/** Env variable for machine that contains url of Che API */
String CHE_API_EXTERNAL_VARIABLE = "CHE_API_EXTERNAL";

/**
* Returns Che API environment variable which should be injected into machines.
*
* @param runtimeIdentity which may be needed to evaluate environment variable value
*/
@Override
Pair<String, String> get(RuntimeIdentity runtimeIdentity) throws InfrastructureException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.api.workspace.server.spi.provision.env;

import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
import org.eclipse.che.commons.lang.Pair;

/** @author Sergii Leshchenko */
Copy link
Member

Choose a reason for hiding this comment

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

Please fix authorship here

public interface CheApiInternalEnvVarProvider extends EnvVarProvider {

/** Env variable for machine that contains url of Che API */
String CHE_API_INTERNAL_VARIABLE = "CHE_API_INTERNAL";

/**
* Returns Che API environment variable which should be injected into machines.
Copy link
Member

Choose a reason for hiding this comment

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

Please document what is internal Che API URL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

*
* @param runtimeIdentity which may be needed to evaluate environment variable value
*/
@Override
Pair<String, String> get(RuntimeIdentity runtimeIdentity) throws InfrastructureException;
}
Loading