Search in sources :

Example 1 with ImageNameFormatter

use of org.eclipse.jkube.kit.build.service.docker.helper.ImageNameFormatter in project jkube by eclipse.

the class DockerImageWatcher method buildImage.

protected void buildImage(ImageConfiguration imageConfig) {
    String imageName = imageConfig.getName();
    // lets regenerate the label
    try {
        String imagePrefix = getImagePrefix(imageName);
        imageName = imagePrefix + "%t";
        ImageNameFormatter formatter = new ImageNameFormatter(getContext().getBuildContext().getProject(), new Date());
        imageName = formatter.format(imageName);
        imageConfig.setName(imageName);
        log.info("New image name: " + imageConfig.getName());
    } catch (Exception e) {
        log.error("Caught: " + e, e);
    }
}
Also used : ImageNameFormatter(org.eclipse.jkube.kit.build.service.docker.helper.ImageNameFormatter) Date(java.util.Date) KubernetesClientException(io.fabric8.kubernetes.client.KubernetesClientException) IOException(java.io.IOException) WatchException(org.eclipse.jkube.kit.build.service.docker.watch.WatchException)

Aggregations

KubernetesClientException (io.fabric8.kubernetes.client.KubernetesClientException)1 IOException (java.io.IOException)1 Date (java.util.Date)1 ImageNameFormatter (org.eclipse.jkube.kit.build.service.docker.helper.ImageNameFormatter)1 WatchException (org.eclipse.jkube.kit.build.service.docker.watch.WatchException)1