From 761fc2956761692edc5b828aaa57b156181e6e90 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 9 Jun 2023 17:28:42 +0200 Subject: [PATCH] Add version info to config CLIs Signed-off-by: Evan Lezar --- tools/container/containerd/containerd.go | 3 ++- tools/container/crio/crio.go | 4 ++-- tools/container/docker/docker.go | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/container/containerd/containerd.go b/tools/container/containerd/containerd.go index f72a121b..548d09c5 100644 --- a/tools/container/containerd/containerd.go +++ b/tools/container/containerd/containerd.go @@ -24,6 +24,7 @@ import ( "syscall" "time" + "github.com/NVIDIA/nvidia-container-toolkit/internal/info" "github.com/NVIDIA/nvidia-container-toolkit/pkg/config/engine/containerd" "github.com/NVIDIA/nvidia-container-toolkit/tools/container" log "github.com/sirupsen/logrus" @@ -78,7 +79,7 @@ func main() { c := cli.NewApp() c.Name = "containerd" c.Usage = "Update a containerd config with the nvidia-container-runtime" - c.Version = "0.1.0" + c.Version = info.GetVersionString() // Create the 'setup' subcommand setup := cli.Command{} diff --git a/tools/container/crio/crio.go b/tools/container/crio/crio.go index aa7c4d62..0d8a1feb 100644 --- a/tools/container/crio/crio.go +++ b/tools/container/crio/crio.go @@ -24,6 +24,7 @@ import ( "path/filepath" "github.com/NVIDIA/nvidia-container-toolkit/internal/config" + "github.com/NVIDIA/nvidia-container-toolkit/internal/info" "github.com/NVIDIA/nvidia-container-toolkit/pkg/config/engine/crio" "github.com/NVIDIA/nvidia-container-toolkit/tools/container" log "github.com/sirupsen/logrus" @@ -67,8 +68,7 @@ func main() { c := cli.NewApp() c.Name = "crio" c.Usage = "Update cri-o hooks to include the NVIDIA runtime hook" - c.ArgsUsage = "" - c.Version = "0.1.0" + c.Version = info.GetVersionString() // Create the 'setup' subcommand setup := cli.Command{} diff --git a/tools/container/docker/docker.go b/tools/container/docker/docker.go index cc13d3bc..8807af8a 100644 --- a/tools/container/docker/docker.go +++ b/tools/container/docker/docker.go @@ -23,6 +23,7 @@ import ( "syscall" "time" + "github.com/NVIDIA/nvidia-container-toolkit/internal/info" "github.com/NVIDIA/nvidia-container-toolkit/pkg/config/engine/docker" "github.com/NVIDIA/nvidia-container-toolkit/tools/container" log "github.com/sirupsen/logrus" @@ -65,7 +66,7 @@ func main() { c := cli.NewApp() c.Name = "docker" c.Usage = "Update docker config with the nvidia runtime" - c.Version = "0.1.0" + c.Version = info.GetVersionString() // Create the 'setup' subcommand setup := cli.Command{}