Search in sources :

Example 11 with ClusterAccess

use of org.eclipse.jkube.kit.config.access.ClusterAccess in project jkube by eclipse.

the class JKubeServiceHub method initClusterAccessAndLazyBuilders.

private void initClusterAccessAndLazyBuilders() {
    if (!offline) {
        if (clusterAccess == null) {
            clusterAccess = new ClusterAccess(log, ClusterConfiguration.from(System.getProperties(), configuration.getProject().getProperties()).build());
        }
        this.client = clusterAccess.createDefaultClient();
    }
    buildServiceManager = new LazyBuilder<>(() -> new BuildServiceManager(this));
    applyService = new LazyBuilder<>(() -> {
        validateIfConnectedToCluster();
        return new ApplyService(client, log);
    });
    portForwardService = new LazyBuilder<>(() -> {
        validateIfConnectedToCluster();
        return new PortForwardService(client, log);
    });
    debugService = new LazyBuilder<>(() -> {
        validateIfConnectedToCluster();
        return new DebugService(log, client, portForwardService.get(), applyService.get());
    });
    undeployService = new LazyBuilder<>(() -> {
        validateIfConnectedToCluster();
        if (platformMode == RuntimeMode.OPENSHIFT && isOpenShift(client)) {
            return new OpenshiftUndeployService(this, log);
        }
        return new KubernetesUndeployService(this, log);
    });
    migrateService = new LazyBuilder<>(() -> new MigrateService(getConfiguration().getBasedir(), log));
    helmService = new LazyBuilder<>(() -> new HelmService(getConfiguration(), log));
}
Also used : HelmService(org.eclipse.jkube.kit.resource.helm.HelmService) KubernetesUndeployService(org.eclipse.jkube.kit.config.service.kubernetes.KubernetesUndeployService) OpenshiftUndeployService(org.eclipse.jkube.kit.config.service.openshift.OpenshiftUndeployService) ClusterAccess(org.eclipse.jkube.kit.config.access.ClusterAccess) MigrateService(org.eclipse.jkube.kit.common.service.MigrateService)

Aggregations

ClusterAccess (org.eclipse.jkube.kit.config.access.ClusterAccess)11 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)2 IOException (java.io.IOException)2 LogOutputSpecFactory (org.eclipse.jkube.kit.build.service.docker.access.log.LogOutputSpecFactory)2 Test (org.junit.Test)2 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)1 KubernetesClientException (io.fabric8.kubernetes.client.KubernetesClientException)1 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)1 PipedInputStream (java.io.PipedInputStream)1 PipedOutputStream (java.io.PipedOutputStream)1 AuthConfigFactory (org.eclipse.jkube.kit.build.service.docker.auth.AuthConfigFactory)1 ImageConfigResolver (org.eclipse.jkube.kit.build.service.docker.config.handler.ImageConfigResolver)1 WatchException (org.eclipse.jkube.kit.build.service.docker.watch.WatchException)1 JKubeConfiguration (org.eclipse.jkube.kit.common.JKubeConfiguration)1 KitLogger (org.eclipse.jkube.kit.common.KitLogger)1 MigrateService (org.eclipse.jkube.kit.common.service.MigrateService)1 AnsiLogger (org.eclipse.jkube.kit.common.util.AnsiLogger)1 ImageConfiguration (org.eclipse.jkube.kit.config.image.ImageConfiguration)1 KubernetesUndeployService (org.eclipse.jkube.kit.config.service.kubernetes.KubernetesUndeployService)1 OpenshiftUndeployService (org.eclipse.jkube.kit.config.service.openshift.OpenshiftUndeployService)1