Search in sources :

Example 1 with DeploymentConfigOpenShiftConverter

use of io.fabric8.maven.plugin.converter.DeploymentConfigOpenShiftConverter in project fabric8-maven-plugin by fabric8io.

the class ResourceMojo method lateInit.

private void lateInit() throws MojoExecutionException {
    if (goalFinder.runningWithGoal(project, session, "fabric8:watch") || goalFinder.runningWithGoal(project, session, "fabric8:watch")) {
        Properties properties = project.getProperties();
        properties.setProperty("fabric8.watch", "true");
    }
    platformMode = clusterAccess.resolvePlatformMode(mode, log);
    log.info("Running in [[B]]%s[[B]] mode", platformMode.getLabel());
    if (isOpenShiftMode()) {
        Properties properties = project.getProperties();
        if (!properties.contains(DOCKER_IMAGE_USER)) {
            String namespace = clusterAccess.getNamespace();
            log.info("Using docker image name of namespace: " + namespace);
            properties.setProperty(DOCKER_IMAGE_USER, namespace);
        }
        if (!properties.contains(PlatformMode.FABRIC8_EFFECTIVE_PLATFORM_MODE)) {
            properties.setProperty(PlatformMode.FABRIC8_EFFECTIVE_PLATFORM_MODE, platformMode.toString());
        }
    }
    openShiftConverters = new HashMap<>();
    openShiftConverters.put("ReplicaSet", new ReplicSetOpenShiftConverter());
    openShiftConverters.put("Deployment", new DeploymentOpenShiftConverter(platformMode, getOpenshiftDeployTimeoutSeconds()));
    // TODO : This converter shouldn't be here. See its javadoc.
    openShiftConverters.put("DeploymentConfig", new DeploymentConfigOpenShiftConverter(getOpenshiftDeployTimeoutSeconds()));
    openShiftConverters.put("Namespace", new NamespaceOpenShiftConverter());
    handlerHub = new HandlerHub(project);
}
Also used : NamespaceOpenShiftConverter(io.fabric8.maven.plugin.converter.NamespaceOpenShiftConverter) DeploymentConfigOpenShiftConverter(io.fabric8.maven.plugin.converter.DeploymentConfigOpenShiftConverter) DeploymentOpenShiftConverter(io.fabric8.maven.plugin.converter.DeploymentOpenShiftConverter) Properties(java.util.Properties) ReplicSetOpenShiftConverter(io.fabric8.maven.plugin.converter.ReplicSetOpenShiftConverter) HandlerHub(io.fabric8.maven.core.handler.HandlerHub)

Aggregations

HandlerHub (io.fabric8.maven.core.handler.HandlerHub)1 DeploymentConfigOpenShiftConverter (io.fabric8.maven.plugin.converter.DeploymentConfigOpenShiftConverter)1 DeploymentOpenShiftConverter (io.fabric8.maven.plugin.converter.DeploymentOpenShiftConverter)1 NamespaceOpenShiftConverter (io.fabric8.maven.plugin.converter.NamespaceOpenShiftConverter)1 ReplicSetOpenShiftConverter (io.fabric8.maven.plugin.converter.ReplicSetOpenShiftConverter)1 Properties (java.util.Properties)1