[
https://issues.apache.org/jira/browse/SLING-10771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721045#comment-17721045
]
Konrad Windszus edited comment on SLING-10771 at 5/12/23 7:07 AM:
------------------------------------------------------------------
bq. Does this imply that Felix internally never persists configuration values
which are equal to the metatype default?
I had a closer look at the source in
https://github.com/apache/felix-dev/blob/fd722d1c1914e4758f34604fd19d84fcac697af7/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java#L273
and I think this indeed prevents configuration properties to be set from the
ConfigAdmin Web Console which are equal to the metatype default.
I would argue that this is wrong, because as you correctly said ConfigAdmin and
Metatype are separate specs. The Metatype default is usually not evaluated when
leveraging configuration properties from ConfigAdmin, therefore even properties
having a value = metatype default value should IMHO be set in the ConfigAdmin
from the Web Console UI.
This is particularly crucial for DS components which use merged configurations
from ConfigAdmin + Component Descriptions. For edge cases the same
configuration property key can have a different default value in metatype than
in the component description. When adjusting its config now in the Felix Web
Console Plugin the default metatype value will never be written and therefore
never overwrite the component property default value (although they are
different).
Also it feels weird to have this functionality in the OSGi installer
configuration factory bundle as it is not really related to the OSGi installer.
was (Author: kwin):
bq. Does this imply that Felix internally never persists configuration values
which are equal to the metatype default?
I had a closer look at the source in
https://github.com/apache/felix-dev/blob/fd722d1c1914e4758f34604fd19d84fcac697af7/webconsole/src/main/java/org/apache/felix/webconsole/internal/configuration/ConfigAdminSupport.java#L273
and I think this indeed prevents configuration properties to be set from the
ConfigAdmin Web Console which are equal to the metatype default.
I would argue that this is wrong, because as you correctly said ConfigAdmin and
Metatype are separate specs. The Metatype default is usually not evaluated when
leveraging configuration properties from ConfigAdmin, therefore even properties
having a value = metatype default value should IMHO be set in the ConfigAdmin
from the Web Console UI.
This is particularly crucial for DS components which use merged configurations
from ConfigAdmin + Component Descriptions. For edge cases the same
configuration property key can have a different default value in metatype than
in the component description. When adjusting its config now in the Felix Web
Console Plugin the default metatype value will never be written and therefore
never overwrite the component property default value (although they are
different).
> Support handling of metatype info when merging configurations
> -------------------------------------------------------------
>
> Key: SLING-10771
> URL: https://issues.apache.org/jira/browse/SLING-10771
> Project: Sling
> Issue Type: New Feature
> Components: Installer
> Reporter: Carsten Ziegeler
> Assignee: Carsten Ziegeler
> Priority: Major
> Fix For: Installer Configuration Factory 1.4.2
>
>
> With SLING-10538 we have a mechanism to handle default values and merging for
> configurations, for example to separate between platform and application
> configurations.
> In addition we should also handle default values from metatype and not store
> properties in a configuration which has default values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)