[
https://issues.jboss.org/browse/JBIDE-15766?page=com.atlassian.jira.plugi...
]
Andre Dietisheim edited comment on JBIDE-15766 at 10/24/13 6:56 PM:
--------------------------------------------------------------------
talking to clayton I was told that we should be able to get the map of variables, modify
it and push it back. Telling him about our integration tests, that fails if we add the
same variable twice his quick catch was that we should try to use PUT instead of POST -
the link's using POST:
{code}
{
"api_version":1.2,
"data":[
{
...
"SET_UNSET_ENVIRONMENT_VARIABLES":{
"href":"https://openshift.redhat.com/broker/rest/domains/foobarz/applications/scalable/environment-variables",
"method":"POST",
"optional_params":[
{
...
"type":"applications",
"version":"1.2"
}
{code}
...we should override it)
was (Author: adietish):
talking to clayton I was told that we should be able to get the map of variables,
modify it and push it back. Telling him about our integration tests, that fails if we add
the same variable twice his quick catch was that we should try to use PUT instead of POST
(the link's using POST, we should override it)
openshift-java-client: dont refresh env variables on each
addition/removal
--------------------------------------------------------------------------
Key: JBIDE-15766
URL:
https://issues.jboss.org/browse/JBIDE-15766
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: openshift
Affects Versions: 4.1.1.Beta1, 4.2.0.Alpha1
Reporter: Andre Dietisheim
Assignee: Andre Dietisheim
Fix For: 4.1.1.Beta1, 4.2.0.Alpha1
When adding/removing environment variables, the openshift-java-client would always
request the backend for the full list. This should not be required and avoided
{code:title=ApplicationResource#addEnvironmentVariable}
EnvironmentVariableResourceDTO environmentVariableResourceDTO =
new AddEnvironmentVariableRequest().execute(name, value);
IEnvironmentVariable environmentVariable = new
EnvironmentVariableResource(environmentVariableResourceDTO, this);
updateEnvironmentVariables();
return environmentVariable;
{code}
{code:title=ApplicationResource#updateEnvironmentVariables}
protected void updateEnvironmentVariables() throws OpenShiftException {
if (environmentVariableByName == null) {
environmentVariableByName = loadEnvironmentVariables();
} else {
environmentVariableByName.clear();
environmentVariableByName.putAll(loadEnvironmentVariables());
}
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira