Update driver version during build time

update driver version and add git commit
to the image. This will help us to identify
what latest git commit image contains.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2019-07-12 15:48:00 +05:30
parent 0d566ee30c
commit 3f8bd3b2a6
6 changed files with 24 additions and 11 deletions

View File

@ -39,6 +39,14 @@ func RoundUpToMiB(size int64) int64 {
return roundUpSize(requestBytes, MiB)
}
// variables which will be set during the build time
var (
// GitCommit tell the latest git commit image is built from
GitCommit string
// DriverVersion which will be driver version
DriverVersion string
)
func roundUpSize(volumeSizeBytes, allocationUnitBytes int64) int64 {
roundedUp := volumeSizeBytes / allocationUnitBytes
if volumeSizeBytes%allocationUnitBytes > 0 {