by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Frédéric THOMAS
    @doublefx
    yes there is a $home/.kube/config
    Stephane Bouchet
    @sbouchet
    ok, so the contents of the file should contains the company cluster url, and a token value.
    Frédéric THOMAS
    @doublefx
    yes it does
    Stephane Bouchet
    @sbouchet
    it is the same file that is used by commandline and IJ to connect to the cluster
    so no need to use proxy in your case to be able to connect to the cluster, its something else.
    last check, in IJ, open a terminal and type odo version
    and odo login
    Frédéric THOMAS
    @doublefx

    I set the proxy in order for IJ to connect the license server and get the plugins, my only concern was: does the connector use it? but it seems not to be an issue at the end because I excluded my company domains from being proxy in case the connector would use it.

    I hope there are using the same kube config, how can I make sure ?

    odo version:
    odo v1.0.0 (4e3175e6f)

    Server: https://ose-master-np.inv.adroot.lgim.com:8443
    OpenShift: v3.11.117
    Kubernetes: v1.11.0+d4cacc0

    and odo login performs well too:

    odo login
    Connecting to the OpenShift cluster

    Authentication required for https://ose-master-np.inv.adroot.lgim.com:8443 (openshift)
    Username: FT89797
    Password:
    Login successful.

    You have access to 118 projects, the list has been suppressed. You can list all projects with 'odo projects'

    Using project "distribution-build-tools".

    Frédéric THOMAS
    @doublefx
    My home is on a mapped network drive, could it be this?
    Frédéric THOMAS
    @doublefx
    I can see a FileSystems.getDefault().newWatchService() in th code, it might not work on a mapped network but I could be wrong
    Stephane Bouchet
    @sbouchet
    Err, not sure but's it's a valid clue.
    from javadoc : If a watched file is not located on a local storage device then it is implementation specific if changes to the file can be detected. In particular, it is not required that changes to files carried out on remote systems be detected.
    Frédéric THOMAS
    @doublefx
    So we know that it cannot be watched but can it be read once at the start ? I would guess yes
    yet the connector does not show anything
    Stephane Bouchet
    @sbouchet
    code says :
    public static Config loadKubeConfig() throws IOException {
            File f = new File(getKubeConfigPath());
            if (f.exists()) {
                return KubeConfigUtils.parseConfig(f);
            } else {
                return new ConfigBuilder().build();
            }
        }
    Frédéric THOMAS
    @doublefx
    I might be wrong but it looks like it does not see the existing kube config and build a fresh empty one that is using, what do you think?
    Stephane Bouchet
    @sbouchet
    here is a simple java class to test it :
    import java.io.File;
    
    public class NetworkTestDrive {
        public static void main(String[] args) {
            System.out.println(new File(getKubeConfigPath()).exists());
        }
    public static String getKubeConfigPath() {
            return System.getProperty("user.home") + "/.kube/config";
        }
    }
    Frédéric THOMAS
    @doublefx

    I will, just in between, I can confirm that the connector tries to login because if I pass a wrong password, I get :

    Error: Process exited with an error: 1 (Exit value: 1) Connecting to the OpenShift cluster

    Login failed (401 Unauthorized)
    Verify you have provided correct credentials.
    X challenger chose not to retry the request

    returns false
    Boom !!
    Stephane Bouchet
    @sbouchet
    :+1:
    so it explains why the commaandline works, but not the UI.
    Frédéric THOMAS
    @doublefx
    Ok, not sure we can do many things at this point :P
    Merci pour ton aide en tout cas, je te tiens au courant si je resout ca, merci encore
    Stephane Bouchet
    @sbouchet
    de rien !
    can you create an issue on github describing that if the home is on a mapped network drive, odo login cannot be performed ?
    Frédéric THOMAS
    @doublefx
    Yes, I will tomorrow morning when I'm back, I'm off now
    Frédéric THOMAS
    @doublefx

    @sbouchet I found an initial workaround, I created a windows link into my %USERPROFILE% (c:\Users\<ME>) pointing to %HOMESHARE%%HOMEPATH%.kube (H:.kube) and created a new %USER_HOME% with %USERPROFILE% as value and got something.

    I'm not sure how should look like the initial connector view but I got that now:

    image.png
    Frédéric THOMAS
    @doublefx

    It does not fix yet the watched part though.

    I would suggest to give the user, the option to set the .kube's lookup path

    Also can you share a typical view of the connector when everything is OK ?
    Stephane Bouchet
    @sbouchet
    hi,
    i've worked on a very small improvement that may fix your workaround.
    can you please test this piece of code ?
    import java.io.File;
    
    public class NetworkTestDrive {
        public static void main(String[] args) {
            System.out.println(Files.exists(new File(getKubeConfigPath()).toPath()));
        }
    public static String getKubeConfigPath() {
            return System.getProperty("user.home") + "/.kube/config";
        }
    }
    and looking to the openShift tree, there is another excpetion that needs investigation...
    i'll make a screenshot
    Stephane Bouchet
    @sbouchet
    Capture d’écran de 2020-01-07 17-26-57.png
    @doublefx
    Stephane Bouchet
    @sbouchet
    we need to add more log in the code to analyze why the openshift tree is not updated...
    Stephane Bouchet
    @sbouchet
    Frédéric THOMAS
    @doublefx
    Hi @sbouchet I ran the NetworkTestDrive test before and after my temporary local fix and it now passes as you could guess from my comments and suggestion.
    After faking an HOME, The openshift view list the cluster but not the projects NOT before
    And thanks :-0 for the ticket, I would have opened it later on, I was very busy today
    Stephane Bouchet
    @sbouchet
    @doublefx we will release a new version soon, with a new feature and more logs to help us to fix your issue. stay tuned !
    Frédéric THOMAS
    @doublefx
    I will @sbouchet :-)
    Frédéric THOMAS
    @doublefx
    Is it planned to allow the user to specify the .kube's lookup path ?
    Stephane Bouchet
    @sbouchet
    @doublefx : no, but we implemented a fix that should support network home folder .
    Frédéric THOMAS
    @doublefx

    yeah, I've seen the code, I was only thinking that relying on the USER_HOME env var for windows users would force the user to create one when it does not exist and might not be the location of the .kube when weirdly set by some companies' IT team.
    that's the reason why i was suggesting to add a connector configuration setting in the IDE for the .kube lookup path although the env var might be good enough for the time being.

    Another point that is a blocker is the odo ability to use proxies, I've seen an open issue on that on the connector an on odo itself, do you know if anyone has already started looking at it ? If not I might have a look.

    Stephane Bouchet
    @sbouchet
    @doublefx : Hi, we implemented a fix that should support a majority of the cases, and don't want to use extra configuration because of weird companies ITs ;) we think our implementation will work on your case, to read properly the kube config file.
    thanks for reporting the issue with proxy usage, we will have a look and possibly integrate it in our next release.
    Reid Karabush
    @olapman_twitter
    Last year, MS started supporting the ability to interactively debug code directly within a Docker Container if you were using a full linux distribution image (i.e. not alpine). If I start using the openshift-connnector, will I be able to leverage interactive debugging of a running container if the container is based on using a redhat-based version of Linux?
    Jeff MAURY
    @jeffmaury
    @olapman_twitter yes a new release of the extension has just been pushed that adds support for debug for Java and NodeJS components
    Frédéric THOMAS
    @doublefx

    Hi @jeffmaury

    I pulled the last changed you made and couldn't build anymore.
    I had to update few things in order to build on the last IntelliJ EAP

    see: https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/?_ga=2.136711544.918571319.1579967012-711348479.1578757328

    In build.gradle I had to change to: plugins 'java', 'terminal', 'JavaScriptDebugger', 'JavaScriptLanguage', 'CSS'
    In plugin.xml: <depends>com.intellij.modules.java</depends>
    In gradle.properties: ideaVersion = IU-2019.2

    Also, on some projects, I got an NPE and fixed it in ApplicationTreeModel:

    public static VirtualFile getModuleRoot(Module module) {
            return LocalFileSystem.getInstance().findFileByPath(new File(module.getModuleFilePath()).getParent());
            final Optional<Module> optionalModule = Optional.ofNullable(module);
    
            VirtualFile parentFile = null;
            File file;
    
            if (optionalModule.isPresent()) {
                file = new File(module.getModuleFilePath());
                parentFile = LocalFileSystem.getInstance().findFileByPath(file.getParent());
            }
    
            return parentFile;
        }
    
        protected void loadProjectModel(Project project) {
            for(Module module : project.getComponent(ModuleManager.class).getModules()) {
                addContext(getModuleRoot(module));
                final Optional<VirtualFile> optionalVirtualFile = Optional.ofNullable(getModuleRoot(module));
                optionalVirtualFile.ifPresent(this::addContext);
            }
        }
    Jeff MAURY
    @jeffmaury
    Yes the build.gradle is designed for older version of IJ. We need to updated it to adapt to the choosen IJ version.
    Frédéric THOMAS
    @doublefx
    Regarding the odo download issue, my code is ready to merge.
    Also given I will have exactly the same issue for each odo actions, I was thinking to pass the http_proxy, https_proxy and no_proxy based on the IDEA settings to the executor.execute(command) but it is a big refactoring, what do you think?
    Jeff MAURY
    @jeffmaury
    Yes I wanted your PR to be augmented with that to get full support for proxy.