Add version access to the controller
This MR adds a version to the controller.
Description
The controllers version contains Major, Minor and Patch information. Additionally the version does provide build information like, e.g: goos, goarch, commit revision, commit timestamp and if the binary contains changes with regard to the commit.
The version can be provided through ldflags
while building: go build -ldflags "-X code.fbi.h-da.de/danet/gosdn/controller/version.versionString=02.003.100" -trimpath -o ./gosdn ./controller/cmd/gosdn
Printing the version through ./gosdn version
looks like this:
Related Issue
Motivation and Context
Information about the current version of a binary is good to have. But we will need this especially for the plugin registry to verify that the controller will get the plugins for a specific version.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
-
My code follows the code style of this project. -
My change requires a change to the documentation. -
I have updated the documentation accordingly. -
I have read the CONTRIBUTING document. -
I have added tests to cover my changes. -
All new and existing tests passed.
Edited by Malte Bauch