Prevents issue where it is possible to start workspace while
pod is terminating. When this occurs, Che creates a new pod but
workspace start fails. This pod must be removed manually before
that workspace can be launched again.
This is done by a) waiting for pod to terminate before returning
from removeContainer, and b) removing created deployment and
service when an exception occurs during createContainer.
Additionally, increases maximum wait time for retreiving
OpenShift image stream metadata
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Adds commit() and removeImage() implementations to
OpenShiftConnector. This requires some refactoring of existing
methods (mostly refactoring repeated processes into their own
methods -- e.g. creating an ImageStreamTag and getting image
info from a tag).
Additionally, refactors inspectContainer() method to remove
a call to DockerConnector, instead obtaining the same information
from what's available through the OpenShift API. This fixes an
issue where the IP address of a workspace was unavailable from
the ContainerInfo returned by DockerConnector.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Implement OpenShiftConnector pull, tag, and inspectImage through
ImageStreams. Makes changes to how containers are created.
Currently snapshots do not work, as commit and push methods are not
implemented. Additionally, pulling a stack from a private repository
is not supported.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Adds class so that choice between DockerConnector and OpenShiftConnector
can be made via setting a property in che.properties. The provider is
injected instead of DockerConnector, and provides the appropriate
implementation through a get() method.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>