diff options
author | 2019-03-21 09:10:11 +0100 | |
---|---|---|
committer | 2019-03-21 09:13:51 +0100 | |
commit | d418dd43e7812ea2cdebf188bf5ab51a997df90c (patch) | |
tree | 60c33ac48330cca76bf8379ec5ed6fa48eac3e22 /sources/hv-collector-configuration/src/main/kotlin/org/onap | |
parent | 30afcb56b0c6c4529fdaf68d7b061eee44d68d16 (diff) |
Include basic configuration in Docker image
Makes the collector start out of the box, even without valid CBS
configuration.
Note: the basic configuration will need to be changed later.
Issue-ID: DCAEGEN2-1340
Change-Id: I3c2b502f253677e78a4f4990002e683613b8869e
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'sources/hv-collector-configuration/src/main/kotlin/org/onap')
2 files changed, 7 insertions, 3 deletions
diff --git a/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/api/ConfigurationModule.kt b/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/api/ConfigurationModule.kt index 5b547a28..9f8c552b 100644 --- a/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/api/ConfigurationModule.kt +++ b/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/api/ConfigurationModule.kt @@ -37,7 +37,7 @@ class ConfigurationModule { fun hvVesConfigurationUpdates(args: Array<String>): Flux<HvVesConfiguration> = Flux.just(cmd.parse(args)) .throwOnLeft { MissingArgumentException(it.message, it.cause) } - .map { configReader.loadConfig(it.reader()) } + .map { it.reader().use(configReader::loadConfig) } .map { configValidator.validate(it) } .throwOnLeft { ValidationException(it.message) } } diff --git a/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidator.kt b/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidator.kt index 6c74c33f..83f56924 100644 --- a/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidator.kt +++ b/sources/hv-collector-configuration/src/main/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidator.kt @@ -53,7 +53,7 @@ internal class ConfigurationValidator { .let { createCbsConfiguration(it).bind() } val securityConfiguration = partialConfig.security.bind() - .let { createSecurityConfiguration(it).bind() } + .let { createSecurityConfiguration(it) } val collectorConfiguration = partialConfig.collector.bind() .let { createCollectorConfig(it).bind() } @@ -94,7 +94,11 @@ internal class ConfigurationValidator { } private fun createSecurityConfiguration(partial: PartialSecurityConfig) = - partial.keys.map { SecurityConfiguration(Some(it)) } + partial.keys + .fold( + { SecurityConfiguration(None) }, + { SecurityConfiguration(Some(it)) } + ) private fun createCollectorConfig(partial: PartialCollectorConfig) = partial.mapBinding { |