mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 08:18:32 +00:00
Move create-dev-char-symlinks subcommand from hook to system
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
962d38e9dd
commit
8188400c97
@ -18,7 +18,7 @@ package hook
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
chmod "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/chmod"
|
chmod "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/chmod"
|
||||||
devchar "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/create-dev-char-symlinks"
|
|
||||||
symlinks "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/create-symlinks"
|
symlinks "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/create-symlinks"
|
||||||
ldcache "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/update-ldcache"
|
ldcache "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/hook/update-ldcache"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -49,7 +49,6 @@ func (m hookCommand) build() *cli.Command {
|
|||||||
ldcache.NewCommand(m.logger),
|
ldcache.NewCommand(m.logger),
|
||||||
symlinks.NewCommand(m.logger),
|
symlinks.NewCommand(m.logger),
|
||||||
chmod.NewCommand(m.logger),
|
chmod.NewCommand(m.logger),
|
||||||
devchar.NewCommand(m.logger),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &hook
|
return &hook
|
||||||
|
@ -45,7 +45,7 @@ type config struct {
|
|||||||
createAll bool
|
createAll bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCommand constructs a hook sub-command with the specified logger
|
// NewCommand constructs a command sub-command with the specified logger
|
||||||
func NewCommand(logger *logrus.Logger) *cli.Command {
|
func NewCommand(logger *logrus.Logger) *cli.Command {
|
||||||
c := command{
|
c := command{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
@ -60,7 +60,7 @@ func (m command) build() *cli.Command {
|
|||||||
// Create the 'create-dev-char-symlinks' command
|
// Create the 'create-dev-char-symlinks' command
|
||||||
c := cli.Command{
|
c := cli.Command{
|
||||||
Name: "create-dev-char-symlinks",
|
Name: "create-dev-char-symlinks",
|
||||||
Usage: "A hook to create symlinks to possible /dev/nv* devices in /dev/char",
|
Usage: "A utility to create symlinks to possible /dev/nv* devices in /dev/char",
|
||||||
Before: func(c *cli.Context) error {
|
Before: func(c *cli.Context) error {
|
||||||
return m.validateFlags(c, &cfg)
|
return m.validateFlags(c, &cfg)
|
||||||
},
|
},
|
@ -17,7 +17,7 @@
|
|||||||
package system
|
package system
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/runtime/configure"
|
devchar "github.com/NVIDIA/nvidia-container-toolkit/cmd/nvidia-ctk/system/create-dev-char-symlinks"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
@ -42,7 +42,7 @@ func (m command) build() *cli.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
system.Subcommands = []*cli.Command{
|
system.Subcommands = []*cli.Command{
|
||||||
configure.NewCommand(m.logger),
|
devchar.NewCommand(m.logger),
|
||||||
}
|
}
|
||||||
|
|
||||||
return &system
|
return &system
|
||||||
|
Loading…
Reference in New Issue
Block a user