Posts

Showing posts with the label visual studio code

Using Visual Studio Code to Edit Files in Openshift Pods

Image
Tracing PHP applications are typically done by putting echo statements in code path in a debug session. When PHP applications are deployed into openshift environment, the developer could edit the source code in development app (not production) to add echo statements. Typically this is done using the terminal. However the development experience is not very good. Background When debugging or tracing, we developers sometimes need to check multiple files at once, and sometimes need to do a project-wide search to find the source file containing one class or method. Most developers find this is not easy to do  in the terminal interface. They normally use editors such as Visual Studio Code to be able to search quickly and jump between source code files, and using vi in the terminal is somewhat off-putting. A better solution is to run Visual Studio Code remotely in the pod's container. How to Launch Visual Studio Code in Pods There are a few prerequisite needed to be able to launch vi...

Debugging Openshift Docker Registry using Visual Studio Code

Image
Overview Red Hat  has augmented docker's registry with some enhancement before deploying it in Openshift cluster. In some cases we might want to debug it, to find out reasons why some stuff doesn't work or for educational purposes. In this post we will describe steps required to do debugging for the docker registry (a.k.a docker distribution) from Visual Studio Code. We are going to run the openshift docker registry in a separate deployment config. Repository identification First, docker registry is created using Go Language; and in this case, the source code for the enhanced docker registry lives in github repository  https://github.com/openshift/origin for some versions and in  https://github.com/openshift/docker-distribution for later versions. In this post I will use the version in openshift 3.6 ( https://github.com/openshift/origin/tree/v3.6.1 ) because of selfish reasons our sandbox/development openshift cluster uses this version. The main source code file lives...