From 5e3e91a01056d2269c869db87f78dbc334326937 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 18 Oct 2024 16:26:20 +0200 Subject: [PATCH] [no-relnote] Minor cleanup in create-symlinks Signed-off-by: Evan Lezar --- .../create-symlinks/create-symlinks.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/nvidia-cdi-hook/create-symlinks/create-symlinks.go b/cmd/nvidia-cdi-hook/create-symlinks/create-symlinks.go index 03956333..646cb266 100644 --- a/cmd/nvidia-cdi-hook/create-symlinks/create-symlinks.go +++ b/cmd/nvidia-cdi-hook/create-symlinks/create-symlinks.go @@ -46,11 +46,10 @@ func NewCommand(logger logger.Interface) *cli.Command { return c.build() } -// build +// build creates the create-symlink command. func (m command) build() *cli.Command { cfg := config{} - // Create the '' command c := cli.Command{ Name: "create-symlinks", Usage: "A hook to create symlinks in the container.", @@ -60,20 +59,23 @@ func (m command) build() *cli.Command { } c.Flags = []cli.Flag{ - &cli.StringFlag{ - Name: "host-root", - Usage: "The root on the host filesystem to use to resolve symlinks", - Destination: &cfg.hostRoot, - }, &cli.StringSliceFlag{ Name: "link", Usage: "Specify a specific link to create. The link is specified as target::link", Destination: &cfg.links, }, + // The following flags are testing-only flags. + &cli.StringFlag{ + Name: "host-root", + Usage: "The root on the host filesystem to use to resolve symlinks. This is only intended for testing.", + Destination: &cfg.hostRoot, + Hidden: true, + }, &cli.StringFlag{ Name: "container-spec", - Usage: "Specify the path to the OCI container spec. If empty or '-' the spec will be read from STDIN", + Usage: "Specify the path to the OCI container spec. If empty or '-' the spec will be read from STDIN. This is only intended for testing.", Destination: &cfg.containerSpec, + Hidden: true, }, }