
This introduces a notion of a "meta" plugin. A meta plugin is one that delegates the actual work of setting up the interface to the main plugin. The meta plugin is used to select and dynamically configure the main plugin. The sequence of events, is as follows: Given netconf like: { "name": "mynet", "type": "flannel", "delegate": { "type": "bridge" } } flannel fills in values like "mtu", "ipam.subnet" and delegates to "bridge" main plugin. "bridge" plugin will operate as usual, calling into ipam module for IP assignment. Delegate dictionary should not contain "name" field as it will be filled in by the flannel plugin.
28 lines
547 B
Bash
Executable File
28 lines
547 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
ORG_PATH="github.com/appc"
|
|
REPO_PATH="${ORG_PATH}/cni"
|
|
|
|
if [ ! -h gopath/src/${REPO_PATH} ]; then
|
|
mkdir -p gopath/src/${ORG_PATH}
|
|
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
|
|
fi
|
|
|
|
export GOBIN=${PWD}/bin
|
|
export GOPATH=${PWD}/gopath
|
|
|
|
echo "Building plugins"
|
|
|
|
PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/*"
|
|
for d in $PLUGINS; do
|
|
if [ -d $d ]; then
|
|
plugin=$(basename $d)
|
|
echo " " $plugin
|
|
go install ${REPO_PATH}/$d
|
|
fi
|
|
done
|
|
|
|
if [ ! -h $GOBIN/host-local-ptp ]; then
|
|
ln -s host-local $GOBIN/host-local-ptp
|
|
fi
|