mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 05:59:22 +00:00
Move version to main package
This commit is contained in:
parent
9410471142
commit
c3e6205f15
3 changed files with 4 additions and 7 deletions
|
|
@ -20,7 +20,7 @@ builds:
|
|||
- -a
|
||||
ldflags:
|
||||
- -extldflags "-static"
|
||||
- -X github.com/yannh/kubeconform/pkg/config.version={{.Tag}}
|
||||
- -X main.version={{.Tag}}
|
||||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import (
|
|||
"github.com/yannh/kubeconform/pkg/validator"
|
||||
)
|
||||
|
||||
var version = "development"
|
||||
|
||||
func processResults(cancel context.CancelFunc, o output.Output, validationResults <-chan validator.Result, exitOnError bool) <-chan bool {
|
||||
success := true
|
||||
result := make(chan bool)
|
||||
|
|
@ -49,6 +51,7 @@ func realMain() int {
|
|||
if cfg.Help {
|
||||
return 0
|
||||
} else if cfg.Version {
|
||||
fmt.Println(version)
|
||||
return 0
|
||||
} else if out != "" {
|
||||
fmt.Println(out)
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
var version = "development"
|
||||
|
||||
type Config struct {
|
||||
Cache string
|
||||
CPUProfileFile string
|
||||
|
|
@ -102,9 +100,5 @@ func FromFlags(progName string, args []string) (Config, string, error) {
|
|||
flags.Usage()
|
||||
}
|
||||
|
||||
if c.Version {
|
||||
fmt.Println(version)
|
||||
}
|
||||
|
||||
return c, buf.String(), err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue