Skip to content

Commit

Permalink
fix(shulker-proxy-agent): ingress IP can be null (#749)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylvln authored Jan 26, 2025
1 parent 2733be5 commit fdd9bc5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ class ImplKubernetesGatewayAdapter(proxyNamespace: String, proxyName: String) :
private fun getExternalAddressFromService(service: Service): Optional<InetSocketAddress> {
return if (service.spec.type == "LoadBalancer") {
Optional.ofNullable(service.status.loadBalancer?.ingress?.firstOrNull())
.map { ingress -> addressFromHostString(ingress.ip) }
.flatMap { ingress -> Optional.of(ingress.ip) }
.map { ip -> addressFromHostString(ip) }
} else {
Optional.empty()
}
Expand Down

0 comments on commit fdd9bc5

Please sign in to comment.