mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-02 12:00:18 +00:00
Merge c31427f14b
into e33f15a128
This commit is contained in:
commit
4bf61e8b3f
@ -36,3 +36,8 @@ func New(logger logger.Interface) []*cli.Command {
|
||||
cudacompat.NewCommand(logger),
|
||||
}
|
||||
}
|
||||
|
||||
func WarnOnUnsupportedSubcommand(logger logger.Interface, c *cli.Context) error {
|
||||
logger.Warningf("Unsupported hook or arguments %v", c.Args())
|
||||
return nil
|
||||
}
|
||||
|
@ -51,6 +51,11 @@ func main() {
|
||||
c.Usage = "Command to structure files for usage inside a container, called as hooks from a container runtime, defined in a CDI yaml file"
|
||||
c.Version = info.GetVersionString()
|
||||
|
||||
// We add an action to the hook
|
||||
c.Action = func(ctx *cli.Context) error {
|
||||
return commands.WarnOnUnsupportedSubcommand(logger, ctx)
|
||||
}
|
||||
|
||||
// Setup the flags for this command
|
||||
c.Flags = []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
|
@ -41,6 +41,9 @@ func (m hookCommand) build() *cli.Command {
|
||||
hook := cli.Command{
|
||||
Name: "hook",
|
||||
Usage: "A collection of hooks that may be injected into an OCI spec",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
return commands.WarnOnUnsupportedSubcommand(m.logger, ctx)
|
||||
},
|
||||
}
|
||||
|
||||
hook.Subcommands = commands.New(m.logger)
|
||||
|
Loading…
Reference in New Issue
Block a user