Skip to content

Commit

Permalink
add appversion
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Jan 4, 2022
1 parent 6e3e34a commit f85a141
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"time"
)

const appversion = "0.0.7"

func main() {
// install namespace and app name
var kubeconfig *string
Expand All @@ -46,9 +48,16 @@ func main() {
} else {
kubeconfig = flag.String("kubeconfig", "", "absolute path to the kubeconfig file")
}
version := flag.Bool("version", false, "app version")

flag.Parse()

// print app version and exit
if *version {
fmt.Println("version", appversion)
os.Exit(0)
}

// use the current context in kubeconfig
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)
if err != nil {
Expand Down

0 comments on commit f85a141

Please sign in to comment.