Improve certs folder checking and container image load #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Doing tests we saw that if the base certs folder was deleted (by default /etc/ansible-runner-service/certs), there was an error generating the certificates because the target folders were not created.
I have move and improve the check for the certificates target folders. Now certificates are always generated even if no "etc" folder exists.
It was very uncomfortable to deal with two variables to set the full path of the container image. In fact, for our tests , it was impossible to set it properly using the PROJECT and the CONTAINER_IMAGE vars.
because the full path is something like:
brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/ansible-runner-service:ceph-4.0-rhel-8-containers-candidate-23773-20190712110332
I have change this to use only one variable to support this full path, it replaces the PROJECT var functionality.
Now in order to start we should use:
Another improvement is about to pull or not the image from an external registry.
Now we use the "CONTAINER_IMAGE_NAME" var to check if we have a local image with this name. if this is the case we use the "image id" to start the container.
TESTS:
Start without certs folders:
Start without cert folders and without local image: