Hi,

That's because it's a factory, not a config.

You have to use config:edit --factory.

Regards
JB

On 11/11/2019 22:57, Steinar Bang wrote:
>>>>>> Steinar Bang <s...@dod.no>:
>>>>>> Jean-Baptiste Onofré <j...@nanthrax.net>:
> 
>>> If you do:
> 
>>> karaf@root()> config:edit my.config
>>> karaf@root()> config:property-set foo bar
>>> karaf@root()> config:update
> 
>>> only foo will be changed, other properties are kept.
> 
>>> Not sure I follow what you mean.
> 
>> Hm... I thought that when I tried this last week the resulting file
>> only had those properties I had added with config:property-set,
>> ie. that the other properties had gone missing...?
> 
>> Maybe I fooled myself while testing?  I will try again and keep track
>> of what I'm doing...:-)
> 
> Nope, I tried it again now, and it didn't work for me.
> 
> Platform: karaf 4.2.7, openjdk 11, debian 10.1 "buster", amd64
> 
> Here's what I did:
>  1. I installed my application using
>      karaf@root()> feature:repo-add 
> mvn:no.priv.bang.authservice/authservice/LATEST/xml/features
>      Adding feature url 
> mvn:no.priv.bang.authservice/authservice/LATEST/xml/features
>      karaf@root()> feature:install user-admin-with-postgresql
>      karaf@root()>
>  2. This created the following file in etc/ 
>      -rw-r--r--  1 sb sb   250 Nov 11 22:45 
> org.ops4j.datasource-authservice-production.cfg
>  3. The content of the org.ops4j.datasource-authservice-production.cfg file 
> is:
>      osgi.jdbc.driver.name=PostgreSQL JDBC Driver
>      dataSourceName=jdbc/authservice
>      url=jdbc:postgresql:///authservice
>      user=karaf
>      password=karaf
>      ops4j.preHook=authservicedb
>      org.apache.karaf.features.configKey = 
> org.ops4j.datasource-authservice-production
>  4. Then I tried replacing just the url property:
>      karaf@root()> config:edit org.ops4j.datasource-authservice-production
>      karaf@root()> config:property-set url "jdbc:postgresql:///ukelonn"
>      karaf@root()> config:update
>      karaf@root()>
>  5. The resulting file in the etc directory was much smaller
>      -rw-r--r--  1 sb sb    33 Nov 11 22:50 
> org.ops4j.datasource-authservice-production.cfg
>  6. The updated file content is just the url setting
>      url = jdbc:postgresql:///ukelonn
> 
> Did I do something wrong?  Or should I report this as a bug in karaf JIRA?
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to