Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
New command to print version
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Glaser authored and jinankjain committed Sep 25, 2017
1 parent 9d43f6b commit b03a584
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Available Commands:
np Audit namespace network policies
rbac Audit RBAC things
sc Audit container security contexts
version Print the version number of kubeaudit
Flags:
-a, --allPods Audit againsts pods in all the phases (default Running Phase)
Expand Down
23 changes: 23 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

func init() {
RootCmd.AddCommand(versionCmd)
}

const Version = "0.1.0"

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of kubeaudit",
Long: `This just prints the version of kubeaudit`,
Run: func(cmd *cobra.Command, args []string) {
log.WithFields(log.Fields{
"Version": Version,
}).Info("Kubeaudit")
},
}

0 comments on commit b03a584

Please sign in to comment.