kyetter / ansible-devspace-demo

17 stars 41 forks source link

Molecule fails first run due to OC not being in path until after prepare #11

Closed jeffcpullen closed 1 year ago

jeffcpullen commented 1 year ago

The base image doesn't contain the 'oc' binary. It is added as part of the demo.oc_connection molecule prepare stage, but that is the wrong place to fix it. Prepare is run and sets things up, but it doesn't reload the PATH env in a way that it works in that same run.

It would be preferred that the oc binary is grabbed from the local cluster rather than packaging it in the image for several reasons.

  1. Avoids bloating the image
  2. Ensures the client and server versions of OpenShift match
  3. Leverages a service of OCP that is consistent across every deployment

Rather than having the the prepare stage of molecule setup the system, it would be better if it could be handled as part of an initialization script. If there is a way to add scripts to the dev space configuration file to run-once, the jobs in the prepare stage could be moved to a simple playbook / script.