1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/cmd/cli/kubectl-kyverno/version/command.go
Charles-Edouard Brétéché 43a7c26768
fix: use golang builtin version management (#7654)
* fix: use golang builtin version management

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-06-30 23:27:06 +00:00

22 lines
489 B
Go

package version
import (
"fmt"
"github.com/kyverno/kyverno/pkg/version"
"github.com/spf13/cobra"
)
// Command returns version command
func Command() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Shows current version of kyverno.",
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())
return nil
},
}
}