redhat-developer / intellij-openshift-connector

IntelliJ OpenShift Toolkit
https://plugins.jetbrains.com/plugin/12030-openshift-toolkit-by-red-hat/
Eclipse Public License 2.0
16 stars 23 forks source link

Setting a proxy has no effect unless you restart the IDE #943

Open adietish opened 3 weeks ago

adietish commented 3 weeks ago

Steps:

  1. ASSERT: have plugin running
  2. EXEC: Go Settings > Appearance & Behavior > System Settings > HTTP Proxy & provide a proxy (ex. corporate redhat proxy available behind VPN)

Result: The command line tools like oc are still not using the proxy. You have to restart the IDE for those to use the proxy that you just configured Unfortunately I dont see how to manually verify this. The only thing I have is proof in code. The proxy is put to the env variables when a tool instance is instantiated. No update happens if settings are changed):

org.jboss.tools.intellij.openshift.utils.oc.OcCli:

  public OcCli(
     ...
    this.envVars = envVarFactory.apply(String.valueOf(client.getMasterUrl()));
    ...
  }

org.jboss.tools.intellij.openshift.utils.Cli.EnvVarFactory

    public Map<String, String> apply(String url) {
        ...
        return NetworkUtils.buildEnvironmentVariables(url);
        ...
    }
  }