Uploaded image for project: 'OpenShift Java Client'
  1. OpenShift Java Client
  2. OSJC-18

openshift-java-client: don't refresh env variables on each addition/removal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.5.0
    • None
    • None

      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

      ApplicationResource#addEnvironmentVariable
      		EnvironmentVariableResourceDTO environmentVariableResourceDTO =
      				new AddEnvironmentVariableRequest().execute(name, value);
      		IEnvironmentVariable environmentVariable = new EnvironmentVariableResource(environmentVariableResourceDTO, this);
      		updateEnvironmentVariables();
      		return environmentVariable;
      
      ApplicationResource#updateEnvironmentVariables
      	protected void updateEnvironmentVariables() throws OpenShiftException {
      		if (environmentVariableByName == null) {
      			environmentVariableByName = loadEnvironmentVariables();
      		} else {
      			environmentVariableByName.clear();
      			environmentVariableByName.putAll(loadEnvironmentVariables());
      		}
      	}
      

              adietish@redhat.com André Dietisheim
              adietish@redhat.com André Dietisheim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: