Add invoke.Delegate{Add,Del} for use by meta-plugins
authorMichael Bridgen <mikeb@squaremobius.net>
Wed, 2 Mar 2016 17:02:52 +0000 (17:02 +0000)
committerMichael Bridgen <mikeb@squaremobius.net>
Fri, 4 Mar 2016 11:01:22 +0000 (11:01 +0000)
commit719a1db54be36cde9e967d6fc1abc0d34e6d75e5
tree5adff2d3c08327ed8e83048e8bf4ed8cd32b652f
parent36c6bcd106091f0322d2bc9431e948dfa057b039
Add invoke.Delegate{Add,Del} for use by meta-plugins

The 'flannel' meta plugin delegates to other plugins to do the actual
OS-level work. It used the ipam.Exec{Add,Del} procedures for this
delegation, since those do precisely what's needed.

However this is a bit misleading, since the flannel plugin _isn't_
doing this for IPAM, and the ipam.Exec* procedures aren't doing
something specific to IPAM plugins.

So: anticipating that there may be more meta plugins that want to
delegate in the same way, this commit moves generic delegation
procedures to `pkg/invoke`, and makes the `pkg/ipam` procedures (still
used, accurately, in the non-meta plugins) shims.
pkg/invoke/delegate.go [new file with mode: 0644]
pkg/ipam/ipam.go
plugins/meta/flannel/flannel.go