Support additional metadata for services continued.
This commit is contained in:
parent
ff6b4eea8c
commit
6ec91e7a7e
2 changed files with 7 additions and 5 deletions
|
|
@ -15,10 +15,10 @@
|
|||
ramOvercommit: 1.5
|
||||
|
||||
# Additional metadata (labels and annotations) to be merged
|
||||
# into the service
|
||||
# additionalServiceMetdata:
|
||||
# into the service. Must be provided as nested YAML
|
||||
# additionalServiceMetadata: |
|
||||
# labels: {}
|
||||
# annotations: {}
|
||||
# annotations: {}
|
||||
|
||||
# Only for development:
|
||||
# namespace: vmop-dev
|
||||
|
|
|
|||
|
|
@ -97,8 +97,10 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|||
@SuppressWarnings("unchecked")
|
||||
var asmData = Optional.of(model)
|
||||
.map(m -> (Map<String, Object>) m.get("config"))
|
||||
.map(c -> (Map<String, Object>) c.get("additionalServiceMetadata"))
|
||||
.orElseGet(() -> new HashMap<>());
|
||||
.map(c -> (String) c.get("additionalServiceMetadata"))
|
||||
.map(y -> (Map<String, Object>) new Yaml(
|
||||
new SafeConstructor(new LoaderOptions())).load(y))
|
||||
.orElseGet(() -> new HashMap<String, Object>());
|
||||
var json = channel.client().getJSON();
|
||||
JsonObject cfgMeta
|
||||
= json.deserialize(json.serialize(asmData), JsonObject.class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue