Search in sources :

Example 1 with EnricherContext

use of org.eclipse.jkube.kit.enricher.api.EnricherContext in project jkube by eclipse.

the class AbstractHealthCheckEnricherTest method createEnricher.

protected AbstractHealthCheckEnricher createEnricher(Properties properties, Map<String, String> pi) {
    JavaProject project = JavaProject.builder().properties(new Properties()).build();
    project.getProperties().putAll(properties);
    final JKubeEnricherContext.JKubeEnricherContextBuilder enricherContextBuilder = JKubeEnricherContext.builder().project(project).log(log);
    if (pi != null && !pi.isEmpty()) {
        enricherContextBuilder.processingInstructions(pi);
    }
    EnricherContext context = enricherContextBuilder.build();
    AbstractHealthCheckEnricher enricher = new AbstractHealthCheckEnricher(context, "basic") {

        @Override
        protected Probe getLivenessProbe() {
            return getReadinessProbe();
        }

        @Override
        protected Probe getReadinessProbe() {
            return new ProbeBuilder().withNewHttpGet().withHost("localhost").withNewPort(8080).endHttpGet().build();
        }
    };
    return enricher;
}
Also used : JavaProject(org.eclipse.jkube.kit.common.JavaProject) ProbeBuilder(io.fabric8.kubernetes.api.model.ProbeBuilder) JKubeEnricherContext(org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext) Properties(java.util.Properties) JKubeEnricherContext(org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext) EnricherContext(org.eclipse.jkube.kit.enricher.api.EnricherContext)

Example 2 with EnricherContext

use of org.eclipse.jkube.kit.enricher.api.EnricherContext in project jkube by eclipse.

the class PodAnnotationEnricherTest method setUp.

@Before
public void setUp() {
    Properties properties = new Properties();
    klb = new KubernetesListBuilder();
    EnricherContext context = JKubeEnricherContext.builder().project(JavaProject.builder().properties(properties).build()).build();
    podAnnotationEnricher = new PodAnnotationEnricher(context);
}
Also used : KubernetesListBuilder(io.fabric8.kubernetes.api.model.KubernetesListBuilder) Properties(java.util.Properties) JKubeEnricherContext(org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext) EnricherContext(org.eclipse.jkube.kit.enricher.api.EnricherContext) Before(org.junit.Before)

Aggregations

Properties (java.util.Properties)2 EnricherContext (org.eclipse.jkube.kit.enricher.api.EnricherContext)2 JKubeEnricherContext (org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext)2 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)1 ProbeBuilder (io.fabric8.kubernetes.api.model.ProbeBuilder)1 JavaProject (org.eclipse.jkube.kit.common.JavaProject)1 Before (org.junit.Before)1