use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class NameEnricherTest method setUp.
@Before
public void setUp() {
properties = new Properties();
ProcessorConfig processorConfig = new ProcessorConfig();
klb = new KubernetesListBuilder();
// @formatter:off
klb.addToItems(new ConfigMapBuilder().withNewMetadata().endMetadata().build(), new DeploymentBuilder().withNewMetadata().endMetadata().build(), new ReplicaSetBuilder().withNewMetadata().endMetadata().build(), new ReplicationControllerBuilder().withNewMetadata().endMetadata().build(), new NamespaceBuilder().build());
// @formatter:on
context = mock(JKubeEnricherContext.class, RETURNS_DEEP_STUBS);
when(context.getProperties()).thenReturn(properties);
when(context.getConfiguration().getProcessorConfig()).thenReturn(processorConfig);
when(context.getGav().getSanitizedArtifactId()).thenReturn("artifact-id");
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class DefaultControllerEnricherTest method setUp.
@Before
public void setUp() throws Exception {
config = new HashMap<>();
context = JKubeEnricherContext.builder().processorConfig(new ProcessorConfig(null, null, config)).log(new KitLogger.SilentLogger()).resources(ResourceConfig.builder().build()).image(ImageConfiguration.builder().name("helloworld").build(BuildConfiguration.builder().port("8080").build()).build()).project(JavaProject.builder().properties(new Properties()).groupId("group").artifactId("artifact-id").build()).build();
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class DefaultServiceEnricherTest method serviceImageLabelEnrichment.
@Test
public void serviceImageLabelEnrichment() throws Exception {
ImageConfiguration imageConfigurationWithLabels = ImageConfiguration.builder().name("test-label").alias("test").build();
final TreeMap<String, Object> config = new TreeMap<>();
config.put("type", "LoadBalancer");
new Expectations() {
{
Configuration configuration = Configuration.builder().image(imageConfigurationWithLabels).processorConfig(new ProcessorConfig(null, null, Collections.singletonMap("jkube-service", config))).build();
groupArtifactVersion.getSanitizedArtifactId();
result = "jkube-service";
context.getConfiguration();
result = configuration;
imageConfigurationWithLabels.getBuildConfiguration();
result = BuildConfiguration.builder().labels(Collections.singletonMap("jkube.generator.service.ports", "9090")).ports(Arrays.asList("80", "53/UDP")).build();
}
};
String json = enrich();
assertPort(json, 0, 9090, 9090, "http", "TCP");
}
Aggregations