1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/cmd/cli/kubectl-kyverno/version/command.go

23 lines
489 B
Go
Raw Normal View History

2020-03-06 03:00:18 +05:30
package version
import (
"fmt"
"github.com/kyverno/kyverno/pkg/version"
2020-03-06 03:00:18 +05:30
"github.com/spf13/cobra"
)
2020-11-17 13:07:30 -08:00
// Command returns version command
2020-03-06 03:00:18 +05:30
func Command() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Shows current version of kyverno.",
2020-03-06 03:00:18 +05:30
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("Version: %s\n", version.Version())
fmt.Printf("Time: %s\n", version.Time())
fmt.Printf("Git commit ID: %s\n", version.Hash())
2020-03-06 03:00:18 +05:30
return nil
},
}
}