Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Plugins global config overwrites task-specific config #847

Closed
IRCody opened this issue Apr 8, 2016 · 0 comments
Closed

Plugins global config overwrites task-specific config #847

IRCody opened this issue Apr 8, 2016 · 0 comments

Comments

@IRCody
Copy link
Contributor

IRCody commented Apr 8, 2016

When starting snapd with this config:

{
    "control" :{
        "plugins" : {
            "collector" : {
                "all" : {
                        "password" :"bogus",
                        "test" : true,
                        "user" : "really bogus"
                }
            },
            "publisher" : {
                "all" : {
                    "file" : "/tmp/whatever"
                }
            }
        }
    }
}

With this task. To reproduce start snapd with the above config and load snap-collect-mock1, snap-processor-passthru, and snap-publisher-file.

I would expect the config values passed to my plugins from this task to be what is in the task manifest for the conflicting values (password, user, file). What actually appears to be happening is that the values from global config are getting passed through where they conflict. Worth mentioning here that there is no way for a user to see what the 'merged' value of the config is between global config and task-specific config is which is addressed in #846.

@IRCody IRCody added the type/bug label Apr 8, 2016
@IRCody IRCody changed the title Plugins Globalconfig overwrites task-specific config Plugins global config overwrites task-specific config Apr 8, 2016
@lynxbat lynxbat added the tracked label Apr 9, 2016
IRCody added a commit to IRCody/snap that referenced this issue Apr 13, 2016
When applying config's, task specific config should take precedence over
the more general global config.

A ReverseMerge function is added to ConfigDataNode in order to
facilitate this. ReverseMerge has the opposite overwriting behavior of
Merge, which is to overwrite any values which conflict. ReverseMerge
instead will not overwrite any conflicting values.
IRCody added a commit to IRCody/snap that referenced this issue Apr 13, 2016
When applying config's, task specific config should take precedence over
the more general global config.

A ReverseMerge function is added to ConfigDataNode in order to
facilitate this. ReverseMerge has the opposite overwriting behavior of
Merge, which is to overwrite any values which conflict. ReverseMerge
instead will not overwrite any conflicting values.
IRCody added a commit to IRCody/snap that referenced this issue Apr 14, 2016
When applying config's, task specific config should take precedence over
the more general global config.

A ReverseMerge function is added to ConfigDataNode in order to
facilitate this. ReverseMerge has the opposite overwriting behavior of
Merge, which is to overwrite any values which conflict. ReverseMerge
instead will not overwrite any conflicting values.
IRCody added a commit that referenced this issue Apr 16, 2016
Fixes #847 - task config should take precedence
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants