I have some thoughts/questions about the upcoming configurator
specification in OSGi R7
<https://osgi.org/download/osgi.enterprise-7.0.0-early-draft-2017-10.pdf>.

The spec talks about the concept of a configuration ranking, by which the
configurator service selects the most appropriate configuration to apply.
But what if we already have a working configuration deployed and only wish
to override certain values? Can we do something like the following?

[existing-baseline-configuration.json]
{
    "my.pid": {
        ":configurator:ranking": "0",
        "key_one": "configured_value",
        "key_two": "configured_value",
        "key_three": "configured_value"
    }
}

[new-partial-configuration.json]
{
    "my.pid": {
        ":configurator:ranking": "1",
        "key_three": "overriding_value"
    }
}

Normally in this scenario I assume [new-partial-configuration.json] will be
selected as the one to apply and the other will be completely ignored. But
I would hope there is a way to tell the configurator we want to merge a
configuration with the next-highest-ranked configuration, such that the
configurator will ultimately resolve something like the following:

[effective configuration]
{
    "my.pid": {
        "key_one": "configured_value",
        "key_two": "configured_value",
        "key_three": "overriding_value"
    }
}

I realise this behaviour isn't *always* what we'd want, but perhaps we
could apply some PID-level configurator key to
[new-partial-configuration.json] to opt in, e.g.
"*:configurator:override-strategy":
"complete/partial/whatever"*

Since something like this doesn't appear to be mentioned in the latest
draft I assume it's not currently planned, but I'm hoping I've
misunderstood or misread some part of it because this seems like an easy
win to me. Perhaps there has been internal discussion of something like
this and it was dismissed for some reason? I realise it adds some
complexity to the implementation but I don't think it really adds any
confusion to the mental model for users.

Any further comment or discussion would be welcome,

Cheers,

Eli
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to