Skip to content

Commit 1876098

Browse files
ashvindeodhartamilmani1989
authored andcommitted
Fill in the plugin version in -about- string (#165)
1 parent 509a6ae commit 1876098

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cni/plugin.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
// Plugin is the parent class for CNI plugins.
2424
type Plugin struct {
2525
*common.Plugin
26+
version string
2627
}
2728

2829
// NewPlugin creates a new CNI plugin.
@@ -34,7 +35,8 @@ func NewPlugin(name, version string) (*Plugin, error) {
3435
}
3536

3637
return &Plugin{
37-
Plugin: plugin,
38+
Plugin: plugin,
39+
version: version,
3840
}, nil
3941
}
4042

@@ -83,7 +85,7 @@ func (plugin *Plugin) Execute(api PluginApi) (err error) {
8385
pluginInfo := cniVers.PluginSupports(supportedVersions...)
8486

8587
// Parse args and call the appropriate cmd handler.
86-
cniErr := cniSkel.PluginMainWithError(api.Add, api.Get, api.Delete, pluginInfo)
88+
cniErr := cniSkel.PluginMainWithError(api.Add, api.Get, api.Delete, pluginInfo, plugin.version)
8789
if cniErr != nil {
8890
cniErr.Print()
8991
return cniErr

0 commit comments

Comments
 (0)