aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hv-collector-main/Dockerfile1
-rwxr-xr-xhv-collector-main/src/main/scripts/healthcheck.sh4
-rw-r--r--hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/VesHvClient.kt13
3 files changed, 12 insertions, 6 deletions
diff --git a/hv-collector-main/Dockerfile b/hv-collector-main/Dockerfile
index 8049abca..0170b645 100644
--- a/hv-collector-main/Dockerfile
+++ b/hv-collector-main/Dockerfile
@@ -15,4 +15,5 @@ ENTRYPOINT ["java", "-cp", "*:", "org.onap.dcae.collectors.veshv.main.MainKt"]
COPY target/libs/external/* ./
COPY target/libs/internal/* ./
+COPY src/main/scripts/healthcheck.sh ./
COPY target/hv-collector-main-*.jar ./
diff --git a/hv-collector-main/src/main/scripts/healthcheck.sh b/hv-collector-main/src/main/scripts/healthcheck.sh
new file mode 100755
index 00000000..db62eece
--- /dev/null
+++ b/hv-collector-main/src/main/scripts/healthcheck.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+curl -f http://localhost:${VESHV_HEALTH_CHECK_API_PORT:-6060}/health/ready || exit 1
+nc -vz localhost ${VESHV_LISTEN_PORT:-6061} || exit 2
diff --git a/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/VesHvClient.kt b/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/VesHvClient.kt
index 8df416c9..57aaf3db 100644
--- a/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/VesHvClient.kt
+++ b/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/VesHvClient.kt
@@ -20,10 +20,8 @@
package org.onap.dcae.collectors.veshv.simulators.xnf.impl.adapters
import arrow.core.Option
-import io.netty.handler.ssl.ClientAuth
+import arrow.core.getOrElse
import io.netty.handler.ssl.SslContext
-import io.netty.handler.ssl.SslContextBuilder
-import io.netty.handler.ssl.SslProvider
import org.onap.dcae.collectors.veshv.domain.WireFrameMessage
import org.onap.dcae.collectors.veshv.domain.SecurityConfiguration
import org.onap.dcae.collectors.veshv.domain.WireFrameEncoder
@@ -47,9 +45,12 @@ class VesHvClient(private val configuration: SimulatorConfiguration) {
private val client: TcpClient = TcpClient.create()
.host(configuration.vesHost)
.port(configuration.vesPort)
- .secure { sslSpec ->
- createSslContext(configuration.security).fold({}, sslSpec::sslContext)
- }
+ .configureSsl()
+
+ private fun TcpClient.configureSsl() =
+ createSslContext(configuration.security)
+ .map { sslContext -> this.secure(sslContext) }
+ .getOrElse { this }
fun sendIo(messages: Flux<WireFrameMessage>) =
sendRx(messages).then(Mono.just(Unit)).asIo()