Uploaded image for project: 'Eclipse Che development'
  1. Eclipse Che development
  2. CHE-145

Auto infer CHE_DOCKER_IP_EXTERNAL when Che is running on OpenShift

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • docker
    • None
    • 10

      Currently we need to configure the external hostname of Che as a configmap (hostname-http). We could infer that using the OpenShift API instead. Something like the following snippet should work:

      if (isOpenShift()) {
          OpenShiftClient oClient = new DefaultOpenShiftClient();
          Route r = oClient.routes().withName("che").get();
          if (r!= null){
              r.getSpec().getHost();
          }
      } else {
          throw new Exception("Adapting to OpenShiftClient not support. Check if adapter is present, and that env provides /oapi root path.");
      }
      

              ibuziuk@redhat.com Ilya Buziuk
              mloriedo Mario Loriedo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: