Skip to content

Commit

Permalink
✨ rename fleet => inventory
Browse files Browse the repository at this point in the history
This better matches the more commonly used definition. We will keep fleet working for the next  major version and then slowly deprecate it.

Analogous to: mondoohq/cnquery#1920

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 25, 2023
1 parent 997093e commit b0476e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/cnspec/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func init() {

// v6 should make detect-cicd and category flag public
scanCmd.Flags().Bool("detect-cicd", true, "Try to detect CI/CD environments. If detected, set the asset category to 'cicd'.")
scanCmd.Flags().String("category", "fleet", "Set the category for the assets to 'fleet|cicd'.")
scanCmd.Flags().String("category", "inventory", "Set the category for the assets to 'inventory|cicd'.")
scanCmd.Flags().MarkHidden("category")
}

Expand Down
2 changes: 1 addition & 1 deletion apps/cnspec/cmd/vuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var vulnCmd = &cobra.Command{

// // v6 should make detect-cicd and category flag public, default for "detect-cicd" should switch to true
// cmd.Flags().Bool("detect-cicd", true, "Try to detect CI/CD environments. If successful, sets the asset category to 'cicd'.")
// cmd.Flags().String("category", "fleet", "Set the category for the assets to 'fleet|cicd'.")
// cmd.Flags().String("category", "inventory", "Set the category for the assets to 'inventory|cicd'.")
// cmd.Flags().MarkHidden("category")

// // output rendering
Expand Down
6 changes: 3 additions & 3 deletions cli/reporter/print_compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ func (r *defaultReporter) printSummary(orderedAssets []assetMrnName) {
url := ""
if len(orderedAssets) > 1 {
// we do not have a space url, so we extract it form the asset url
// https://console.mondoo.com/space/fleet/2JtqGyVTZULTW0uwQ5YxXW4nh6Y?spaceId=dazzling-golick-767384
// https://console.mondoo.com/space/inventory/2JtqGyVTZULTW0uwQ5YxXW4nh6Y?spaceId=dazzling-golick-767384
// an individual asset url wouldn't make sense here
// when runnin inside cicd, we create an url for the cicd project
spaceUrlRegexp := regexp.MustCompile(`^(http.*)/fleet/[a-zA-Z0-9-]+(\?.+)$`)
spaceUrlRegexp := regexp.MustCompile(`^(http.*)/inventory/[a-zA-Z0-9-]+(\?.+)$`)
m := spaceUrlRegexp.FindStringSubmatch(assetUrl)
if projectId != "" {
url = m[1] + "/cicd/jobs" + m[2] + "&projectId=" + projectId
} else {
url = m[1] + "/fleet" + m[2]
url = m[1] + "/inventory" + m[2]
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/testdata/report-ubuntu.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"labels": {
"mondoo.com/project-id": ""
},
"url": "https://console.mondoo.com/space/fleet/2DRZ1cCWFyTYCArycAXHwvn1oU2?spaceId=dazzling-golick-767384"
"url": "https://console.mondoo.com/space/inventory/2DRZ1cCWFyTYCArycAXHwvn1oU2?spaceId=dazzling-golick-767384"
}
},
"bundle": {
Expand Down

0 comments on commit b0476e2

Please sign in to comment.