On 28.11.2016 15:14, Tim Ward wrote:
Thanks - replies inline:
On 28/11/2016 13:50, Christian Schneider wrote:
You already found the confiFile option for features. This is the most
widely used option.
So what is the "URL" in the <configFile> element, and how do my config
files get there from git?
The URL typically is a maven url. See
https://github.com/apache/karaf-decanter/blob/master/assembly/src/main/feature/feature.xml#L241
The default configs are deployed there using build-helper-maven-plugin:
https://github.com/apache/karaf-decanter/blob/master/appender/kafka/pom.xml#L50-L69
The alternative is the config option which simply adds the config in
config admin but not in etc.
Both variants do not cover the upgrade case. A simply way is to just
remove the old config to make sure the new default one is written.
There is no built in mechanism to preserve user changes in karaf.
"just remove the old config" suggests either a manual process (which I
can't see going down well with Ops) or some non-trivial upgrade
scripting (which I fear we're going to need anyway). And "just remove
the old config" doesn't meet the case, as it'll result in a system
that was working no longer working.
What do people do in practice? - every non-trivial system with a
lifetime of more than one version must have come across this upgrade
issue. Write an upgrade script which detects (how?) that an incoming
feature has an update for a config file, quarantines one version of
the file somewhere, and tells the user in big red letters that they've
got some manual merging to do? Do such scripts, or frameworks for
writing them, exist, to save wheel-reinventing, as this must be a
common question?
I know two different approaches:
1. Manual upgrades
2. Immutable server pattern: Install scripts that deploy code and the
actual configuration. In these cases the config is typically not changed
by the admin.
As such scripts depend a lot on the customer there is no out of the box
solution.
Christian
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com