plugins: correctly output build version, cosmetic cleanups

Now that libcni has the ability to print a version message, plumb it
through correctly.

While we're at it,
- fix import paths
- run gofmt
- add some more comments to sample
- add container runtime swappability for release
This commit is contained in:
Casey Callendrello
2019-04-15 16:13:02 +02:00
parent 6733d30762
commit 72f2a1ffd4
26 changed files with 139 additions and 73 deletions

View File

@ -15,11 +15,14 @@
package main
import (
"github.com/vishvananda/netlink"
"github.com/containernetworking/cni/pkg/skel"
"github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/cni/pkg/version"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/vishvananda/netlink"
bv "github.com/containernetworking/plugins/pkg/utils/buildversion"
)
func cmdAdd(args *skel.CmdArgs) error {
@ -71,8 +74,7 @@ func cmdDel(args *skel.CmdArgs) error {
}
func main() {
// TODO: implement plugin version
skel.PluginMain(cmdAdd, cmdCheck, cmdDel, version.All, "TODO")
skel.PluginMain(cmdAdd, cmdCheck, cmdDel, version.All, bv.BuildString("loopback"))
}
func cmdCheck(args *skel.CmdArgs) error {