use of org.eclipse.jkube.kit.build.api.model.PortMapping in project jkube by eclipse.
the class ContainerHandler method getContainerPorts.
private List<ContainerPort> getContainerPorts(ImageConfiguration imageConfig) {
BuildConfiguration buildConfig = imageConfig.getBuildConfiguration();
List<String> ports = buildConfig.getPorts();
if (!ports.isEmpty()) {
List<ContainerPort> ret = new ArrayList<>();
PortMapping portMapping = new PortMapping(ports, configurationProperties);
JsonArray portSpecs = portMapping.toJson();
for (int i = 0; i < portSpecs.size(); i++) {
JsonObject portSpec = portSpecs.get(i).getAsJsonObject();
ret.add(extractContainerPort(portSpec));
}
return ret;
} else {
return null;
}
}
Aggregations