Skip to content

Commit

Permalink
fix: fix name in pom + fix nullpointer in k8serve
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed May 13, 2024
1 parent 7fe8e58 commit f42b439
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</parent>
<groupId>it.smartcommunitylabdhub</groupId>
<artifactId>core</artifactId>
<name>core</name>
<name>dhcore</name>
<version>${revision}</version>
<description>Digital Hub Core</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,18 @@ public V1Service build(K8sServeRunnable runnable) throws K8sFrameworkException {
}

//build ports
List<V1ServicePort> ports = runnable
.getServicePorts()
.stream()
.filter(p -> p.port() != null && p.targetPort() != null)
.map(p -> new V1ServicePort().port(p.port()).targetPort(new IntOrString(p.targetPort())).protocol("TCP"))
.collect(Collectors.toList());
List<V1ServicePort> ports = Optional
.ofNullable(runnable.getServicePorts())
.map(list ->
list
.stream()
.filter(p -> p.port() != null && p.targetPort() != null)
.map(p ->
new V1ServicePort().port(p.port()).targetPort(new IntOrString(p.targetPort())).protocol("TCP")
)
.collect(Collectors.toList())
)
.orElse(null);

// service type (ClusterIP or NodePort)
String type = Optional.of(runnable.getServiceType().name()).orElse("NodePort");
Expand Down

0 comments on commit f42b439

Please sign in to comment.