use of com.openshift.restclient.model.IEnvironmentVariable in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromImageJob method createEnvVars.
private List<IEnvironmentVariable> createEnvVars() {
List<IEnvironmentVariable> list = new ArrayList<>();
buildConfigModel.getEnvVariablesModel().getEnvironmentVariables().forEach(v -> list.add(new IEnvironmentVariable() {
@Override
public String getName() {
return v.getKey();
}
@Override
public String getValue() {
return v.getValue();
}
@Override
public IEnvVarSource getValueFrom() {
return null;
}
@Override
public String toJson() {
ModelNode node = new ModelNode();
node.get("name").set(getName());
node.get("value").set(getValue());
return node.toJSONString(true);
}
}));
return list;
}
use of com.openshift.restclient.model.IEnvironmentVariable in project jbosstools-openshift by jbosstools.
the class OpenshiftJMXConnectionProvider method getJolokiaPort.
protected String getJolokiaPort(IPod pod) {
String port = "8778";
IReplicationController rc = ResourceUtils.getDeploymentConfigOrReplicationControllerFor(pod);
if (rc != null) {
Optional<IEnvironmentVariable> envPort = rc.getEnvironmentVariables().stream().filter(env -> env.getName().equals("AB_JOLOKIA_PORT")).findFirst();
if (envPort.isPresent()) {
port = envPort.get().getValue();
}
}
return port;
}
use of com.openshift.restclient.model.IEnvironmentVariable in project jbosstools-openshift by jbosstools.
the class ResourceMocks method createEnvironmentVariable.
public static IEnvironmentVariable createEnvironmentVariable(String name, String value) {
IEnvironmentVariable var = mock(IEnvironmentVariable.class);
doReturn(name).when(var).getName();
doReturn(value).when(var).getValue();
return var;
}
Aggregations