Skip to content

Commit

Permalink
feat: Include Cloud-Z version in JSON report
Browse files Browse the repository at this point in the history
  • Loading branch information
kichik committed Jan 14, 2022
1 parent 8abde9f commit 98cea09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ import (
)

var (
version = "dev"
commit = "none"
date = "unknown"
builtBy = "unknown"
version = "dev"
commit = "none"
date = "unknown"
builtBy = "unknown"
versionString = fmt.Sprintf("%s, commit %s, built at %s by %s", version, commit, date, builtBy)
)

var noColor bool = false

var rootCmd = &cobra.Command{
Use: "cloud-z",
Short: "Cloud-Z gathers information on cloud instances",
Version: fmt.Sprintf("%s, commit %s, built at %s by %s", version, commit, date, builtBy),
Version: versionString,
Run: func(cmd *cobra.Command, args []string) {
report := &reporting.Report{}
report := &reporting.Report{
CloudZVersion: versionString,
}

allCloudProviders := []providers.CloudProvider{
&providers.AwsProvider{},
Expand Down
1 change: 1 addition & 0 deletions reporting/structs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package reporting

type Report struct {
CloudZVersion string `json:"cloud-z-version"`
Cloud string `json:"cloud"`
InstanceId string `json:"-"`
InstanceType string `json:"instanceType"`
Expand Down

0 comments on commit 98cea09

Please sign in to comment.