This commit is contained in:
Evan Lezar 2025-03-20 15:23:49 +01:00 committed by GitHub
commit 4bf61e8b3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -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
}

View File

@ -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{

View File

@ -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)